diff --git a/modules/apps/transfer/module.go b/modules/apps/transfer/module.go index 5331cca5..a06faca5 100644 --- a/modules/apps/transfer/module.go +++ b/modules/apps/transfer/module.go @@ -64,6 +64,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod return gs.Validate() } +// ValidateGenesisStream performs genesis state validation for the ibc transfer module in a streaming fashion. func (am AppModuleBasic) ValidateGenesisStream(cdc codec.JSONCodec, config client.TxEncodingConfig, genesisCh <-chan json.RawMessage) error { for genesis := range genesisCh { err := am.ValidateGenesis(cdc, config, genesis) @@ -153,6 +154,8 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw return cdc.MustMarshalJSON(gs) } +// StreamGenesis returns the exported genesis state as raw bytes for the ibc-transfer module in a +// streaming fashion. func (am AppModule) StreamGenesis(ctx sdk.Context, cdc codec.JSONCodec) <-chan json.RawMessage { ch := make(chan json.RawMessage) go func() { diff --git a/modules/core/02-client/types/genesis.go b/modules/core/02-client/types/genesis.go index 285eaaa5..ccf797e0 100644 --- a/modules/core/02-client/types/genesis.go +++ b/modules/core/02-client/types/genesis.go @@ -107,7 +107,6 @@ func (gs GenesisState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { // Validate performs basic genesis state validation returning an error upon any // failure. -// JEREMYFLAG - main validate func (gs GenesisState) Validate() error { // keep track of the max sequence to ensure it is less than // the next sequence used in creating client identifers. @@ -120,7 +119,6 @@ func (gs GenesisState) Validate() error { validClients := make(map[string]string) for i, client := range gs.Clients { - fmt.Println("client.ClientId: ", client.ClientId) if err := host.ClientIdentifierValidator(client.ClientId); err != nil { return fmt.Errorf("invalid client consensus state identifier %s index %d: %w", client.ClientId, i, err) } @@ -170,15 +168,12 @@ func (gs GenesisState) Validate() error { return fmt.Errorf("consensus state height cannot be zero") } - // JEREMYFLAG - unmarshalling cs, ok := consensusState.ConsensusState.GetCachedValue().(exported.ConsensusState) - fmt.Println("unmarshalling cs: ", cs) if !ok { return fmt.Errorf("invalid consensus state with client ID %s at height %s", cc.ClientId, consensusState.Height) } if err := cs.ValidateBasic(); err != nil { - fmt.Printf("consensus state: %+v\n", cs) return fmt.Errorf("invalid client consensus state %v clientID %s index %d: %w", cs, cc.ClientId, i, err) } diff --git a/modules/core/module.go b/modules/core/module.go index 43b51aae..b07a0c09 100644 --- a/modules/core/module.go +++ b/modules/core/module.go @@ -169,6 +169,8 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw return cdc.MustMarshalJSON(ExportGenesis(ctx, *am.keeper)) } +// StreamGenesis returns the exported genesis state as raw bytes for the ibc +// module in a streaing fashion func (am AppModule) StreamGenesis(ctx sdk.Context, cdc codec.JSONCodec) <-chan json.RawMessage { ch := make(chan json.RawMessage) go func() { diff --git a/modules/light-clients/07-tendermint/types/consensus_state.go b/modules/light-clients/07-tendermint/types/consensus_state.go index afd23d86..aa475daa 100644 --- a/modules/light-clients/07-tendermint/types/consensus_state.go +++ b/modules/light-clients/07-tendermint/types/consensus_state.go @@ -1,7 +1,6 @@ package types import ( - fmt "fmt" "time" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -50,7 +49,6 @@ func (cs ConsensusState) ValidateBasic() error { return sdkerrors.Wrap(clienttypes.ErrInvalidConsensus, "root cannot be empty") } if err := tmtypes.ValidateHash(cs.NextValidatorsHash); err != nil { - fmt.Println("invalid next validators hash = ", cs.NextValidatorsHash) return sdkerrors.Wrap(err, "next validators hash is invalid") } if cs.Timestamp.Unix() <= 0 {