Skip to content

Commit

Permalink
amino
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Jan 3, 2023
1 parent 6f365c6 commit a946a21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
32 changes: 15 additions & 17 deletions x/concentrated-liquidity/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
// authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
)

func RegisterCodec(cdc *codec.LegacyAmino) {
Expand All @@ -29,19 +29,17 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}

// TODO: re-enable this when CL state-breakage PR is merged.
// return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
// var (
// amino = codec.NewLegacyAmino()
// ModuleCdc = codec.NewAminoCodec(amino)
// )

// func init() {
// RegisterCodec(amino)
// sdk.RegisterLegacyAminoCodec(amino)

// // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
// // used to properly serialize MsgGrant and MsgExec instances
// RegisterCodec(authzcodec.Amino)
// amino.Seal()
// }
var (
amino = codec.NewLegacyAmino()
ModuleCdc = codec.NewAminoCodec(amino)
)

func init() {
RegisterCodec(amino)
sdk.RegisterLegacyAminoCodec(amino)

// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
// used to properly serialize MsgGrant and MsgExec instances
RegisterCodec(authzcodec.Amino)
amino.Seal()
}
9 changes: 2 additions & 7 deletions x/concentrated-liquidity/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ func (msg MsgCreatePosition) ValidateBasic() error {
}

func (msg MsgCreatePosition) GetSignBytes() []byte {
// TODO: re-enable this when CL state-breakage PR is merged.
// return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
// return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
return nil
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
}

func (msg MsgCreatePosition) GetSigners() []sdk.AccAddress {
Expand Down Expand Up @@ -98,9 +95,7 @@ func (msg MsgWithdrawPosition) ValidateBasic() error {
}

func (msg MsgWithdrawPosition) GetSignBytes() []byte {
// TODO: re-enable this when CL state-breakage PR is merged.
// return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
return nil
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
}

func (msg MsgWithdrawPosition) GetSigners() []sdk.AccAddress {
Expand Down

0 comments on commit a946a21

Please sign in to comment.