Skip to content

Commit

Permalink
support tendermint liquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Neznaykin committed Dec 19, 2024
1 parent a51479c commit 3790ef1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
"github.com/cosmos/gogoproto/proto"
ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee"
"github.com/cosmos/ibc-go/v7/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v7/modules/core"
Expand All @@ -42,6 +43,7 @@ import (
"github.com/cybercongress/go-cyber/v5/x/graph"
grid "github.com/cybercongress/go-cyber/v5/x/grid"
"github.com/cybercongress/go-cyber/v5/x/liquidity"
liquiditytypes "github.com/cybercongress/go-cyber/v5/x/liquidity/types"
"github.com/cybercongress/go-cyber/v5/x/rank"
"github.com/cybercongress/go-cyber/v5/x/resources"
"github.com/cybercongress/go-cyber/v5/x/tokenfactory"
Expand Down Expand Up @@ -255,6 +257,8 @@ func MakeEncodingConfig() codec.Codec {
basicManager.RegisterInterfaces(registry)
std.RegisterInterfaces(registry)

registerTendermintLiquidity()

return codec.NewProtoCodec(registry)
}

Expand Down Expand Up @@ -298,3 +302,15 @@ func checkLastBlockDiff(maxDiff time.Duration, storage interface {
return time.Since(lastBlock.Created) <= maxDiff
}
}

//nolint:lll
func registerTendermintLiquidity() {
proto.RegisterType((*liquiditytypes.MsgCreatePool)(nil), "tendermint.liquidity.v1beta1.MsgCreatePool")
proto.RegisterType((*liquiditytypes.MsgCreatePoolResponse)(nil), "tendermint.liquidity.v1beta1.MsgCreatePoolResponse")
proto.RegisterType((*liquiditytypes.MsgDepositWithinBatch)(nil), "tendermint.liquidity.v1beta1.MsgDepositWithinBatch")
proto.RegisterType((*liquiditytypes.MsgDepositWithinBatchResponse)(nil), "tendermint.liquidity.v1beta1.MsgDepositWithinBatchResponse")
proto.RegisterType((*liquiditytypes.MsgWithdrawWithinBatch)(nil), "tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch")
proto.RegisterType((*liquiditytypes.MsgWithdrawWithinBatchResponse)(nil), "tendermint.liquidity.v1beta1.MsgWithdrawWithinBatchResponse")
proto.RegisterType((*liquiditytypes.MsgSwapWithinBatch)(nil), "tendermint.liquidity.v1beta1.MsgSwapWithinBatch")
proto.RegisterType((*liquiditytypes.MsgSwapWithinBatchResponse)(nil), "tendermint.liquidity.v1beta1.MsgSwapWithinBatchResponse")
}

0 comments on commit 3790ef1

Please sign in to comment.