Skip to content

Commit

Permalink
[OTE-163] Fix query: add amino.oneof option to clob oneof metadata (#…
Browse files Browse the repository at this point in the history
…1077)

* Add amino field for ClobPair oneof fields

* proto format
  • Loading branch information
teddyding committed Feb 16, 2024
1 parent 71ce2c6 commit 934a98e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 37 deletions.
12 changes: 10 additions & 2 deletions proto/dydxprotocol/clob/clob_pair.proto
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
syntax = "proto3";
package dydxprotocol.clob;

import "amino/amino.proto";

option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types";

// PerpetualClobMetadata contains metadata for a `ClobPair`
// representing a Perpetual product.
message PerpetualClobMetadata {
option (amino.name) = "dydxprotocol/clob/PerpetualClobMetadata";

// Id of the Perpetual the CLOB allows trading of.
uint32 perpetual_id = 1;
}

// PerpetualClobMetadata contains metadata for a `ClobPair`
// representing a Spot product.
message SpotClobMetadata {
option (amino.name) = "dydxprotocol/clob/SpotClobMetadata";

// Id of the base Asset in the trading pair.
uint32 base_asset_id = 1;

Expand All @@ -29,8 +35,10 @@ message ClobPair {
// Product-specific metadata. Perpetual CLOBs will have
// PerpetualClobMetadata, and Spot CLOBs will have SpotClobMetadata.
oneof metadata {
PerpetualClobMetadata perpetual_clob_metadata = 2;
SpotClobMetadata spot_clob_metadata = 3;
PerpetualClobMetadata perpetual_clob_metadata = 2
[ (amino.oneof_name) = "dydxprotocol/clob/PerpetualClobMetadata" ];
SpotClobMetadata spot_clob_metadata = 3
[ (amino.oneof_name) = "dydxprotocol/clob/SpotClobMetadata" ];
}

// Minimum increment in the size of orders on the CLOB, in base quantums.
Expand Down
75 changes: 40 additions & 35 deletions protocol/x/clob/types/clob_pair.pb.go

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

0 comments on commit 934a98e

Please sign in to comment.