-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Integration tests for erc20 module (#26)
* update tests * fix * fix:tests * Integration tests for erc20
- Loading branch information
1 parent
6f517a5
commit 180177b
Showing
18 changed files
with
152 additions
and
1,605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
package testutil | ||
|
||
import ( | ||
minttypes "sidechain/x/mint/types" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" | ||
inflationtypes "github.com/evmos/evmos/v11/x/inflation/types" | ||
) | ||
|
||
// FundAccount is a utility function that funds an account by minting and | ||
// sending the coins to the address. This should be used for testing purposes | ||
// only! | ||
func FundAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amounts sdk.Coins) error { | ||
if err := bankKeeper.MintCoins(ctx, inflationtypes.ModuleName, amounts); err != nil { | ||
if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { | ||
return err | ||
} | ||
|
||
return bankKeeper.SendCoinsFromModuleToAccount(ctx, inflationtypes.ModuleName, addr, amounts) | ||
return bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, amounts) | ||
} | ||
|
||
// FundModuleAccount is a utility function that funds a module account by | ||
// minting and sending the coins to the address. This should be used for testing | ||
// purposes only! | ||
func FundModuleAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, recipientMod string, amounts sdk.Coins) error { | ||
if err := bankKeeper.MintCoins(ctx, inflationtypes.ModuleName, amounts); err != nil { | ||
if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { | ||
return err | ||
} | ||
|
||
return bankKeeper.SendCoinsFromModuleToModule(ctx, inflationtypes.ModuleName, recipientMod, amounts) | ||
return bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, recipientMod, amounts) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.