2020-04-27 11:04:26 -07:00
|
|
|
package ibc_test
|
2020-04-24 08:52:07 -07:00
|
|
|
|
|
|
|
import (
|
2020-08-07 01:33:47 -07:00
|
|
|
"fmt"
|
2020-10-19 11:21:53 -07:00
|
|
|
"testing"
|
2020-08-07 01:33:47 -07:00
|
|
|
|
2020-10-19 11:21:53 -07:00
|
|
|
"github.com/stretchr/testify/suite"
|
2020-08-17 02:04:50 -07:00
|
|
|
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
|
|
|
|
2020-08-07 01:33:47 -07:00
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
|
|
"github.com/cosmos/cosmos-sdk/simapp"
|
2020-10-02 02:03:02 -07:00
|
|
|
ibc "github.com/cosmos/cosmos-sdk/x/ibc/core"
|
|
|
|
clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"
|
|
|
|
connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types"
|
|
|
|
channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"
|
|
|
|
commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types"
|
|
|
|
host "github.com/cosmos/cosmos-sdk/x/ibc/core/24-host"
|
|
|
|
"github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
|
|
|
|
"github.com/cosmos/cosmos-sdk/x/ibc/core/types"
|
2020-10-01 02:38:53 -07:00
|
|
|
ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types"
|
|
|
|
localhosttypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/09-localhost/types"
|
2020-07-14 01:43:26 -07:00
|
|
|
ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing"
|
2020-04-24 08:52:07 -07:00
|
|
|
)
|
|
|
|
|
2020-10-19 11:21:53 -07:00
|
|
|
const (
|
|
|
|
connectionID = "connectionidone"
|
|
|
|
clientID = "clientidone"
|
|
|
|
connectionID2 = "connectionidtwo"
|
|
|
|
clientID2 = "clientidtwo"
|
|
|
|
|
|
|
|
port1 = "firstport"
|
|
|
|
port2 = "secondport"
|
|
|
|
|
|
|
|
channel1 = "firstchannel"
|
|
|
|
channel2 = "secondchannel"
|
|
|
|
)
|
|
|
|
|
|
|
|
var clientHeight = clienttypes.NewHeight(0, 10)
|
|
|
|
|
|
|
|
type IBCTestSuite struct {
|
|
|
|
suite.Suite
|
|
|
|
|
|
|
|
coordinator *ibctesting.Coordinator
|
|
|
|
|
|
|
|
chainA *ibctesting.TestChain
|
|
|
|
chainB *ibctesting.TestChain
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetupTest creates a coordinator with 2 test chains.
|
|
|
|
func (suite *IBCTestSuite) SetupTest() {
|
|
|
|
suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2)
|
|
|
|
|
|
|
|
suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0))
|
|
|
|
suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1))
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestIBCTestSuite(t *testing.T) {
|
|
|
|
suite.Run(t, new(IBCTestSuite))
|
|
|
|
}
|
|
|
|
|
2020-04-27 11:04:26 -07:00
|
|
|
func (suite *IBCTestSuite) TestValidateGenesis() {
|
2020-10-14 07:51:11 -07:00
|
|
|
header := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, suite.chainA.CurrentHeader.Height, clienttypes.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height-1)), suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers)
|
|
|
|
|
2020-04-24 08:52:07 -07:00
|
|
|
testCases := []struct {
|
|
|
|
name string
|
2020-08-11 07:22:30 -07:00
|
|
|
genState *types.GenesisState
|
2020-04-24 08:52:07 -07:00
|
|
|
expPass bool
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
name: "default",
|
2020-06-13 07:29:00 -07:00
|
|
|
genState: types.DefaultGenesisState(),
|
2020-04-24 08:52:07 -07:00
|
|
|
expPass: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "valid genesis",
|
2020-08-11 07:22:30 -07:00
|
|
|
genState: &types.GenesisState{
|
2020-06-30 03:37:05 -07:00
|
|
|
ClientGenesis: clienttypes.NewGenesisState(
|
2020-08-20 07:23:19 -07:00
|
|
|
[]clienttypes.IdentifiedClientState{
|
|
|
|
clienttypes.NewIdentifiedClientState(
|
2020-10-14 07:51:11 -07:00
|
|
|
clientID, ibctmtypes.NewClientState(suite.chainA.ChainID, ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false),
|
2020-07-27 11:43:09 -07:00
|
|
|
),
|
2020-08-20 07:23:19 -07:00
|
|
|
clienttypes.NewIdentifiedClientState(
|
2020-09-22 07:25:58 -07:00
|
|
|
exported.Localhost, localhosttypes.NewClientState("chaindID", clientHeight),
|
2020-07-27 11:43:09 -07:00
|
|
|
),
|
2020-04-27 11:04:26 -07:00
|
|
|
},
|
2020-06-30 03:37:05 -07:00
|
|
|
[]clienttypes.ClientConsensusStates{
|
|
|
|
clienttypes.NewClientConsensusStates(
|
2020-04-27 11:04:26 -07:00
|
|
|
clientID,
|
2020-09-14 11:16:42 -07:00
|
|
|
[]clienttypes.ConsensusStateWithHeight{
|
|
|
|
clienttypes.NewConsensusStateWithHeight(
|
2020-10-14 07:51:11 -07:00
|
|
|
header.GetHeight().(clienttypes.Height),
|
2020-09-14 11:16:42 -07:00
|
|
|
ibctmtypes.NewConsensusState(
|
2020-10-14 07:51:11 -07:00
|
|
|
header.GetTime(), commitmenttypes.NewMerkleRoot(header.Header.AppHash), header.Header.NextValidatorsHash,
|
2020-09-14 11:16:42 -07:00
|
|
|
),
|
2020-04-27 11:04:26 -07:00
|
|
|
),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
2020-05-11 08:46:00 -07:00
|
|
|
true,
|
2020-04-27 11:04:26 -07:00
|
|
|
),
|
2020-06-30 06:10:53 -07:00
|
|
|
ConnectionGenesis: connectiontypes.NewGenesisState(
|
2020-07-22 06:59:15 -07:00
|
|
|
[]connectiontypes.IdentifiedConnection{
|
2020-10-28 02:41:54 -07:00
|
|
|
connectiontypes.NewIdentifiedConnection(connectionID, connectiontypes.NewConnectionEnd(connectiontypes.INIT, clientID, connectiontypes.NewCounterparty(clientID2, connectionID2, commitmenttypes.NewMerklePrefix([]byte("prefix"))), []*connectiontypes.Version{ibctesting.ConnectionVersion})),
|
2020-04-24 08:52:07 -07:00
|
|
|
},
|
2020-06-30 06:10:53 -07:00
|
|
|
[]connectiontypes.ConnectionPaths{
|
|
|
|
connectiontypes.NewConnectionPaths(clientID, []string{host.ConnectionPath(connectionID)}),
|
2020-04-24 08:52:07 -07:00
|
|
|
},
|
|
|
|
),
|
2020-07-01 11:25:23 -07:00
|
|
|
ChannelGenesis: channeltypes.NewGenesisState(
|
|
|
|
[]channeltypes.IdentifiedChannel{
|
|
|
|
channeltypes.NewIdentifiedChannel(
|
|
|
|
port1, channel1, channeltypes.NewChannel(
|
2020-10-14 07:51:11 -07:00
|
|
|
channeltypes.INIT, channeltypes.ORDERED,
|
|
|
|
channeltypes.NewCounterparty(port2, channel2), []string{connectionID}, ibctesting.DefaultChannelVersion,
|
2020-04-29 06:17:20 -07:00
|
|
|
),
|
|
|
|
),
|
|
|
|
},
|
2020-11-02 07:13:48 -08:00
|
|
|
[]channeltypes.PacketState{
|
|
|
|
channeltypes.NewPacketState(port2, channel2, 1, []byte("ack")),
|
2020-04-29 06:17:20 -07:00
|
|
|
},
|
2020-11-02 07:13:48 -08:00
|
|
|
[]channeltypes.PacketState{
|
|
|
|
channeltypes.NewPacketState(port2, channel2, 1, []byte("")),
|
|
|
|
},
|
|
|
|
[]channeltypes.PacketState{
|
|
|
|
channeltypes.NewPacketState(port1, channel1, 1, []byte("commit_hash")),
|
2020-04-29 06:17:20 -07:00
|
|
|
},
|
2020-07-01 11:25:23 -07:00
|
|
|
[]channeltypes.PacketSequence{
|
|
|
|
channeltypes.NewPacketSequence(port1, channel1, 1),
|
2020-04-29 06:17:20 -07:00
|
|
|
},
|
2020-07-01 11:25:23 -07:00
|
|
|
[]channeltypes.PacketSequence{
|
|
|
|
channeltypes.NewPacketSequence(port2, channel2, 1),
|
2020-04-29 06:17:20 -07:00
|
|
|
},
|
2020-07-01 11:25:23 -07:00
|
|
|
[]channeltypes.PacketSequence{
|
|
|
|
channeltypes.NewPacketSequence(port2, channel2, 1),
|
2020-05-18 09:50:07 -07:00
|
|
|
},
|
2020-04-29 06:17:20 -07:00
|
|
|
),
|
2020-04-24 08:52:07 -07:00
|
|
|
},
|
|
|
|
expPass: true,
|
|
|
|
},
|
2020-04-27 11:04:26 -07:00
|
|
|
{
|
|
|
|
name: "invalid client genesis",
|
2020-08-11 07:22:30 -07:00
|
|
|
genState: &types.GenesisState{
|
2020-06-30 03:37:05 -07:00
|
|
|
ClientGenesis: clienttypes.NewGenesisState(
|
2020-08-20 07:23:19 -07:00
|
|
|
[]clienttypes.IdentifiedClientState{
|
|
|
|
clienttypes.NewIdentifiedClientState(
|
2020-10-14 07:51:11 -07:00
|
|
|
clientID, ibctmtypes.NewClientState(suite.chainA.ChainID, ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false),
|
2020-07-27 11:43:09 -07:00
|
|
|
),
|
2020-08-20 07:23:19 -07:00
|
|
|
clienttypes.NewIdentifiedClientState(
|
2020-09-22 07:25:58 -07:00
|
|
|
exported.Localhost, localhosttypes.NewClientState("(chaindID)", clienttypes.ZeroHeight()),
|
2020-07-27 11:43:09 -07:00
|
|
|
),
|
2020-04-27 11:04:26 -07:00
|
|
|
},
|
|
|
|
nil,
|
2020-05-11 08:46:00 -07:00
|
|
|
false,
|
2020-04-27 11:04:26 -07:00
|
|
|
),
|
2020-06-30 06:10:53 -07:00
|
|
|
ConnectionGenesis: connectiontypes.DefaultGenesisState(),
|
2020-04-27 11:04:26 -07:00
|
|
|
},
|
|
|
|
expPass: false,
|
|
|
|
},
|
2020-04-24 08:52:07 -07:00
|
|
|
{
|
|
|
|
name: "invalid connection genesis",
|
2020-08-11 07:22:30 -07:00
|
|
|
genState: &types.GenesisState{
|
2020-06-30 03:37:05 -07:00
|
|
|
ClientGenesis: clienttypes.DefaultGenesisState(),
|
2020-06-30 06:10:53 -07:00
|
|
|
ConnectionGenesis: connectiontypes.NewGenesisState(
|
2020-07-22 06:59:15 -07:00
|
|
|
[]connectiontypes.IdentifiedConnection{
|
2020-10-28 02:41:54 -07:00
|
|
|
connectiontypes.NewIdentifiedConnection(connectionID, connectiontypes.NewConnectionEnd(connectiontypes.INIT, "(CLIENTIDONE)", connectiontypes.NewCounterparty(clientID, connectionID2, commitmenttypes.NewMerklePrefix([]byte("prefix"))), []*connectiontypes.Version{connectiontypes.NewVersion("1.1", nil)})),
|
2020-04-24 08:52:07 -07:00
|
|
|
},
|
2020-06-30 06:10:53 -07:00
|
|
|
[]connectiontypes.ConnectionPaths{
|
|
|
|
connectiontypes.NewConnectionPaths(clientID, []string{host.ConnectionPath(connectionID)}),
|
2020-04-27 11:04:26 -07:00
|
|
|
},
|
2020-04-24 08:52:07 -07:00
|
|
|
),
|
|
|
|
},
|
|
|
|
expPass: false,
|
|
|
|
},
|
2020-04-29 06:17:20 -07:00
|
|
|
{
|
|
|
|
name: "invalid channel genesis",
|
2020-08-11 07:22:30 -07:00
|
|
|
genState: &types.GenesisState{
|
2020-06-30 03:37:05 -07:00
|
|
|
ClientGenesis: clienttypes.DefaultGenesisState(),
|
2020-06-30 06:10:53 -07:00
|
|
|
ConnectionGenesis: connectiontypes.DefaultGenesisState(),
|
2020-07-01 11:25:23 -07:00
|
|
|
ChannelGenesis: channeltypes.GenesisState{
|
2020-11-02 07:13:48 -08:00
|
|
|
Acknowledgements: []channeltypes.PacketState{
|
|
|
|
channeltypes.NewPacketState("(portID)", channel1, 1, []byte("ack")),
|
2020-04-29 06:17:20 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expPass: false,
|
|
|
|
},
|
2020-04-24 08:52:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
for _, tc := range testCases {
|
|
|
|
tc := tc
|
|
|
|
err := tc.genState.Validate()
|
|
|
|
if tc.expPass {
|
2020-04-27 11:04:26 -07:00
|
|
|
suite.Require().NoError(err, tc.name)
|
2020-04-24 08:52:07 -07:00
|
|
|
} else {
|
2020-04-27 11:04:26 -07:00
|
|
|
suite.Require().Error(err, tc.name)
|
2020-04-24 08:52:07 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-07 01:33:47 -07:00
|
|
|
|
|
|
|
func (suite *IBCTestSuite) TestInitGenesis() {
|
2020-10-14 07:51:11 -07:00
|
|
|
header := suite.chainA.CreateTMClientHeader(suite.chainA.ChainID, suite.chainA.CurrentHeader.Height, clienttypes.NewHeight(0, uint64(suite.chainA.CurrentHeader.Height-1)), suite.chainA.CurrentHeader.Time, suite.chainA.Vals, suite.chainA.Vals, suite.chainA.Signers)
|
|
|
|
|
2020-08-07 01:33:47 -07:00
|
|
|
testCases := []struct {
|
|
|
|
name string
|
2020-08-11 07:22:30 -07:00
|
|
|
genState *types.GenesisState
|
2020-08-07 01:33:47 -07:00
|
|
|
}{
|
|
|
|
{
|
|
|
|
name: "default",
|
|
|
|
genState: types.DefaultGenesisState(),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "valid genesis",
|
2020-08-11 07:22:30 -07:00
|
|
|
genState: &types.GenesisState{
|
2020-08-07 01:33:47 -07:00
|
|
|
ClientGenesis: clienttypes.NewGenesisState(
|
2020-08-20 07:23:19 -07:00
|
|
|
[]clienttypes.IdentifiedClientState{
|
|
|
|
clienttypes.NewIdentifiedClientState(
|
2020-10-14 07:51:11 -07:00
|
|
|
clientID, ibctmtypes.NewClientState(suite.chainA.ChainID, ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod, ibctesting.MaxClockDrift, clientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false),
|
2020-08-07 01:33:47 -07:00
|
|
|
),
|
2020-08-20 07:23:19 -07:00
|
|
|
clienttypes.NewIdentifiedClientState(
|
2020-09-22 07:25:58 -07:00
|
|
|
exported.Localhost, localhosttypes.NewClientState("chaindID", clientHeight),
|
2020-08-07 01:33:47 -07:00
|
|
|
),
|
|
|
|
},
|
|
|
|
[]clienttypes.ClientConsensusStates{
|
|
|
|
clienttypes.NewClientConsensusStates(
|
|
|
|
clientID,
|
2020-09-14 11:16:42 -07:00
|
|
|
[]clienttypes.ConsensusStateWithHeight{
|
|
|
|
clienttypes.NewConsensusStateWithHeight(
|
2020-10-14 07:51:11 -07:00
|
|
|
header.GetHeight().(clienttypes.Height),
|
2020-09-14 11:16:42 -07:00
|
|
|
ibctmtypes.NewConsensusState(
|
2020-10-14 07:51:11 -07:00
|
|
|
header.GetTime(), commitmenttypes.NewMerkleRoot(header.Header.AppHash), header.Header.NextValidatorsHash,
|
2020-09-14 11:16:42 -07:00
|
|
|
),
|
2020-08-07 01:33:47 -07:00
|
|
|
),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
true,
|
|
|
|
),
|
|
|
|
ConnectionGenesis: connectiontypes.NewGenesisState(
|
|
|
|
[]connectiontypes.IdentifiedConnection{
|
2020-10-28 02:41:54 -07:00
|
|
|
connectiontypes.NewIdentifiedConnection(connectionID, connectiontypes.NewConnectionEnd(connectiontypes.INIT, clientID, connectiontypes.NewCounterparty(clientID2, connectionID2, commitmenttypes.NewMerklePrefix([]byte("prefix"))), []*connectiontypes.Version{ibctesting.ConnectionVersion})),
|
2020-08-07 01:33:47 -07:00
|
|
|
},
|
|
|
|
[]connectiontypes.ConnectionPaths{
|
|
|
|
connectiontypes.NewConnectionPaths(clientID, []string{host.ConnectionPath(connectionID)}),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
ChannelGenesis: channeltypes.NewGenesisState(
|
|
|
|
[]channeltypes.IdentifiedChannel{
|
|
|
|
channeltypes.NewIdentifiedChannel(
|
|
|
|
port1, channel1, channeltypes.NewChannel(
|
2020-10-14 07:51:11 -07:00
|
|
|
channeltypes.INIT, channeltypes.ORDERED,
|
|
|
|
channeltypes.NewCounterparty(port2, channel2), []string{connectionID}, ibctesting.DefaultChannelVersion,
|
2020-08-07 01:33:47 -07:00
|
|
|
),
|
|
|
|
),
|
|
|
|
},
|
2020-11-02 07:13:48 -08:00
|
|
|
[]channeltypes.PacketState{
|
|
|
|
channeltypes.NewPacketState(port2, channel2, 1, []byte("ack")),
|
|
|
|
},
|
|
|
|
[]channeltypes.PacketState{
|
|
|
|
channeltypes.NewPacketState(port2, channel2, 1, []byte("")),
|
2020-08-07 01:33:47 -07:00
|
|
|
},
|
2020-11-02 07:13:48 -08:00
|
|
|
[]channeltypes.PacketState{
|
|
|
|
channeltypes.NewPacketState(port1, channel1, 1, []byte("commit_hash")),
|
2020-08-07 01:33:47 -07:00
|
|
|
},
|
|
|
|
[]channeltypes.PacketSequence{
|
|
|
|
channeltypes.NewPacketSequence(port1, channel1, 1),
|
|
|
|
},
|
|
|
|
[]channeltypes.PacketSequence{
|
|
|
|
channeltypes.NewPacketSequence(port2, channel2, 1),
|
|
|
|
},
|
|
|
|
[]channeltypes.PacketSequence{
|
|
|
|
channeltypes.NewPacketSequence(port2, channel2, 1),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, tc := range testCases {
|
|
|
|
app := simapp.Setup(false)
|
|
|
|
|
|
|
|
suite.NotPanics(func() {
|
2020-08-14 10:58:53 -07:00
|
|
|
ibc.InitGenesis(app.BaseApp.NewContext(false, tmproto.Header{Height: 1}), *app.IBCKeeper, true, tc.genState)
|
2020-08-07 01:33:47 -07:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-14 07:51:11 -07:00
|
|
|
func (suite *IBCTestSuite) TestExportGenesis() {
|
2020-08-07 01:33:47 -07:00
|
|
|
testCases := []struct {
|
|
|
|
msg string
|
|
|
|
malleate func()
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
"success",
|
|
|
|
func() {
|
|
|
|
// creates clients
|
2020-08-31 06:58:23 -07:00
|
|
|
suite.coordinator.Setup(suite.chainA, suite.chainB, channeltypes.UNORDERED)
|
2020-08-07 01:33:47 -07:00
|
|
|
// create extra clients
|
2020-09-22 07:25:58 -07:00
|
|
|
suite.coordinator.CreateClient(suite.chainA, suite.chainB, ibctesting.Tendermint)
|
|
|
|
suite.coordinator.CreateClient(suite.chainA, suite.chainB, ibctesting.Tendermint)
|
2020-08-07 01:33:47 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, tc := range testCases {
|
|
|
|
suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
|
|
|
|
suite.SetupTest()
|
|
|
|
|
|
|
|
tc.malleate()
|
|
|
|
|
2020-08-11 07:22:30 -07:00
|
|
|
var gs *types.GenesisState
|
2020-08-07 01:33:47 -07:00
|
|
|
suite.NotPanics(func() {
|
|
|
|
gs = ibc.ExportGenesis(suite.chainA.GetContext(), *suite.chainA.App.IBCKeeper)
|
|
|
|
})
|
|
|
|
|
|
|
|
// init genesis based on export
|
|
|
|
suite.NotPanics(func() {
|
|
|
|
ibc.InitGenesis(suite.chainA.GetContext(), *suite.chainA.App.IBCKeeper, true, gs)
|
|
|
|
})
|
|
|
|
|
|
|
|
suite.NotPanics(func() {
|
|
|
|
cdc := codec.NewProtoCodec(suite.chainA.App.InterfaceRegistry())
|
2020-08-11 07:22:30 -07:00
|
|
|
genState := cdc.MustMarshalJSON(gs)
|
|
|
|
cdc.MustUnmarshalJSON(genState, gs)
|
2020-08-07 01:33:47 -07:00
|
|
|
})
|
|
|
|
|
|
|
|
// init genesis based on marshal and unmarshal
|
|
|
|
suite.NotPanics(func() {
|
|
|
|
ibc.InitGenesis(suite.chainA.GetContext(), *suite.chainA.App.IBCKeeper, true, gs)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|