Skip to content

Commit

Permalink
Modify codec registration style to match previous working state
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzampolin committed Nov 12, 2019
1 parent ee8bde2 commit ae8ea8f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
8 changes: 5 additions & 3 deletions x/ibc/02-client/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// SubModuleCdc defines the IBC client codec.
var SubModuleCdc = codec.New()
var SubModuleCdc *codec.Codec

// RegisterCodec registers the IBC client interfaces and types
func RegisterCodec(cdc *codec.Codec) {
Expand All @@ -22,8 +22,10 @@ func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(tendermint.ConsensusState{}, "ibc/client/tendermint/ConsensusState", nil)
cdc.RegisterConcrete(tendermint.Header{}, "ibc/client/tendermint/Header", nil)
cdc.RegisterConcrete(tendermint.Evidence{}, "ibc/client/tendermint/Evidence", nil)

SetSubModuleCodec(cdc)
}

func init() {
RegisterCodec(SubModuleCdc)
func SetSubModuleCodec(cdc *codec.Codec) {
SubModuleCdc = cdc
}
8 changes: 5 additions & 3 deletions x/ibc/03-connection/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

// SubModuleCdc defines the IBC connection codec.
var SubModuleCdc = codec.New()
var SubModuleCdc *codec.Codec

// RegisterCodec registers the IBC connection types
func RegisterCodec(cdc *codec.Codec) {
Expand All @@ -14,8 +14,10 @@ func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(MsgConnectionOpenAck{}, "ibc/connection/MsgConnectionOpenAck", nil)
cdc.RegisterConcrete(MsgConnectionOpenConfirm{}, "ibc/connection/MsgConnectionOpenConfirm", nil)
cdc.RegisterConcrete(ConnectionEnd{}, "ibc/connection/ConnectionEnd", nil)

SetSubModuleCodec(cdc)
}

func init() {
RegisterCodec(SubModuleCdc)
func SetSubModuleCodec(cdc *codec.Codec) {
SubModuleCdc = cdc
}
6 changes: 3 additions & 3 deletions x/ibc/04-channel/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// SubModuleCdc defines the IBC channel codec.
var SubModuleCdc = codec.New()
var SubModuleCdc *codec.Codec

// RegisterCodec registers all the necessary types and interfaces for the
// IBC channel.
Expand All @@ -23,6 +23,6 @@ func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(MsgChannelCloseConfirm{}, "ibc/channel/MsgChannelCloseConfirm", nil)
}

func init() {
RegisterCodec(SubModuleCdc)
func SetSubModuleCodec(cdc *codec.Codec) {
SubModuleCdc = cdc
}
8 changes: 5 additions & 3 deletions x/ibc/23-commitment/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
)

var SubModuleCdc = codec.New()
var SubModuleCdc *codec.Codec

// RegisterCodec registers types declared in this package
func RegisterCodec(cdc *codec.Codec) {
Expand All @@ -17,8 +17,10 @@ func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(Prefix{}, "ibc/commitment/merkle/Prefix", nil)
cdc.RegisterConcrete(Path{}, "ibc/commitment/merkle/Path", nil)
cdc.RegisterConcrete(Proof{}, "ibc/commitment/merkle/Proof", nil)

SetSubModuleCodec(cdc)
}

func init() {
RegisterCodec(SubModuleCdc)
func SetSubModuleCodec(cdc *codec.Codec) {
SubModuleCdc = cdc
}

0 comments on commit ae8ea8f

Please sign in to comment.