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

feat: gmp follow-up #314

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 11 additions & 2 deletions proto/ojo/gmp/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ message MsgSetParams {
// MsgSetParamsResponse defines the SetParams response type.
message MsgSetParamsResponse {}

// MsgRelay defines the Relay message type.
// MsgRelayPrice defines the Relay message type.
message MsgRelayPrice {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
Expand All @@ -57,7 +57,16 @@ message MsgRelayPrice {
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];

// resolve_price determines the time that the user wants to resolve the price to.
int64 resolve_time = 6;

// id determines the id of the price that the user wants to pass.
int64 id = 7;

// disable_resolve determines whether the user wants to resolve the price or not.
bool disable_resolve = 8;
}

// MsgRelay defines the Relay response type.
// MsgRelayPriceResponse defines the Relay response type.
message MsgRelayPriceResponse {}
10 changes: 3 additions & 7 deletions x/gmp/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ func (ms msgServer) RelayPrice(
priceFeed, err := types.NewPriceFeedData(
denom,
rate,
// TODO: replace with actual resolve time & id
// Ref: https://github.com/ojo-network/ojo/issues/309
big.NewInt(1),
big.NewInt(1),
big.NewInt(msg.ResolveTime),
big.NewInt(msg.Id),
)
if err != nil {
ms.keeper.Logger(ctx).With(err).Error("unable to relay price to gmp")
Expand All @@ -80,9 +78,7 @@ func (ms msgServer) RelayPrice(
rates = append(rates, priceFeed)
}

// TODO: fill with actual disableResolve option
// Ref: https://github.com/ojo-network/ojo/issues/309
payload, err := types.EncodeABI("postPrices", rates, false)
payload, err := types.EncodeABI("postPrices", rates, msg.DisableResolve)
if err != nil {
return nil, err
}
Expand Down
165 changes: 131 additions & 34 deletions x/gmp/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading