Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Osmosis gamm module codec #4

Merged
merged 3 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions client/codec/osmosis/v15/x/gamm/types/codecs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package types

import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
)

// RegisterLegacyAminoCodec registers concrete types on the codec.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgJoinPool{}, "gamm/MsgJoinPool", nil)
}

func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgJoinPool{},
&MsgExitPool{},
&MsgSwapExactAmountIn{},
&MsgSwapExactAmountOut{},
&MsgJoinSwapExternAmountIn{},
&MsgJoinSwapShareAmountOut{},
&MsgExitSwapShareAmountIn{},
&MsgExitSwapExternAmountOut{},
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}

// legacy amino codecs
var (
amino = codec.NewLegacyAmino()

// ModuleCdc references the global x/liquidity module codec. Note, the
// codec should ONLY be used in certain instances of tests and for JSON
// encoding as Amino is still used for that purpose.
//
// The actual codec used for serialization should be provided to x/liquidity
// and defined at the application level.
ModuleCdc = codec.NewAminoCodec(amino)
)

func init() {
RegisterLegacyAminoCodec(amino)
cryptocodec.RegisterCrypto(amino)
amino.Seal()
}
154 changes: 154 additions & 0 deletions client/codec/osmosis/v15/x/gamm/types/msgs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
package types

import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

var (
_ sdk.Msg = (*MsgJoinPool)(nil)
_ sdk.Msg = (*MsgExitPool)(nil)
_ sdk.Msg = (*MsgSwapExactAmountIn)(nil)
_ sdk.Msg = (*MsgSwapExactAmountOut)(nil)
_ sdk.Msg = (*MsgJoinSwapExternAmountIn)(nil)
_ sdk.Msg = (*MsgJoinSwapShareAmountOut)(nil)
_ sdk.Msg = (*MsgExitSwapShareAmountIn)(nil)
_ sdk.Msg = (*MsgExitSwapExternAmountOut)(nil)
)

// WARNING: The functions in here are interface stub definitions, not usable in their current state

// Join
func (msg MsgJoinPool) Route() string { return "" }

func (msg MsgJoinPool) Type() string { return "" }

func (msg MsgJoinPool) ValidateBasic() error {
return nil
}

func (msg MsgJoinPool) GetSignBytes() []byte {
return nil
}

func (msg MsgJoinPool) GetSigners() []sdk.AccAddress {
return nil
}

// Exit
func (msg MsgExitPool) Route() string { return "" }

func (msg MsgExitPool) Type() string { return "" }

func (msg MsgExitPool) ValidateBasic() error {
return nil
}

func (msg MsgExitPool) GetSignBytes() []byte {
return nil
}

func (msg MsgExitPool) GetSigners() []sdk.AccAddress {
return nil
}

// SwapExactIn
func (msg MsgSwapExactAmountIn) Route() string { return "" }

func (msg MsgSwapExactAmountIn) Type() string { return "" }

func (msg MsgSwapExactAmountIn) ValidateBasic() error {
return nil
}

func (msg MsgSwapExactAmountIn) GetSignBytes() []byte {
return nil
}

func (msg MsgSwapExactAmountIn) GetSigners() []sdk.AccAddress {
return nil
}

// SwapExactOut
func (msg MsgSwapExactAmountOut) Route() string { return "" }

func (msg MsgSwapExactAmountOut) Type() string { return "" }

func (msg MsgSwapExactAmountOut) ValidateBasic() error {
return nil
}

func (msg MsgSwapExactAmountOut) GetSignBytes() []byte {
return nil
}

func (msg MsgSwapExactAmountOut) GetSigners() []sdk.AccAddress {
return nil
}

// JoinSwapExternIn
func (msg MsgJoinSwapExternAmountIn) Route() string { return "" }

func (msg MsgJoinSwapExternAmountIn) Type() string { return "" }

func (msg MsgJoinSwapExternAmountIn) ValidateBasic() error {
return nil
}

func (msg MsgJoinSwapExternAmountIn) GetSignBytes() []byte {
return nil
}

func (msg MsgJoinSwapExternAmountIn) GetSigners() []sdk.AccAddress {
return nil
}

// JoinSwapShareOut
func (msg MsgJoinSwapShareAmountOut) Route() string { return "" }

func (msg MsgJoinSwapShareAmountOut) Type() string { return "" }

func (msg MsgJoinSwapShareAmountOut) ValidateBasic() error {
return nil
}

func (msg MsgJoinSwapShareAmountOut) GetSignBytes() []byte {
return nil
}

func (msg MsgJoinSwapShareAmountOut) GetSigners() []sdk.AccAddress {
return nil
}

// ExitSwapShareIn
func (msg MsgExitSwapShareAmountIn) Route() string { return "" }

func (msg MsgExitSwapShareAmountIn) Type() string { return "" }

func (msg MsgExitSwapShareAmountIn) ValidateBasic() error {
return nil
}

func (msg MsgExitSwapShareAmountIn) GetSignBytes() []byte {
return nil
}

func (msg MsgExitSwapShareAmountIn) GetSigners() []sdk.AccAddress {
return nil
}

// ExitSwapExternOut
func (msg MsgExitSwapExternAmountOut) Route() string { return "" }

func (msg MsgExitSwapExternAmountOut) Type() string { return "" }

func (msg MsgExitSwapExternAmountOut) ValidateBasic() error {
return nil
}

func (msg MsgExitSwapExternAmountOut) GetSignBytes() []byte {
return nil
}

func (msg MsgExitSwapExternAmountOut) GetSigners() []sdk.AccAddress {
return nil
}
Loading