Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
adamewozniak committed Nov 9, 2023
1 parent 5e82697 commit 1168214
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 43 deletions.
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.

0 comments on commit 1168214

Please sign in to comment.