Skip to content

Commit

Permalink
unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Sep 28, 2021
1 parent 99c2c39 commit 0d42f57
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions x/cronos/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,78 @@ func (suite *CronosTestSuite) TestInitGenesis() {
}},
true,
},
{
"Wrong denom in external token mapping",
func() {},
&types.GenesisState{
ExternalContracts: []types.TokenMapping{
{
Denom: "aaa/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865",
Contract: "0x0000000000000000000000000000000000000000",
},
},
},
true,
},
{
"Wrong denom in auto token mapping",
func() {},
&types.GenesisState{
AutoContracts: []types.TokenMapping{
{
Denom: "aaa/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865",
Contract: "0x0000000000000000000000000000000000000000",
},
},
},
true,
},
{
"Wrong contract in external token mapping",
func() {},
&types.GenesisState{
ExternalContracts: []types.TokenMapping{
{
Denom: "ibc/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865",
Contract: "0x00000000000000000000000000000000000000",
},
},
},
true,
},
{
"Wrong contract in auto token mapping",
func() {},
&types.GenesisState{
AutoContracts: []types.TokenMapping{
{
Denom: "ibc/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865",
Contract: "0x00000000000000000000000000000000000000",
},
},
},
true,
},
{
"Correct token mapping",
func() {},
&types.GenesisState{
Params: types.DefaultParams(),
ExternalContracts: []types.TokenMapping{
{
Denom: "ibc/6B5A664BF0AF4F71B2F0BAA33141E2F1321242FBD5D19762F541EC971ACB0865",
Contract: "0x0000000000000000000000000000000000000000",
},
},
AutoContracts: []types.TokenMapping{
{
Denom: "gravity0x0000000000000000000000000000000000000000",
Contract: "0x0000000000000000000000000000000000000000",
},
},
},
false,
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit 0d42f57

Please sign in to comment.