This commit is contained in:
Solovyov1796 2024-08-03 22:13:03 +08:00
parent f7e24d9021
commit 38c17a3052
2 changed files with 2 additions and 4 deletions

View File

@ -5,8 +5,6 @@ import (
"testing" "testing"
"time" "time"
"github.com/0glabs/0g-chain/chaincfg"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/testutil/sims"

View File

@ -678,7 +678,7 @@ func (suite *evmBankKeeperTestSuite) TestConvertOneA0giToNeuronIfNeeded() {
suite.SetupTest() suite.SetupTest()
suite.FundAccountWithZgChain(suite.Addrs[0], tt.startingCoins) suite.FundAccountWithZgChain(suite.Addrs[0], tt.startingCoins)
err := suite.EvmBankKeeper.ConvertOneA0giToNeuronIfNeeded(suite.Ctx, suite.Addrs[0], neuronNeeded) err := suite.EvmBankKeeper.ConvertOneUa0giToNeuronIfNeeded(suite.Ctx, suite.Addrs[0], neuronNeeded)
moduleZgChain := suite.BankKeeper.GetBalance(suite.Ctx, suite.AccountKeeper.GetModuleAddress(types.ModuleName), chaincfg.DisplayDenom) moduleZgChain := suite.BankKeeper.GetBalance(suite.Ctx, suite.AccountKeeper.GetModuleAddress(types.ModuleName), chaincfg.DisplayDenom)
if tt.success { if tt.success {
suite.Require().NoError(err) suite.Require().NoError(err)
@ -726,7 +726,7 @@ func (suite *evmBankKeeperTestSuite) TestConvertNeuronToA0gi() {
err := suite.App.FundModuleAccount(suite.Ctx, types.ModuleName, sdk.NewCoins(sdk.NewInt64Coin(chaincfg.DisplayDenom, 10))) err := suite.App.FundModuleAccount(suite.Ctx, types.ModuleName, sdk.NewCoins(sdk.NewInt64Coin(chaincfg.DisplayDenom, 10)))
suite.Require().NoError(err) suite.Require().NoError(err)
suite.FundAccountWithZgChain(suite.Addrs[0], tt.startingCoins) suite.FundAccountWithZgChain(suite.Addrs[0], tt.startingCoins)
err = suite.EvmBankKeeper.ConvertNeuronToA0gi(suite.Ctx, suite.Addrs[0]) err = suite.EvmBankKeeper.ConvertNeuronToUa0gi(suite.Ctx, suite.Addrs[0])
suite.Require().NoError(err) suite.Require().NoError(err)
neuron := suite.Keeper.GetBalance(suite.Ctx, suite.Addrs[0]) neuron := suite.Keeper.GetBalance(suite.Ctx, suite.Addrs[0])
suite.Require().Equal(tt.expectedCoins.AmountOf(chaincfg.BaseDenom), neuron) suite.Require().Equal(tt.expectedCoins.AmountOf(chaincfg.BaseDenom), neuron)