From 0a46c18357f78b7e3ca8a2493b4589575025d5b6 Mon Sep 17 00:00:00 2001 From: tungle Date: Thu, 7 Mar 2024 13:37:01 +0700 Subject: [PATCH] merge variable --- app/upgrades/v6_4_6/upgrades_test.go | 36 ++++++++++++---------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/app/upgrades/v6_4_6/upgrades_test.go b/app/upgrades/v6_4_6/upgrades_test.go index bf058e73f..4ba7bc6c6 100644 --- a/app/upgrades/v6_4_6/upgrades_test.go +++ b/app/upgrades/v6_4_6/upgrades_test.go @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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)