Skip to content

Commit

Permalink
merge variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tungleanh0902 committed Mar 7, 2024
1 parent bbe4dab commit 0a46c18
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions app/upgrades/v6_4_6/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ func checkUpgradeAuthModule(s *UpgradeTestSuite, baseAccount, stakingModuleAccou
/* CHECK BASE ACCOUNT */
_, bz, _ := bech32.DecodeAndConvert(baseAccount.String())
newBech32AddrBaseAccount, _ := bech32.ConvertAndEncode(utils.NewBech32PrefixAccAddr, bz)
var newPrefixAddrBA authtypes.AccountI
newPrefixAddrBA = s.App.AccountKeeper.GetAccount(s.Ctx, baseAccount)
switch acci := newPrefixAddrBA.(type) {
var newPrefixAddr authtypes.AccountI
newPrefixAddr = s.App.AccountKeeper.GetAccount(s.Ctx, baseAccount)
switch acci := newPrefixAddr.(type) {
case *authtypes.BaseAccount:
acc := acci
s.Suite.Equal(acc.Address, newBech32AddrBaseAccount)
Expand All @@ -312,9 +312,8 @@ func checkUpgradeAuthModule(s *UpgradeTestSuite, baseAccount, stakingModuleAccou
/* CHECK MODULE ACCOUNT */
_, bz, _ = bech32.DecodeAndConvert(stakingModuleAccount.String())
newBech32AddrModuleAccount, _ := bech32.ConvertAndEncode(utils.NewBech32PrefixAccAddr, bz)
var newPrefixAddrMA authtypes.AccountI
newPrefixAddrMA = s.App.AccountKeeper.GetAccount(s.Ctx, stakingModuleAccount)
switch acci := newPrefixAddrMA.(type) {
newPrefixAddr = s.App.AccountKeeper.GetAccount(s.Ctx, stakingModuleAccount)
switch acci := newPrefixAddr.(type) {
case *authtypes.ModuleAccount:
acc := acci
s.Suite.Equal(acc.Address, newBech32AddrModuleAccount)
Expand All @@ -325,9 +324,8 @@ func checkUpgradeAuthModule(s *UpgradeTestSuite, baseAccount, stakingModuleAccou
/* CHECK BASE VESTING ACCOUNT */
_, bz, _ = bech32.DecodeAndConvert(baseVestingAccount.String())
newBech32AddrBaseVestingAccount, _ := bech32.ConvertAndEncode(utils.NewBech32PrefixAccAddr, bz)
var newPrefixAddrBVA authtypes.AccountI
newPrefixAddrBVA = s.App.AccountKeeper.GetAccount(s.Ctx, baseVestingAccount)
switch acci := newPrefixAddrBVA.(type) {
newPrefixAddr = s.App.AccountKeeper.GetAccount(s.Ctx, baseVestingAccount)
switch acci := newPrefixAddr.(type) {
case *vestingtypes.BaseVestingAccount:
acc := acci
s.Suite.Equal(acc.Address, newBech32AddrBaseVestingAccount)
Expand All @@ -338,9 +336,8 @@ func checkUpgradeAuthModule(s *UpgradeTestSuite, baseAccount, stakingModuleAccou
// CHECK CONTINUOUS VESTING ACCOUNT AND MULTISIG
_, bz, _ = bech32.DecodeAndConvert(continuousVestingAccount.String())
newBech32AddrConVestingAccount, _ := bech32.ConvertAndEncode(utils.NewBech32PrefixAccAddr, bz)
var newPrefixAddrCVA authtypes.AccountI
newPrefixAddrCVA = s.App.AccountKeeper.GetAccount(s.Ctx, continuousVestingAccount)
switch acci := newPrefixAddrCVA.(type) {
newPrefixAddr = s.App.AccountKeeper.GetAccount(s.Ctx, continuousVestingAccount)
switch acci := newPrefixAddr.(type) {
case *vestingtypes.ContinuousVestingAccount:
acc := acci
s.Suite.Equal(acc.Address, newBech32AddrConVestingAccount)
Expand All @@ -351,9 +348,8 @@ func checkUpgradeAuthModule(s *UpgradeTestSuite, baseAccount, stakingModuleAccou
// CHECK DELAYED VESTING ACCOUNT
_, bz, _ = bech32.DecodeAndConvert(delayedVestingAccount.String())
newBech32AddrDelayedVestingAccount, _ := bech32.ConvertAndEncode(utils.NewBech32PrefixAccAddr, bz)
var newPrefixAddrDVA authtypes.AccountI
newPrefixAddrDVA = s.App.AccountKeeper.GetAccount(s.Ctx, delayedVestingAccount)
switch acci := newPrefixAddrDVA.(type) {
newPrefixAddr = s.App.AccountKeeper.GetAccount(s.Ctx, delayedVestingAccount)
switch acci := newPrefixAddr.(type) {
case *vestingtypes.DelayedVestingAccount:
acc := acci
s.Suite.Equal(acc.Address, newBech32AddrDelayedVestingAccount)
Expand All @@ -364,9 +360,8 @@ func checkUpgradeAuthModule(s *UpgradeTestSuite, baseAccount, stakingModuleAccou
// CHECK PERIODIC VESTING ACCOUNT
_, bz, _ = bech32.DecodeAndConvert(periodicVestingAccount.String())
newBech32AddrPeriodicVestingAccount, _ := bech32.ConvertAndEncode(utils.NewBech32PrefixAccAddr, bz)
var newPrefixAddrPVA authtypes.AccountI
newPrefixAddrPVA = s.App.AccountKeeper.GetAccount(s.Ctx, periodicVestingAccount)
switch acci := newPrefixAddrPVA.(type) {
newPrefixAddr = s.App.AccountKeeper.GetAccount(s.Ctx, periodicVestingAccount)
switch acci := newPrefixAddr.(type) {
case *vestingtypes.PeriodicVestingAccount:
acc := acci
s.Suite.Equal(acc.Address, newBech32AddrPeriodicVestingAccount)
Expand All @@ -377,9 +372,8 @@ func checkUpgradeAuthModule(s *UpgradeTestSuite, baseAccount, stakingModuleAccou
// CHECK PERMANENT LOCKED ACCOUNT
_, bz, _ = bech32.DecodeAndConvert(permanentLockedAccount.String())
newBech32AddrPermanentVestingAccount, _ := bech32.ConvertAndEncode(utils.NewBech32PrefixAccAddr, bz)
var newPrefixAddrPLA authtypes.AccountI
newPrefixAddrPLA = s.App.AccountKeeper.GetAccount(s.Ctx, permanentLockedAccount)
switch acci := newPrefixAddrPLA.(type) {
newPrefixAddr = s.App.AccountKeeper.GetAccount(s.Ctx, permanentLockedAccount)
switch acci := newPrefixAddr.(type) {
case *vestingtypes.PermanentLockedAccount:
acc := acci
s.Suite.Equal(acc.Address, newBech32AddrPermanentVestingAccount)
Expand Down

0 comments on commit 0a46c18

Please sign in to comment.