diff --git a/docs/proto-docs.md b/docs/proto-docs.md
index 181d64c91c..1769c35b1e 100644
--- a/docs/proto-docs.md
+++ b/docs/proto-docs.md
@@ -65,6 +65,7 @@
- [EventMarketWithdraw](#provenance.exchange.v1.EventMarketWithdraw)
- [EventOrderCancelled](#provenance.exchange.v1.EventOrderCancelled)
- [EventOrderCreated](#provenance.exchange.v1.EventOrderCreated)
+ - [EventOrderExternalIDUpdated](#provenance.exchange.v1.EventOrderExternalIDUpdated)
- [EventOrderFilled](#provenance.exchange.v1.EventOrderFilled)
- [EventOrderPartiallyFilled](#provenance.exchange.v1.EventOrderPartiallyFilled)
- [EventParamsUpdated](#provenance.exchange.v1.EventParamsUpdated)
@@ -112,6 +113,8 @@
- [MsgMarketManagePermissionsResponse](#provenance.exchange.v1.MsgMarketManagePermissionsResponse)
- [MsgMarketManageReqAttrsRequest](#provenance.exchange.v1.MsgMarketManageReqAttrsRequest)
- [MsgMarketManageReqAttrsResponse](#provenance.exchange.v1.MsgMarketManageReqAttrsResponse)
+ - [MsgMarketSetOrderExternalIDRequest](#provenance.exchange.v1.MsgMarketSetOrderExternalIDRequest)
+ - [MsgMarketSetOrderExternalIDResponse](#provenance.exchange.v1.MsgMarketSetOrderExternalIDResponse)
- [MsgMarketSettleRequest](#provenance.exchange.v1.MsgMarketSettleRequest)
- [MsgMarketSettleResponse](#provenance.exchange.v1.MsgMarketSettleResponse)
- [MsgMarketUpdateDetailsRequest](#provenance.exchange.v1.MsgMarketUpdateDetailsRequest)
@@ -136,6 +139,8 @@
- [QueryGetMarketOrdersResponse](#provenance.exchange.v1.QueryGetMarketOrdersResponse)
- [QueryGetMarketRequest](#provenance.exchange.v1.QueryGetMarketRequest)
- [QueryGetMarketResponse](#provenance.exchange.v1.QueryGetMarketResponse)
+ - [QueryGetOrderByExternalIDRequest](#provenance.exchange.v1.QueryGetOrderByExternalIDRequest)
+ - [QueryGetOrderByExternalIDResponse](#provenance.exchange.v1.QueryGetOrderByExternalIDResponse)
- [QueryGetOrderRequest](#provenance.exchange.v1.QueryGetOrderRequest)
- [QueryGetOrderResponse](#provenance.exchange.v1.QueryGetOrderResponse)
- [QueryGetOwnerOrdersRequest](#provenance.exchange.v1.QueryGetOwnerOrdersRequest)
@@ -1524,6 +1529,7 @@ EventOrderCancelled is an event emitted when an order is cancelled.
| ----- | ---- | ----- | ----------- |
| `order_id` | [uint64](#uint64) | | order_id is the numerical identifier of the order cancelled. |
| `cancelled_by` | [string](#string) | | cancelled_by is the account that triggered the cancellation of the order. |
+| `external_id` | [string](#string) | | external_id is the order's external id. |
@@ -1540,6 +1546,23 @@ EventOrderCreated is an event emitted when an order is created.
| ----- | ---- | ----- | ----------- |
| `order_id` | [uint64](#uint64) | | order_id is the numerical identifier of the order created. |
| `order_type` | [string](#string) | | order_type is the type of order, e.g. "ask" or "bid". |
+| `external_id` | [string](#string) | | external_id is the order's external id. |
+
+
+
+
+
+
+
+
+### EventOrderExternalIDUpdated
+EventOrderExternalIDUpdated is an event emitted when an order's external id is updated.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `order_id` | [uint64](#uint64) | | order_id is the numerical identifier of the order partially filled. |
+| `external_id` | [string](#string) | | external_id is the order's new external id. |
@@ -1559,6 +1582,7 @@ This event is also used for orders that were previously partially filled, but ha
| `assets` | [string](#string) | | assets is the coins amount string of assets bought/sold for this order. |
| `price` | [string](#string) | | price is the coins amount string of the price payed/received for this order. |
| `fees` | [string](#string) | | fees is the coins amount string of settlement fees paid with this order. |
+| `external_id` | [string](#string) | | external_id is the order's external id. |
@@ -1577,6 +1601,7 @@ EventOrderPartiallyFilled is an event emitted when an order filled in part and s
| `assets` | [string](#string) | | assets is the coins amount string of assets that were filled and removed from the order. |
| `price` | [string](#string) | | price is the coins amount string of the price payed/received for this order. For ask orders, this might be more than the amount that was removed from the order's price. |
| `fees` | [string](#string) | | fees is the coins amount string of settlement fees paid with this partial order. For ask orders, this might be more than the amount that was removed from the order's settlement fees. |
+| `external_id` | [string](#string) | | external_id is the order's external id. |
@@ -1736,11 +1761,12 @@ Permission defines the different types of permission that can be given to an acc
| ---- | ------ | ----------- |
| PERMISSION_UNSPECIFIED | 0 | PERMISSION_UNSPECIFIED is the zero-value Permission; it is an error to use it. |
| PERMISSION_SETTLE | 1 | PERMISSION_SETTLE is the ability to use the Settle Tx endpoint on behalf of a market. |
-| PERMISSION_CANCEL | 2 | PERMISSION_CANCEL is the ability to use the Cancel Tx endpoint on behalf of a market. |
-| PERMISSION_WITHDRAW | 3 | PERMISSION_WITHDRAW is the ability to use the MarketWithdraw Tx endpoint. |
-| PERMISSION_UPDATE | 4 | PERMISSION_UPDATE is the ability to use the MarketUpdate* Tx endpoints. |
-| PERMISSION_PERMISSIONS | 5 | PERMISSION_PERMISSIONS is the ability to use the MarketManagePermissions Tx endpoint. |
-| PERMISSION_ATTRIBUTES | 6 | PERMISSION_ATTRIBUTES is the ability to use the MarketManageReqAttrs Tx endpoint. |
+| PERMISSION_SET_IDS | 2 | PERMISSION_SET_IDS is the ability to use the SetOrderExternalID Tx endpoint on behalf of a market. |
+| PERMISSION_CANCEL | 3 | PERMISSION_CANCEL is the ability to use the Cancel Tx endpoint on behalf of a market. |
+| PERMISSION_WITHDRAW | 4 | PERMISSION_WITHDRAW is the ability to use the MarketWithdraw Tx endpoint. |
+| PERMISSION_UPDATE | 5 | PERMISSION_UPDATE is the ability to use the MarketUpdate* Tx endpoints. |
+| PERMISSION_PERMISSIONS | 6 | PERMISSION_PERMISSIONS is the ability to use the MarketManagePermissions Tx endpoint. |
+| PERMISSION_ATTRIBUTES | 7 | PERMISSION_ATTRIBUTES is the ability to use the MarketManageReqAttrs Tx endpoint. |
@@ -1772,6 +1798,7 @@ AskOrder represents someone's desire to sell something at a minimum price.
| `price` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | price is the minimum amount that the seller is willing to accept for the assets. The seller's settlement proportional fee (and possibly the settlement flat fee) is taken out of the amount the seller receives, so it's possible that the seller will still receive less than this price. |
| `seller_settlement_flat_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | seller_settlement_flat_fee is the flat fee for sellers that will be charged during settlement. If this denom is the same denom as the price, it will come out of the actual price received. If this denom is different, the amount must be in the seller's account and a hold is placed on it until the order is filled or cancelled. |
| `allow_partial` | [bool](#bool) | | allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the order must be either filled in full or not filled at all. |
+| `external_id` | [string](#string) | | external_id is an optional string used to externally identify this order. Max length is 40 characters. If an order in this market with this external id already exists, this order will be rejected. |
@@ -1792,6 +1819,7 @@ BidOrder represents someone's desire to buy something at a specific price.
| `price` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | price is the amount that the buyer will pay for the assets. A hold is placed on this until the order is filled or cancelled. |
| `buyer_settlement_fees` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | buyer_settlement_fees are the fees (both flat and proportional) that the buyer will pay (in addition to the price) when the order is settled. A hold is placed on this until the order is filled or cancelled. |
| `allow_partial` | [bool](#bool) | | allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the order must be either filled in full or not filled at all. |
+| `external_id` | [string](#string) | | external_id is an optional string used to externally identify this order. Max length is 40 characters. If an order in this market with this external id already exists, this order will be rejected. |
@@ -2211,6 +2239,34 @@ MsgMarketManageReqAttrsResponse is a response message for the MarketManageReqAtt
+
+
+### MsgMarketSetOrderExternalIDRequest
+MsgMarketSetOrderExternalIDRequest is a request message for the MarketSetOrderExternalID endpoint.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `admin` | [string](#string) | | admin is the account with "set_ids" permission requesting this settlement. |
+| `market_id` | [uint32](#uint32) | | market_id is the numerical identifier of the market to update required attributes for. |
+| `order_id` | [uint64](#uint64) | | order_id is the numerical identifier of the order to update. |
+| `external_id` | [string](#string) | | external_id is the new external id to associate with the order. Max length is 40 characters. If the external id is already associated with another order in this market, this update will fail. |
+
+
+
+
+
+
+
+
+### MsgMarketSetOrderExternalIDResponse
+MsgMarketSetOrderExternalIDResponse is a response message for the MarketSetOrderExternalID endpoint.
+
+
+
+
+
+
### MsgMarketSettleRequest
@@ -2368,6 +2424,7 @@ Msg is the service for exchange module's tx endpoints.
| `FillBids` | [MsgFillBidsRequest](#provenance.exchange.v1.MsgFillBidsRequest) | [MsgFillBidsResponse](#provenance.exchange.v1.MsgFillBidsResponse) | FillBids uses the assets in your account to fulfill one or more bids (similar to a fill-or-cancel ask). | |
| `FillAsks` | [MsgFillAsksRequest](#provenance.exchange.v1.MsgFillAsksRequest) | [MsgFillAsksResponse](#provenance.exchange.v1.MsgFillAsksResponse) | FillAsks uses the funds in your account to fulfill one or more asks (similar to a fill-or-cancel bid). | |
| `MarketSettle` | [MsgMarketSettleRequest](#provenance.exchange.v1.MsgMarketSettleRequest) | [MsgMarketSettleResponse](#provenance.exchange.v1.MsgMarketSettleResponse) | MarketSettle is a market endpoint to trigger the settlement of orders. | |
+| `MarketSetOrderExternalID` | [MsgMarketSetOrderExternalIDRequest](#provenance.exchange.v1.MsgMarketSetOrderExternalIDRequest) | [MsgMarketSetOrderExternalIDResponse](#provenance.exchange.v1.MsgMarketSetOrderExternalIDResponse) | MarketSetOrderExternalID updates an order's external id field. | |
| `MarketWithdraw` | [MsgMarketWithdrawRequest](#provenance.exchange.v1.MsgMarketWithdrawRequest) | [MsgMarketWithdrawResponse](#provenance.exchange.v1.MsgMarketWithdrawResponse) | MarketWithdraw is a market endpoint to withdraw fees that have been collected. | |
| `MarketUpdateDetails` | [MsgMarketUpdateDetailsRequest](#provenance.exchange.v1.MsgMarketUpdateDetailsRequest) | [MsgMarketUpdateDetailsResponse](#provenance.exchange.v1.MsgMarketUpdateDetailsResponse) | MarketUpdateDetails is a market endpoint to update its details. | |
| `MarketUpdateEnabled` | [MsgMarketUpdateEnabledRequest](#provenance.exchange.v1.MsgMarketUpdateEnabledRequest) | [MsgMarketUpdateEnabledResponse](#provenance.exchange.v1.MsgMarketUpdateEnabledResponse) | MarketUpdateEnabled is a market endpoint to update whether its accepting orders. | |
@@ -2550,6 +2607,37 @@ QueryGetMarketResponse is a response message for the QueryGetMarket endpoint.
+
+
+### QueryGetOrderByExternalIDRequest
+QueryGetOrderByExternalIDRequest is a request message for the QueryGetOrderByExternalID endpoint.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `market_id` | [uint32](#uint32) | | market_id is the id of the market that's expected to have the order. |
+| `external_id` | [string](#string) | | external_id the external id to look up. |
+
+
+
+
+
+
+
+
+### QueryGetOrderByExternalIDResponse
+QueryGetOrderByExternalIDResponse is a response message for the QueryGetOrderByExternalID endpoint.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `order` | [Order](#provenance.exchange.v1.Order) | | order is the requested order. |
+
+
+
+
+
+
### QueryGetOrderRequest
@@ -2784,6 +2872,7 @@ Query is the service for exchange module's query endpoints.
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `QueryOrderFeeCalc` | [QueryOrderFeeCalcRequest](#provenance.exchange.v1.QueryOrderFeeCalcRequest) | [QueryOrderFeeCalcResponse](#provenance.exchange.v1.QueryOrderFeeCalcResponse) | QueryOrderFeeCalc calculates the fees that will be associated with the provided order. | GET|/provenance/exchange/v1/fees/order|
| `QueryGetOrder` | [QueryGetOrderRequest](#provenance.exchange.v1.QueryGetOrderRequest) | [QueryGetOrderResponse](#provenance.exchange.v1.QueryGetOrderResponse) | QueryGetOrder looks up an order by id. | GET|/provenance/exchange/v1/order/{order_id}|
+| `QueryGetOrderByExternalID` | [QueryGetOrderByExternalIDRequest](#provenance.exchange.v1.QueryGetOrderByExternalIDRequest) | [QueryGetOrderByExternalIDResponse](#provenance.exchange.v1.QueryGetOrderByExternalIDResponse) | QueryGetOrderByExternalID looks up an order by market id and external id. | GET|/provenance/exchange/v1/orders/market/{market_id}/{external_id}GET|/provenance/exchange/v1/market/{market_id}/order/{external_id}|
| `QueryGetMarketOrders` | [QueryGetMarketOrdersRequest](#provenance.exchange.v1.QueryGetMarketOrdersRequest) | [QueryGetMarketOrdersResponse](#provenance.exchange.v1.QueryGetMarketOrdersResponse) | QueryGetMarketOrders looks up the orders in a market. | GET|/provenance/exchange/v1/orders/market/{market_id}GET|/provenance/exchange/v1/market/{market_id}/orders|
| `QueryGetOwnerOrders` | [QueryGetOwnerOrdersRequest](#provenance.exchange.v1.QueryGetOwnerOrdersRequest) | [QueryGetOwnerOrdersResponse](#provenance.exchange.v1.QueryGetOwnerOrdersResponse) | QueryGetOwnerOrders looks up the orders from the provided owner address. | GET|/provenance/exchange/v1/orders/owner/{owner}|
| `QueryGetAssetOrders` | [QueryGetAssetOrdersRequest](#provenance.exchange.v1.QueryGetAssetOrdersRequest) | [QueryGetAssetOrdersResponse](#provenance.exchange.v1.QueryGetAssetOrdersResponse) | QueryGetAssetOrders looks up the orders for a specific asset denom. | GET|/provenance/exchange/v1/orders/asset/{asset}|
diff --git a/proto/provenance/exchange/v1/events.proto b/proto/provenance/exchange/v1/events.proto
index f3da3c78eb..07a55a63d8 100644
--- a/proto/provenance/exchange/v1/events.proto
+++ b/proto/provenance/exchange/v1/events.proto
@@ -14,6 +14,8 @@ message EventOrderCreated {
uint64 order_id = 1;
// order_type is the type of order, e.g. "ask" or "bid".
string order_type = 2;
+ // external_id is the order's external id.
+ string external_id = 3;
}
// EventOrderCancelled is an event emitted when an order is cancelled.
@@ -22,6 +24,8 @@ message EventOrderCancelled {
uint64 order_id = 1;
// cancelled_by is the account that triggered the cancellation of the order.
string cancelled_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // external_id is the order's external id.
+ string external_id = 3;
}
// EventOrderFilled is an event emitted when an order has been filled in full.
@@ -35,6 +39,8 @@ message EventOrderFilled {
string price = 3;
// fees is the coins amount string of settlement fees paid with this order.
string fees = 4;
+ // external_id is the order's external id.
+ string external_id = 5;
}
// EventOrderPartiallyFilled is an event emitted when an order filled in part and still has more left to fill.
@@ -49,6 +55,16 @@ message EventOrderPartiallyFilled {
// fees is the coins amount string of settlement fees paid with this partial order.
// For ask orders, this might be more than the amount that was removed from the order's settlement fees.
string fees = 4;
+ // external_id is the order's external id.
+ string external_id = 5;
+}
+
+// EventOrderExternalIDUpdated is an event emitted when an order's external id is updated.
+message EventOrderExternalIDUpdated {
+ // order_id is the numerical identifier of the order partially filled.
+ uint64 order_id = 1;
+ // external_id is the order's new external id.
+ string external_id = 3;
}
// EventMarketWithdraw is an event emitted when a withdrawal of a market's collected fees is made.
diff --git a/proto/provenance/exchange/v1/market.proto b/proto/provenance/exchange/v1/market.proto
index d53135c51b..7628526395 100644
--- a/proto/provenance/exchange/v1/market.proto
+++ b/proto/provenance/exchange/v1/market.proto
@@ -126,14 +126,16 @@ enum Permission {
PERMISSION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "unspecified"];
// PERMISSION_SETTLE is the ability to use the Settle Tx endpoint on behalf of a market.
PERMISSION_SETTLE = 1 [(gogoproto.enumvalue_customname) = "settle"];
+ // PERMISSION_SET_IDS is the ability to use the SetOrderExternalID Tx endpoint on behalf of a market.
+ PERMISSION_SET_IDS = 2 [(gogoproto.enumvalue_customname) = "set_ids"];
// PERMISSION_CANCEL is the ability to use the Cancel Tx endpoint on behalf of a market.
- PERMISSION_CANCEL = 2 [(gogoproto.enumvalue_customname) = "cancel"];
+ PERMISSION_CANCEL = 3 [(gogoproto.enumvalue_customname) = "cancel"];
// PERMISSION_WITHDRAW is the ability to use the MarketWithdraw Tx endpoint.
- PERMISSION_WITHDRAW = 3 [(gogoproto.enumvalue_customname) = "withdraw"];
+ PERMISSION_WITHDRAW = 4 [(gogoproto.enumvalue_customname) = "withdraw"];
// PERMISSION_UPDATE is the ability to use the MarketUpdate* Tx endpoints.
- PERMISSION_UPDATE = 4 [(gogoproto.enumvalue_customname) = "update"];
+ PERMISSION_UPDATE = 5 [(gogoproto.enumvalue_customname) = "update"];
// PERMISSION_PERMISSIONS is the ability to use the MarketManagePermissions Tx endpoint.
- PERMISSION_PERMISSIONS = 5 [(gogoproto.enumvalue_customname) = "permissions"];
+ PERMISSION_PERMISSIONS = 6 [(gogoproto.enumvalue_customname) = "permissions"];
// PERMISSION_ATTRIBUTES is the ability to use the MarketManageReqAttrs Tx endpoint.
- PERMISSION_ATTRIBUTES = 6 [(gogoproto.enumvalue_customname) = "attributes"];
+ PERMISSION_ATTRIBUTES = 7 [(gogoproto.enumvalue_customname) = "attributes"];
}
\ No newline at end of file
diff --git a/proto/provenance/exchange/v1/orders.proto b/proto/provenance/exchange/v1/orders.proto
index 29228ce166..7ba84762ea 100644
--- a/proto/provenance/exchange/v1/orders.proto
+++ b/proto/provenance/exchange/v1/orders.proto
@@ -47,6 +47,9 @@ message AskOrder {
// allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the
// order must be either filled in full or not filled at all.
bool allow_partial = 6;
+ // external_id is an optional string used to externally identify this order. Max length is 40 characters.
+ // If an order in this market with this external id already exists, this order will be rejected.
+ string external_id = 7;
}
// BidOrder represents someone's desire to buy something at a specific price.
@@ -69,4 +72,7 @@ message BidOrder {
// allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the
// order must be either filled in full or not filled at all.
bool allow_partial = 6;
+ // external_id is an optional string used to externally identify this order. Max length is 40 characters.
+ // If an order in this market with this external id already exists, this order will be rejected.
+ string external_id = 7;
}
\ No newline at end of file
diff --git a/proto/provenance/exchange/v1/query.proto b/proto/provenance/exchange/v1/query.proto
index 8db771ac42..adeb6a6824 100644
--- a/proto/provenance/exchange/v1/query.proto
+++ b/proto/provenance/exchange/v1/query.proto
@@ -28,6 +28,14 @@ service Query {
option (google.api.http).get = "/provenance/exchange/v1/order/{order_id}";
}
+ // QueryGetOrderByExternalID looks up an order by market id and external id.
+ rpc QueryGetOrderByExternalID(QueryGetOrderByExternalIDRequest) returns (QueryGetOrderByExternalIDResponse) {
+ option (google.api.http) = {
+ get: "/provenance/exchange/v1/orders/market/{market_id}/{external_id}"
+ additional_bindings: {get: "/provenance/exchange/v1/market/{market_id}/order/{external_id}"}
+ };
+ }
+
// QueryGetMarketOrders looks up the orders in a market.
rpc QueryGetMarketOrders(QueryGetMarketOrdersRequest) returns (QueryGetMarketOrdersResponse) {
option (google.api.http) = {
@@ -127,6 +135,20 @@ message QueryGetOrderResponse {
Order order = 1;
}
+// QueryGetOrderByExternalIDRequest is a request message for the QueryGetOrderByExternalID endpoint.
+message QueryGetOrderByExternalIDRequest {
+ // market_id is the id of the market that's expected to have the order.
+ uint32 market_id = 1;
+ // external_id the external id to look up.
+ string external_id = 2;
+}
+
+// QueryGetOrderByExternalIDResponse is a response message for the QueryGetOrderByExternalID endpoint.
+message QueryGetOrderByExternalIDResponse {
+ // order is the requested order.
+ Order order = 1;
+}
+
// QueryGetMarketOrdersRequest is a request message for the QueryGetMarketOrders endpoint.
message QueryGetMarketOrdersRequest {
// market_id is the id of the market to get all the orders for.
diff --git a/proto/provenance/exchange/v1/tx.proto b/proto/provenance/exchange/v1/tx.proto
index 8ff9ccc55a..0a23d47528 100644
--- a/proto/provenance/exchange/v1/tx.proto
+++ b/proto/provenance/exchange/v1/tx.proto
@@ -34,6 +34,9 @@ service Msg {
// MarketSettle is a market endpoint to trigger the settlement of orders.
rpc MarketSettle(MsgMarketSettleRequest) returns (MsgMarketSettleResponse);
+ // MarketSetOrderExternalID updates an order's external id field.
+ rpc MarketSetOrderExternalID(MsgMarketSetOrderExternalIDRequest) returns (MsgMarketSetOrderExternalIDResponse);
+
// MarketWithdraw is a market endpoint to withdraw fees that have been collected.
rpc MarketWithdraw(MsgMarketWithdrawRequest) returns (MsgMarketWithdrawResponse);
@@ -182,6 +185,25 @@ message MsgMarketSettleRequest {
// MsgMarketSettleResponse is a response message for the MarketSettle endpoint.
message MsgMarketSettleResponse {}
+// MsgMarketSetOrderExternalIDRequest is a request message for the MarketSetOrderExternalID endpoint.
+message MsgMarketSetOrderExternalIDRequest {
+ option (cosmos.msg.v1.signer) = "admin";
+
+ // admin is the account with "set_ids" permission requesting this settlement.
+ string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
+ // market_id is the numerical identifier of the market to update required attributes for.
+ uint32 market_id = 2;
+
+ // order_id is the numerical identifier of the order to update.
+ uint64 order_id = 3;
+ // external_id is the new external id to associate with the order. Max length is 40 characters.
+ // If the external id is already associated with another order in this market, this update will fail.
+ string external_id = 4;
+}
+
+// MsgMarketSetOrderExternalIDResponse is a response message for the MarketSetOrderExternalID endpoint.
+message MsgMarketSetOrderExternalIDResponse {}
+
// MsgMarketWithdrawRequest is a request message for the MarketWithdraw endpoint.
message MsgMarketWithdrawRequest {
option (cosmos.msg.v1.signer) = "admin";
diff --git a/x/exchange/events.go b/x/exchange/events.go
index 436e81553a..b73b9367f9 100644
--- a/x/exchange/events.go
+++ b/x/exchange/events.go
@@ -6,35 +6,46 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
-func NewEventOrderCreated(order *Order) *EventOrderCreated {
+func NewEventOrderCreated(order OrderI) *EventOrderCreated {
return &EventOrderCreated{
- OrderId: order.GetOrderID(),
- OrderType: order.GetOrderType(),
+ OrderId: order.GetOrderID(),
+ OrderType: order.GetOrderType(),
+ ExternalId: order.GetExternalID(),
}
}
-func NewEventOrderCancelled(orderID uint64, cancelledBy sdk.AccAddress) *EventOrderCancelled {
+func NewEventOrderCancelled(order OrderI, cancelledBy sdk.AccAddress) *EventOrderCancelled {
return &EventOrderCancelled{
- OrderId: orderID,
+ OrderId: order.GetOrderID(),
CancelledBy: cancelledBy.String(),
+ ExternalId: order.GetExternalID(),
}
}
func NewEventOrderFilled(order OrderI) *EventOrderFilled {
return &EventOrderFilled{
- OrderId: order.GetOrderID(),
- Assets: order.GetAssets().String(),
- Price: order.GetPrice().String(),
- Fees: order.GetSettlementFees().String(),
+ OrderId: order.GetOrderID(),
+ Assets: order.GetAssets().String(),
+ Price: order.GetPrice().String(),
+ Fees: order.GetSettlementFees().String(),
+ ExternalId: order.GetExternalID(),
}
}
func NewEventOrderPartiallyFilled(order OrderI) *EventOrderPartiallyFilled {
return &EventOrderPartiallyFilled{
- OrderId: order.GetOrderID(),
- Assets: order.GetAssets().String(),
- Price: order.GetPrice().String(),
- Fees: order.GetSettlementFees().String(),
+ OrderId: order.GetOrderID(),
+ Assets: order.GetAssets().String(),
+ Price: order.GetPrice().String(),
+ Fees: order.GetSettlementFees().String(),
+ ExternalId: order.GetExternalID(),
+ }
+}
+
+func NewEventOrderExternalIDUpdated(order OrderI) *EventOrderExternalIDUpdated {
+ return &EventOrderExternalIDUpdated{
+ OrderId: order.GetOrderID(),
+ ExternalId: order.GetExternalID(),
}
}
diff --git a/x/exchange/events.pb.go b/x/exchange/events.pb.go
index a7700ff0f7..0fd503f3d4 100644
--- a/x/exchange/events.pb.go
+++ b/x/exchange/events.pb.go
@@ -29,6 +29,8 @@ type EventOrderCreated struct {
OrderId uint64 `protobuf:"varint,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
// order_type is the type of order, e.g. "ask" or "bid".
OrderType string `protobuf:"bytes,2,opt,name=order_type,json=orderType,proto3" json:"order_type,omitempty"`
+ // external_id is the order's external id.
+ ExternalId string `protobuf:"bytes,3,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
}
func (m *EventOrderCreated) Reset() { *m = EventOrderCreated{} }
@@ -78,12 +80,21 @@ func (m *EventOrderCreated) GetOrderType() string {
return ""
}
+func (m *EventOrderCreated) GetExternalId() string {
+ if m != nil {
+ return m.ExternalId
+ }
+ return ""
+}
+
// EventOrderCancelled is an event emitted when an order is cancelled.
type EventOrderCancelled struct {
// order_id is the numerical identifier of the order cancelled.
OrderId uint64 `protobuf:"varint,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
// cancelled_by is the account that triggered the cancellation of the order.
CancelledBy string `protobuf:"bytes,2,opt,name=cancelled_by,json=cancelledBy,proto3" json:"cancelled_by,omitempty"`
+ // external_id is the order's external id.
+ ExternalId string `protobuf:"bytes,3,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
}
func (m *EventOrderCancelled) Reset() { *m = EventOrderCancelled{} }
@@ -133,6 +144,13 @@ func (m *EventOrderCancelled) GetCancelledBy() string {
return ""
}
+func (m *EventOrderCancelled) GetExternalId() string {
+ if m != nil {
+ return m.ExternalId
+ }
+ return ""
+}
+
// EventOrderFilled is an event emitted when an order has been filled in full.
// This event is also used for orders that were previously partially filled, but have now been filled in full.
type EventOrderFilled struct {
@@ -144,6 +162,8 @@ type EventOrderFilled struct {
Price string `protobuf:"bytes,3,opt,name=price,proto3" json:"price,omitempty"`
// fees is the coins amount string of settlement fees paid with this order.
Fees string `protobuf:"bytes,4,opt,name=fees,proto3" json:"fees,omitempty"`
+ // external_id is the order's external id.
+ ExternalId string `protobuf:"bytes,5,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
}
func (m *EventOrderFilled) Reset() { *m = EventOrderFilled{} }
@@ -207,6 +227,13 @@ func (m *EventOrderFilled) GetFees() string {
return ""
}
+func (m *EventOrderFilled) GetExternalId() string {
+ if m != nil {
+ return m.ExternalId
+ }
+ return ""
+}
+
// EventOrderPartiallyFilled is an event emitted when an order filled in part and still has more left to fill.
type EventOrderPartiallyFilled struct {
// order_id is the numerical identifier of the order partially filled.
@@ -219,6 +246,8 @@ type EventOrderPartiallyFilled struct {
// fees is the coins amount string of settlement fees paid with this partial order.
// For ask orders, this might be more than the amount that was removed from the order's settlement fees.
Fees string `protobuf:"bytes,4,opt,name=fees,proto3" json:"fees,omitempty"`
+ // external_id is the order's external id.
+ ExternalId string `protobuf:"bytes,5,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
}
func (m *EventOrderPartiallyFilled) Reset() { *m = EventOrderPartiallyFilled{} }
@@ -282,6 +311,68 @@ func (m *EventOrderPartiallyFilled) GetFees() string {
return ""
}
+func (m *EventOrderPartiallyFilled) GetExternalId() string {
+ if m != nil {
+ return m.ExternalId
+ }
+ return ""
+}
+
+// EventOrderExternalIDUpdated is an event emitted when an order's external id is updated.
+type EventOrderExternalIDUpdated struct {
+ // order_id is the numerical identifier of the order partially filled.
+ OrderId uint64 `protobuf:"varint,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
+ // external_id is the order's new external id.
+ ExternalId string `protobuf:"bytes,3,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
+}
+
+func (m *EventOrderExternalIDUpdated) Reset() { *m = EventOrderExternalIDUpdated{} }
+func (m *EventOrderExternalIDUpdated) String() string { return proto.CompactTextString(m) }
+func (*EventOrderExternalIDUpdated) ProtoMessage() {}
+func (*EventOrderExternalIDUpdated) Descriptor() ([]byte, []int) {
+ return fileDescriptor_c1b69385a348cffa, []int{4}
+}
+func (m *EventOrderExternalIDUpdated) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *EventOrderExternalIDUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_EventOrderExternalIDUpdated.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *EventOrderExternalIDUpdated) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EventOrderExternalIDUpdated.Merge(m, src)
+}
+func (m *EventOrderExternalIDUpdated) XXX_Size() int {
+ return m.Size()
+}
+func (m *EventOrderExternalIDUpdated) XXX_DiscardUnknown() {
+ xxx_messageInfo_EventOrderExternalIDUpdated.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EventOrderExternalIDUpdated proto.InternalMessageInfo
+
+func (m *EventOrderExternalIDUpdated) GetOrderId() uint64 {
+ if m != nil {
+ return m.OrderId
+ }
+ return 0
+}
+
+func (m *EventOrderExternalIDUpdated) GetExternalId() string {
+ if m != nil {
+ return m.ExternalId
+ }
+ return ""
+}
+
// EventMarketWithdraw is an event emitted when a withdrawal of a market's collected fees is made.
type EventMarketWithdraw struct {
// market_id is the numerical identifier of the market.
@@ -298,7 +389,7 @@ func (m *EventMarketWithdraw) Reset() { *m = EventMarketWithdraw{} }
func (m *EventMarketWithdraw) String() string { return proto.CompactTextString(m) }
func (*EventMarketWithdraw) ProtoMessage() {}
func (*EventMarketWithdraw) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{4}
+ return fileDescriptor_c1b69385a348cffa, []int{5}
}
func (m *EventMarketWithdraw) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -367,7 +458,7 @@ func (m *EventMarketDetailsUpdated) Reset() { *m = EventMarketDetailsUpd
func (m *EventMarketDetailsUpdated) String() string { return proto.CompactTextString(m) }
func (*EventMarketDetailsUpdated) ProtoMessage() {}
func (*EventMarketDetailsUpdated) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{5}
+ return fileDescriptor_c1b69385a348cffa, []int{6}
}
func (m *EventMarketDetailsUpdated) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -422,7 +513,7 @@ func (m *EventMarketEnabled) Reset() { *m = EventMarketEnabled{} }
func (m *EventMarketEnabled) String() string { return proto.CompactTextString(m) }
func (*EventMarketEnabled) ProtoMessage() {}
func (*EventMarketEnabled) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{6}
+ return fileDescriptor_c1b69385a348cffa, []int{7}
}
func (m *EventMarketEnabled) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -477,7 +568,7 @@ func (m *EventMarketDisabled) Reset() { *m = EventMarketDisabled{} }
func (m *EventMarketDisabled) String() string { return proto.CompactTextString(m) }
func (*EventMarketDisabled) ProtoMessage() {}
func (*EventMarketDisabled) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{7}
+ return fileDescriptor_c1b69385a348cffa, []int{8}
}
func (m *EventMarketDisabled) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -532,7 +623,7 @@ func (m *EventMarketUserSettleEnabled) Reset() { *m = EventMarketUserSet
func (m *EventMarketUserSettleEnabled) String() string { return proto.CompactTextString(m) }
func (*EventMarketUserSettleEnabled) ProtoMessage() {}
func (*EventMarketUserSettleEnabled) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{8}
+ return fileDescriptor_c1b69385a348cffa, []int{9}
}
func (m *EventMarketUserSettleEnabled) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -587,7 +678,7 @@ func (m *EventMarketUserSettleDisabled) Reset() { *m = EventMarketUserSe
func (m *EventMarketUserSettleDisabled) String() string { return proto.CompactTextString(m) }
func (*EventMarketUserSettleDisabled) ProtoMessage() {}
func (*EventMarketUserSettleDisabled) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{9}
+ return fileDescriptor_c1b69385a348cffa, []int{10}
}
func (m *EventMarketUserSettleDisabled) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -642,7 +733,7 @@ func (m *EventMarketPermissionsUpdated) Reset() { *m = EventMarketPermis
func (m *EventMarketPermissionsUpdated) String() string { return proto.CompactTextString(m) }
func (*EventMarketPermissionsUpdated) ProtoMessage() {}
func (*EventMarketPermissionsUpdated) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{10}
+ return fileDescriptor_c1b69385a348cffa, []int{11}
}
func (m *EventMarketPermissionsUpdated) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -697,7 +788,7 @@ func (m *EventMarketReqAttrUpdated) Reset() { *m = EventMarketReqAttrUpd
func (m *EventMarketReqAttrUpdated) String() string { return proto.CompactTextString(m) }
func (*EventMarketReqAttrUpdated) ProtoMessage() {}
func (*EventMarketReqAttrUpdated) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{11}
+ return fileDescriptor_c1b69385a348cffa, []int{12}
}
func (m *EventMarketReqAttrUpdated) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -750,7 +841,7 @@ func (m *EventMarketCreated) Reset() { *m = EventMarketCreated{} }
func (m *EventMarketCreated) String() string { return proto.CompactTextString(m) }
func (*EventMarketCreated) ProtoMessage() {}
func (*EventMarketCreated) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{12}
+ return fileDescriptor_c1b69385a348cffa, []int{13}
}
func (m *EventMarketCreated) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -796,7 +887,7 @@ func (m *EventMarketFeesUpdated) Reset() { *m = EventMarketFeesUpdated{}
func (m *EventMarketFeesUpdated) String() string { return proto.CompactTextString(m) }
func (*EventMarketFeesUpdated) ProtoMessage() {}
func (*EventMarketFeesUpdated) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{13}
+ return fileDescriptor_c1b69385a348cffa, []int{14}
}
func (m *EventMarketFeesUpdated) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -840,7 +931,7 @@ func (m *EventParamsUpdated) Reset() { *m = EventParamsUpdated{} }
func (m *EventParamsUpdated) String() string { return proto.CompactTextString(m) }
func (*EventParamsUpdated) ProtoMessage() {}
func (*EventParamsUpdated) Descriptor() ([]byte, []int) {
- return fileDescriptor_c1b69385a348cffa, []int{14}
+ return fileDescriptor_c1b69385a348cffa, []int{15}
}
func (m *EventParamsUpdated) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -874,6 +965,7 @@ func init() {
proto.RegisterType((*EventOrderCancelled)(nil), "provenance.exchange.v1.EventOrderCancelled")
proto.RegisterType((*EventOrderFilled)(nil), "provenance.exchange.v1.EventOrderFilled")
proto.RegisterType((*EventOrderPartiallyFilled)(nil), "provenance.exchange.v1.EventOrderPartiallyFilled")
+ proto.RegisterType((*EventOrderExternalIDUpdated)(nil), "provenance.exchange.v1.EventOrderExternalIDUpdated")
proto.RegisterType((*EventMarketWithdraw)(nil), "provenance.exchange.v1.EventMarketWithdraw")
proto.RegisterType((*EventMarketDetailsUpdated)(nil), "provenance.exchange.v1.EventMarketDetailsUpdated")
proto.RegisterType((*EventMarketEnabled)(nil), "provenance.exchange.v1.EventMarketEnabled")
@@ -892,41 +984,43 @@ func init() {
}
var fileDescriptor_c1b69385a348cffa = []byte{
- // 535 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0xc1, 0x6e, 0xd3, 0x4c,
- 0x10, 0xc7, 0xe3, 0xef, 0x0b, 0xa5, 0x99, 0x82, 0x04, 0x26, 0x8a, 0x12, 0xa0, 0x56, 0x65, 0x2e,
- 0xbd, 0xd4, 0x56, 0x84, 0x10, 0x12, 0x9c, 0x1a, 0xda, 0x4a, 0x1c, 0x2a, 0x22, 0x97, 0x0a, 0x89,
- 0x4b, 0xb4, 0xb1, 0x87, 0x64, 0xa9, 0xbd, 0xeb, 0xee, 0x6e, 0xd2, 0xf8, 0x2d, 0x78, 0x18, 0xde,
- 0x80, 0x0b, 0xc7, 0x8a, 0x13, 0x47, 0x94, 0xbc, 0x08, 0xf2, 0xda, 0x4e, 0x1c, 0xa9, 0x4a, 0x7b,
- 0x31, 0xb7, 0xfc, 0x27, 0xff, 0x99, 0xdf, 0xce, 0xec, 0xc8, 0x0b, 0x2f, 0x62, 0xc1, 0xa7, 0xc8,
- 0x08, 0xf3, 0xd1, 0xc5, 0x99, 0x3f, 0x26, 0x6c, 0x84, 0xee, 0xb4, 0xeb, 0xe2, 0x14, 0x99, 0x92,
- 0x4e, 0x2c, 0xb8, 0xe2, 0x66, 0x6b, 0x65, 0x72, 0x0a, 0x93, 0x33, 0xed, 0x3e, 0xed, 0xf8, 0x5c,
- 0x46, 0x5c, 0x0e, 0xb4, 0xcb, 0xcd, 0x44, 0x96, 0x62, 0x9f, 0xc2, 0xe3, 0xe3, 0xb4, 0xc4, 0x07,
- 0x11, 0xa0, 0x78, 0x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, 0xe0, 0x8f, 0x89, 0xa1, 0x5d, 0x4d, 0x0c,
+ 0xed, 0xf7, 0xc4, 0xd0, 0x2e, 0xa7, 0xc6, 0xda, 0xd5, 0xd4, 0x58, 0xfb, 0x35, 0x35, 0xd6, 0xa0,
+ 0x46, 0xb9, 0x75, 0xfd, 0x0e, 0x6d, 0x6b, 0x1f, 0xad, 0x3e, 0x55, 0x83, 0x61, 0xcf, 0x72, 0xb8,
+ 0x6f, 0xcf, 0x41, 0x07, 0x94, 0xe7, 0x2a, 0x7b, 0x3c, 0xdb, 0xce, 0xbd, 0x8d, 0x78, 0xc3, 0x3e,
+ 0xfb, 0x13, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xcb, 0x11, 0xaf, 0xbb, 0x07, 0x00, 0x00,
}
func (m *EventOrderCreated) Marshal() (dAtA []byte, err error) {
@@ -949,6 +1043,13 @@ func (m *EventOrderCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintEvents(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x1a
+ }
if len(m.OrderType) > 0 {
i -= len(m.OrderType)
copy(dAtA[i:], m.OrderType)
@@ -984,6 +1085,13 @@ func (m *EventOrderCancelled) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintEvents(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x1a
+ }
if len(m.CancelledBy) > 0 {
i -= len(m.CancelledBy)
copy(dAtA[i:], m.CancelledBy)
@@ -1019,6 +1127,13 @@ func (m *EventOrderFilled) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintEvents(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x2a
+ }
if len(m.Fees) > 0 {
i -= len(m.Fees)
copy(dAtA[i:], m.Fees)
@@ -1068,6 +1183,13 @@ func (m *EventOrderPartiallyFilled) MarshalToSizedBuffer(dAtA []byte) (int, erro
_ = i
var l int
_ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintEvents(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x2a
+ }
if len(m.Fees) > 0 {
i -= len(m.Fees)
copy(dAtA[i:], m.Fees)
@@ -1097,6 +1219,41 @@ func (m *EventOrderPartiallyFilled) MarshalToSizedBuffer(dAtA []byte) (int, erro
return len(dAtA) - i, nil
}
+func (m *EventOrderExternalIDUpdated) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *EventOrderExternalIDUpdated) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *EventOrderExternalIDUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintEvents(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x1a
+ }
+ if m.OrderId != 0 {
+ i = encodeVarintEvents(dAtA, i, uint64(m.OrderId))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
func (m *EventMarketWithdraw) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -1494,6 +1651,10 @@ func (m *EventOrderCreated) Size() (n int) {
if l > 0 {
n += 1 + l + sovEvents(uint64(l))
}
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovEvents(uint64(l))
+ }
return n
}
@@ -1510,6 +1671,10 @@ func (m *EventOrderCancelled) Size() (n int) {
if l > 0 {
n += 1 + l + sovEvents(uint64(l))
}
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovEvents(uint64(l))
+ }
return n
}
@@ -1534,6 +1699,10 @@ func (m *EventOrderFilled) Size() (n int) {
if l > 0 {
n += 1 + l + sovEvents(uint64(l))
}
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovEvents(uint64(l))
+ }
return n
}
@@ -1558,6 +1727,26 @@ func (m *EventOrderPartiallyFilled) Size() (n int) {
if l > 0 {
n += 1 + l + sovEvents(uint64(l))
}
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovEvents(uint64(l))
+ }
+ return n
+}
+
+func (m *EventOrderExternalIDUpdated) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.OrderId != 0 {
+ n += 1 + sovEvents(uint64(m.OrderId))
+ }
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovEvents(uint64(l))
+ }
return n
}
@@ -1816,6 +2005,38 @@ func (m *EventOrderCreated) Unmarshal(dAtA []byte) error {
}
m.OrderType = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvents
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthEvents
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipEvents(dAtA[iNdEx:])
@@ -1917,6 +2138,38 @@ func (m *EventOrderCancelled) Unmarshal(dAtA []byte) error {
}
m.CancelledBy = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvents
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthEvents
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipEvents(dAtA[iNdEx:])
@@ -2082,6 +2335,38 @@ func (m *EventOrderFilled) Unmarshal(dAtA []byte) error {
}
m.Fees = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvents
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthEvents
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipEvents(dAtA[iNdEx:])
@@ -2247,6 +2532,139 @@ func (m *EventOrderPartiallyFilled) Unmarshal(dAtA []byte) error {
}
m.Fees = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvents
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthEvents
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipEvents(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *EventOrderExternalIDUpdated) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvents
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: EventOrderExternalIDUpdated: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: EventOrderExternalIDUpdated: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field OrderId", wireType)
+ }
+ m.OrderId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvents
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.OrderId |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowEvents
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthEvents
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthEvents
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipEvents(dAtA[iNdEx:])
diff --git a/x/exchange/events_test.go b/x/exchange/events_test.go
index 5fd2bfc999..cdd4ca14d2 100644
--- a/x/exchange/events_test.go
+++ b/x/exchange/events_test.go
@@ -26,11 +26,11 @@ func assertEverythingSet(t *testing.T, tev proto.Message, typeString string) boo
expType := "provenance.exchange.v1." + typeString
rv := assert.Equal(t, expType, event.Type, "%T event.Type", tev)
- for i, attrs := range event.Attributes {
- rv = assert.NotEmpty(t, attrs.Key, "%T event.attributes[%d].Key", tev, i) && rv
- rv = assert.NotEqual(t, `""`, attrs.Key, "%T event.attributes[%d].Key", tev, i) && rv
- rv = assert.NotEmpty(t, attrs.Value, "%T event.attributes[%d].Value", tev, i) && rv
- rv = assert.NotEqual(t, `""`, attrs.Value, "%T event.attributes[%d].Value", tev, i) && rv
+ for i, attr := range event.Attributes {
+ rv = assert.NotEmpty(t, attr.Key, "%T event.attributes[%d].Key", tev, i) && rv
+ rv = assert.NotEqual(t, `""`, string(attr.Key), "%T event.attributes[%d].Key", tev, i) && rv
+ rv = assert.NotEmpty(t, attr.Value, "%T event.attributes[%d].Value", tev, i) && rv
+ rv = assert.NotEqual(t, `""`, string(attr.Value), "%T event.attributes[%d].Value", tev, i) && rv
}
return rv
}
@@ -40,29 +40,29 @@ func TestNewEventOrderCreated(t *testing.T) {
name string
order *Order
expected *EventOrderCreated
+ expPanic string
}{
{
- name: "nil order",
- order: NewOrder(3),
- expected: &EventOrderCreated{
- OrderId: 3,
- OrderType: "",
- },
+ name: "nil order",
+ order: NewOrder(3),
+ expPanic: "order 3 has unknown sub-order type : does not implement SubOrderI",
},
{
name: "order with ask",
- order: NewOrder(1).WithAsk(&AskOrder{}),
+ order: NewOrder(1).WithAsk(&AskOrder{ExternalId: "oneoneone"}),
expected: &EventOrderCreated{
- OrderId: 1,
- OrderType: "ask",
+ OrderId: 1,
+ OrderType: "ask",
+ ExternalId: "oneoneone",
},
},
{
name: "order with bid",
- order: NewOrder(2).WithBid(&BidOrder{}),
+ order: NewOrder(2).WithBid(&BidOrder{ExternalId: "twotwotwo"}),
expected: &EventOrderCreated{
- OrderId: 2,
- OrderType: "bid",
+ OrderId: 2,
+ OrderType: "bid",
+ ExternalId: "twotwotwo",
},
},
}
@@ -73,7 +73,10 @@ func TestNewEventOrderCreated(t *testing.T) {
testFunc := func() {
actual = NewEventOrderCreated(tc.order)
}
- require.NotPanics(t, testFunc, "NewEventOrderCreated")
+ assertions.RequirePanicEquals(t, testFunc, tc.expPanic, "NewEventOrderCreated")
+ if len(tc.expPanic) > 0 {
+ return
+ }
assert.Equal(t, tc.expected, actual, "NewEventOrderCreated result")
assertEverythingSet(t, actual, "EventOrderCreated")
})
@@ -81,13 +84,45 @@ func TestNewEventOrderCreated(t *testing.T) {
}
func TestNewEventOrderCancelled(t *testing.T) {
- orderID := uint64(101)
- cancelledBy := sdk.AccAddress("cancelledBy_________")
+ tests := []struct {
+ name string
+ order OrderI
+ cancelledBy sdk.AccAddress
+ expected *EventOrderCancelled
+ }{
+ {
+ name: "ask order",
+ order: NewOrder(11).WithAsk(&AskOrder{ExternalId: "an external identifier"}),
+ cancelledBy: sdk.AccAddress("CancelledBy_________"),
+ expected: &EventOrderCancelled{
+ OrderId: 11,
+ CancelledBy: sdk.AccAddress("CancelledBy_________").String(),
+ ExternalId: "an external identifier",
+ },
+ },
+ {
+ name: "bid order",
+ order: NewOrder(55).WithAsk(&AskOrder{ExternalId: "another external identifier"}),
+ cancelledBy: sdk.AccAddress("cancelled_by________"),
+ expected: &EventOrderCancelled{
+ OrderId: 55,
+ CancelledBy: sdk.AccAddress("cancelled_by________").String(),
+ ExternalId: "another external identifier",
+ },
+ },
+ }
- event := NewEventOrderCancelled(orderID, cancelledBy)
- assert.Equal(t, orderID, event.OrderId, "OrderId")
- assert.Equal(t, cancelledBy.String(), event.CancelledBy, "CancelledBy")
- assertEverythingSet(t, event, "EventOrderCancelled")
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ var event *EventOrderCancelled
+ testFunc := func() {
+ event = NewEventOrderCancelled(tc.order, tc.cancelledBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventOrderCancelled")
+ assert.Equal(t, tc.expected, event, "NewEventOrderCancelled result")
+ assertEverythingSet(t, event, "EventOrderCancelled")
+ })
+ }
}
func TestNewEventOrderFilled(t *testing.T) {
@@ -97,12 +132,9 @@ func TestNewEventOrderFilled(t *testing.T) {
}
tests := []struct {
- name string
- order OrderI
- expOrderID uint64
- expAssets string
- expPrice string
- expFees string
+ name string
+ order OrderI
+ expected *EventOrderFilled
}{
{
name: "ask",
@@ -110,11 +142,15 @@ func TestNewEventOrderFilled(t *testing.T) {
Assets: sdk.NewInt64Coin("apple", 22),
Price: sdk.NewInt64Coin("plum", 18),
SellerSettlementFlatFee: coinP("fig", 57),
+ ExternalId: "one",
}),
- expOrderID: 4,
- expAssets: "22apple",
- expPrice: "18plum",
- expFees: "57fig",
+ expected: &EventOrderFilled{
+ OrderId: 4,
+ Assets: "22apple",
+ Price: "18plum",
+ Fees: "57fig",
+ ExternalId: "one",
+ },
},
{
name: "filled ask",
@@ -122,11 +158,15 @@ func TestNewEventOrderFilled(t *testing.T) {
Assets: sdk.NewInt64Coin("apple", 22),
Price: sdk.NewInt64Coin("plum", 18),
SellerSettlementFlatFee: coinP("fig", 57),
+ ExternalId: "two",
}), sdk.NewInt64Coin("plum", 88), sdk.NewCoins(sdk.NewInt64Coin("fig", 61), sdk.NewInt64Coin("grape", 12))),
- expOrderID: 4,
- expAssets: "22apple",
- expPrice: "88plum",
- expFees: "61fig,12grape",
+ expected: &EventOrderFilled{
+ OrderId: 4,
+ Assets: "22apple",
+ Price: "88plum",
+ Fees: "61fig,12grape",
+ ExternalId: "two",
+ },
},
{
name: "bid",
@@ -134,23 +174,31 @@ func TestNewEventOrderFilled(t *testing.T) {
Assets: sdk.NewInt64Coin("apple", 23),
Price: sdk.NewInt64Coin("plum", 19),
BuyerSettlementFees: sdk.NewCoins(sdk.NewInt64Coin("fig", 58)),
+ ExternalId: "three",
}),
- expOrderID: 104,
- expAssets: "23apple",
- expPrice: "19plum",
- expFees: "58fig",
+ expected: &EventOrderFilled{
+ OrderId: 104,
+ Assets: "23apple",
+ Price: "19plum",
+ Fees: "58fig",
+ ExternalId: "three",
+ },
},
{
name: "filled bid",
- order: NewFilledOrder(NewOrder(104).WithBid(&BidOrder{
- Assets: sdk.NewInt64Coin("apple", 23),
- Price: sdk.NewInt64Coin("plum", 19),
- BuyerSettlementFees: sdk.NewCoins(sdk.NewInt64Coin("fig", 58)),
+ order: NewFilledOrder(NewOrder(105).WithBid(&BidOrder{
+ Assets: sdk.NewInt64Coin("apple", 24),
+ Price: sdk.NewInt64Coin("plum", 20),
+ BuyerSettlementFees: sdk.NewCoins(sdk.NewInt64Coin("fig", 59)),
+ ExternalId: "four",
}), sdk.NewInt64Coin("plum", 89), sdk.NewCoins(sdk.NewInt64Coin("fig", 62), sdk.NewInt64Coin("grape", 13))),
- expOrderID: 104,
- expAssets: "23apple",
- expPrice: "89plum",
- expFees: "62fig,13grape",
+ expected: &EventOrderFilled{
+ OrderId: 105,
+ Assets: "24apple",
+ Price: "89plum",
+ Fees: "62fig,13grape",
+ ExternalId: "four",
+ },
},
}
@@ -161,10 +209,7 @@ func TestNewEventOrderFilled(t *testing.T) {
event = NewEventOrderFilled(tc.order)
}
require.NotPanics(t, testFunc, "NewEventOrderFilled")
- assert.Equal(t, tc.expOrderID, event.OrderId, "OrderId")
- assert.Equal(t, tc.expAssets, event.Assets, "Assets")
- assert.Equal(t, tc.expPrice, event.Price, "Price")
- assert.Equal(t, tc.expFees, event.Fees, "Fees")
+ assert.Equal(t, tc.expected, event, "NewEventOrderFilled result")
assertEverythingSet(t, event, "EventOrderFilled")
})
}
@@ -177,12 +222,9 @@ func TestNewEventOrderPartiallyFilled(t *testing.T) {
}
tests := []struct {
- name string
- order OrderI
- expOrderID uint64
- expAssets string
- expPrice string
- expFees string
+ name string
+ order OrderI
+ expected *EventOrderPartiallyFilled
}{
{
name: "ask",
@@ -190,11 +232,15 @@ func TestNewEventOrderPartiallyFilled(t *testing.T) {
Assets: sdk.NewInt64Coin("apple", 22),
Price: sdk.NewInt64Coin("plum", 18),
SellerSettlementFlatFee: coinP("fig", 57),
+ ExternalId: "five",
}),
- expOrderID: 4,
- expAssets: "22apple",
- expPrice: "18plum",
- expFees: "57fig",
+ expected: &EventOrderPartiallyFilled{
+ OrderId: 4,
+ Assets: "22apple",
+ Price: "18plum",
+ Fees: "57fig",
+ ExternalId: "five",
+ },
},
{
name: "filled ask",
@@ -202,11 +248,15 @@ func TestNewEventOrderPartiallyFilled(t *testing.T) {
Assets: sdk.NewInt64Coin("apple", 22),
Price: sdk.NewInt64Coin("plum", 18),
SellerSettlementFlatFee: coinP("fig", 57),
+ ExternalId: "six",
}), sdk.NewInt64Coin("plum", 88), sdk.NewCoins(sdk.NewInt64Coin("fig", 61), sdk.NewInt64Coin("grape", 12))),
- expOrderID: 4,
- expAssets: "22apple",
- expPrice: "88plum",
- expFees: "61fig,12grape",
+ expected: &EventOrderPartiallyFilled{
+ OrderId: 4,
+ Assets: "22apple",
+ Price: "88plum",
+ Fees: "61fig,12grape",
+ ExternalId: "six",
+ },
},
{
name: "bid",
@@ -214,11 +264,15 @@ func TestNewEventOrderPartiallyFilled(t *testing.T) {
Assets: sdk.NewInt64Coin("apple", 23),
Price: sdk.NewInt64Coin("plum", 19),
BuyerSettlementFees: sdk.NewCoins(sdk.NewInt64Coin("fig", 58)),
+ ExternalId: "seven",
}),
- expOrderID: 104,
- expAssets: "23apple",
- expPrice: "19plum",
- expFees: "58fig",
+ expected: &EventOrderPartiallyFilled{
+ OrderId: 104,
+ Assets: "23apple",
+ Price: "19plum",
+ Fees: "58fig",
+ ExternalId: "seven",
+ },
},
{
name: "filled bid",
@@ -226,11 +280,15 @@ func TestNewEventOrderPartiallyFilled(t *testing.T) {
Assets: sdk.NewInt64Coin("apple", 23),
Price: sdk.NewInt64Coin("plum", 19),
BuyerSettlementFees: sdk.NewCoins(sdk.NewInt64Coin("fig", 58)),
+ ExternalId: "eight",
}), sdk.NewInt64Coin("plum", 89), sdk.NewCoins(sdk.NewInt64Coin("fig", 62), sdk.NewInt64Coin("grape", 13))),
- expOrderID: 104,
- expAssets: "23apple",
- expPrice: "89plum",
- expFees: "62fig,13grape",
+ expected: &EventOrderPartiallyFilled{
+ OrderId: 104,
+ Assets: "23apple",
+ Price: "89plum",
+ Fees: "62fig,13grape",
+ ExternalId: "eight",
+ },
},
}
@@ -240,23 +298,62 @@ func TestNewEventOrderPartiallyFilled(t *testing.T) {
testFunc := func() {
event = NewEventOrderPartiallyFilled(tc.order)
}
- require.NotPanics(t, testFunc, "NewEventOrderFilled")
- assert.Equal(t, tc.expOrderID, event.OrderId, "OrderId")
- assert.Equal(t, tc.expAssets, event.Assets, "Assets")
- assert.Equal(t, tc.expPrice, event.Price, "Price")
- assert.Equal(t, tc.expFees, event.Fees, "Fees")
+ require.NotPanics(t, testFunc, "NewEventOrderPartiallyFilled")
+ assert.Equal(t, tc.expected, event, "NewEventOrderPartiallyFilled result")
assertEverythingSet(t, event, "EventOrderPartiallyFilled")
})
}
}
+func TestNewEventOrderExternalIDUpdated(t *testing.T) {
+ tests := []struct {
+ name string
+ order OrderI
+ expected *EventOrderExternalIDUpdated
+ }{
+ {
+ name: "ask",
+ order: NewOrder(51).WithAsk(&AskOrder{ExternalId: "orange-red"}),
+ expected: &EventOrderExternalIDUpdated{
+ OrderId: 51,
+ ExternalId: "orange-red",
+ },
+ },
+ {
+ name: "bid",
+ order: NewOrder(777).WithAsk(&AskOrder{ExternalId: "purple-purple"}),
+ expected: &EventOrderExternalIDUpdated{
+ OrderId: 777,
+ ExternalId: "purple-purple",
+ },
+ },
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ var event *EventOrderExternalIDUpdated
+ testFunc := func() {
+ event = NewEventOrderExternalIDUpdated(tc.order)
+ }
+ require.NotPanics(t, testFunc, "NewEventOrderExternalIDUpdated")
+ assert.Equal(t, tc.expected, event, "NewEventOrderExternalIDUpdated result")
+ assertEverythingSet(t, event, "EventOrderExternalIDUpdated")
+ })
+ }
+}
+
func TestNewEventMarketWithdraw(t *testing.T) {
marketID := uint32(55)
amountWithdrawn := sdk.NewCoins(sdk.NewInt64Coin("mine", 188382), sdk.NewInt64Coin("yours", 3))
destination := sdk.AccAddress("destination_________")
withdrawnBy := sdk.AccAddress("withdrawnBy_________")
- event := NewEventMarketWithdraw(marketID, amountWithdrawn, destination, withdrawnBy)
+ var event *EventMarketWithdraw
+ testFunc := func() {
+ event = NewEventMarketWithdraw(marketID, amountWithdrawn, destination, withdrawnBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketWithdraw(%d, %q, %q, %q)",
+ marketID, amountWithdrawn, string(destination), string(withdrawnBy))
assert.Equal(t, marketID, event.MarketId, "MarketId")
assert.Equal(t, amountWithdrawn.String(), event.Amount, "Amount")
assert.Equal(t, destination.String(), event.Destination, "Destination")
@@ -268,7 +365,11 @@ func TestNewEventMarketDetailsUpdated(t *testing.T) {
marketID := uint32(84)
updatedBy := sdk.AccAddress("updatedBy___________")
- event := NewEventMarketDetailsUpdated(marketID, updatedBy)
+ var event *EventMarketDetailsUpdated
+ testFunc := func() {
+ event = NewEventMarketDetailsUpdated(marketID, updatedBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketDetailsUpdated(%d, %q)", marketID, string(updatedBy))
assert.Equal(t, marketID, event.MarketId, "MarketId")
assert.Equal(t, updatedBy.String(), event.UpdatedBy, "UpdatedBy")
assertEverythingSet(t, event, "EventMarketDetailsUpdated")
@@ -302,8 +403,13 @@ func TestNewEventMarketActiveUpdated(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
- actual := NewEventMarketActiveUpdated(tc.marketID, tc.updatedBy, tc.isActive)
- assert.Equal(t, tc.expected, actual, "NewEventMarketActiveUpdated(%d, %q, %t) result",
+ var event proto.Message
+ testFunc := func() {
+ event = NewEventMarketActiveUpdated(tc.marketID, tc.updatedBy, tc.isActive)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketActiveUpdated(%d, %q, %t) result",
+ tc.marketID, tc.updatedBy.String(), tc.isActive)
+ assert.Equal(t, tc.expected, event, "NewEventMarketActiveUpdated(%d, %q, %t) result",
tc.marketID, tc.updatedBy.String(), tc.isActive)
})
}
@@ -313,7 +419,11 @@ func TestNewEventMarketEnabled(t *testing.T) {
marketID := uint32(919)
updatedBy := sdk.AccAddress("updatedBy___________")
- event := NewEventMarketEnabled(marketID, updatedBy)
+ var event *EventMarketEnabled
+ testFunc := func() {
+ event = NewEventMarketEnabled(marketID, updatedBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketEnabled(%d, %q)", marketID, string(updatedBy))
assert.Equal(t, marketID, event.MarketId, "MarketId")
assert.Equal(t, updatedBy.String(), event.UpdatedBy, "UpdatedBy")
assertEverythingSet(t, event, "EventMarketEnabled")
@@ -323,7 +433,11 @@ func TestNewEventMarketDisabled(t *testing.T) {
marketID := uint32(5555)
updatedBy := sdk.AccAddress("updatedBy___________")
- event := NewEventMarketDisabled(marketID, updatedBy)
+ var event *EventMarketDisabled
+ testFunc := func() {
+ event = NewEventMarketDisabled(marketID, updatedBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketDisabled(%d, %q)", marketID, string(updatedBy))
assert.Equal(t, marketID, event.MarketId, "MarketId")
assert.Equal(t, updatedBy.String(), event.UpdatedBy, "UpdatedBy")
assertEverythingSet(t, event, "EventMarketDisabled")
@@ -357,8 +471,13 @@ func TestNewEventMarketUserSettleUpdated(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
- actual := NewEventMarketUserSettleUpdated(tc.marketID, tc.updatedBy, tc.isAllowed)
- assert.Equal(t, tc.expected, actual, "NewEventMarketUserSettleUpdated(%d, %q, %t) result",
+ var event proto.Message
+ testFunc := func() {
+ event = NewEventMarketUserSettleUpdated(tc.marketID, tc.updatedBy, tc.isAllowed)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketUserSettleUpdated(%d, %q, %t) result",
+ tc.marketID, tc.updatedBy.String(), tc.isAllowed)
+ assert.Equal(t, tc.expected, event, "NewEventMarketUserSettleUpdated(%d, %q, %t) result",
tc.marketID, tc.updatedBy.String(), tc.isAllowed)
})
}
@@ -368,7 +487,11 @@ func TestNewEventMarketUserSettleEnabled(t *testing.T) {
marketID := uint32(123)
updatedBy := sdk.AccAddress("updatedBy___________")
- event := NewEventMarketUserSettleEnabled(marketID, updatedBy)
+ var event *EventMarketUserSettleEnabled
+ testFunc := func() {
+ event = NewEventMarketUserSettleEnabled(marketID, updatedBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketUserSettleEnabled(%d, %q)", marketID, string(updatedBy))
assert.Equal(t, marketID, event.MarketId, "MarketId")
assert.Equal(t, updatedBy.String(), event.UpdatedBy, "UpdatedBy")
assertEverythingSet(t, event, "EventMarketUserSettleEnabled")
@@ -378,7 +501,11 @@ func TestNewEventMarketUserSettleDisabled(t *testing.T) {
marketID := uint32(123)
updatedBy := sdk.AccAddress("updatedBy___________")
- event := NewEventMarketUserSettleDisabled(marketID, updatedBy)
+ var event *EventMarketUserSettleDisabled
+ testFunc := func() {
+ event = NewEventMarketUserSettleDisabled(marketID, updatedBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketUserSettleDisabled(%d, %q)", marketID, string(updatedBy))
assert.Equal(t, marketID, event.MarketId, "MarketId")
assert.Equal(t, updatedBy.String(), event.UpdatedBy, "UpdatedBy")
assertEverythingSet(t, event, "EventMarketUserSettleDisabled")
@@ -388,7 +515,11 @@ func TestNewEventMarketPermissionsUpdated(t *testing.T) {
marketID := uint32(5432)
updatedBy := sdk.AccAddress("updatedBy___________")
- event := NewEventMarketPermissionsUpdated(marketID, updatedBy)
+ var event *EventMarketPermissionsUpdated
+ testFunc := func() {
+ event = NewEventMarketPermissionsUpdated(marketID, updatedBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketPermissionsUpdated(%d, %q)", marketID, string(updatedBy))
assert.Equal(t, marketID, event.MarketId, "MarketId")
assert.Equal(t, updatedBy.String(), event.UpdatedBy, "UpdatedBy")
assertEverythingSet(t, event, "EventMarketPermissionsUpdated")
@@ -398,7 +529,11 @@ func TestNewEventMarketReqAttrUpdated(t *testing.T) {
marketID := uint32(3334)
updatedBy := sdk.AccAddress("updatedBy___________")
- event := NewEventMarketReqAttrUpdated(marketID, updatedBy)
+ var event *EventMarketReqAttrUpdated
+ testFunc := func() {
+ event = NewEventMarketReqAttrUpdated(marketID, updatedBy)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketReqAttrUpdated(%d, %q)", marketID, string(updatedBy))
assert.Equal(t, marketID, event.MarketId, "MarketId")
assert.Equal(t, updatedBy.String(), event.UpdatedBy, "UpdatedBy")
assertEverythingSet(t, event, "EventMarketReqAttrUpdated")
@@ -407,7 +542,11 @@ func TestNewEventMarketReqAttrUpdated(t *testing.T) {
func TestNewEventMarketCreated(t *testing.T) {
marketID := uint32(10111213)
- event := NewEventMarketCreated(marketID)
+ var event *EventMarketCreated
+ testFunc := func() {
+ event = NewEventMarketCreated(marketID)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketCreated(%d)", marketID)
assert.Equal(t, marketID, event.MarketId, "MarketId")
assertEverythingSet(t, event, "EventMarketCreated")
}
@@ -415,13 +554,21 @@ func TestNewEventMarketCreated(t *testing.T) {
func TestNewEventMarketFeesUpdated(t *testing.T) {
marketID := uint32(1415)
- event := NewEventMarketFeesUpdated(marketID)
+ var event *EventMarketFeesUpdated
+ testFunc := func() {
+ event = NewEventMarketFeesUpdated(marketID)
+ }
+ require.NotPanics(t, testFunc, "NewEventMarketFeesUpdated(%d)", marketID)
assert.Equal(t, marketID, event.MarketId, "MarketId")
assertEverythingSet(t, event, "EventMarketFeesUpdated")
}
func TestNewEventParamsUpdated(t *testing.T) {
- event := NewEventParamsUpdated()
+ var event *EventParamsUpdated
+ testFunc := func() {
+ event = NewEventParamsUpdated()
+ }
+ require.NotPanics(t, testFunc, "NewEventParamsUpdated()")
assertEverythingSet(t, event, "EventParamsUpdated")
}
@@ -453,10 +600,11 @@ func TestTypedEventToEvent(t *testing.T) {
}{
{
name: "EventOrderCreated ask",
- tev: NewEventOrderCreated(NewOrder(1).WithAsk(&AskOrder{})),
+ tev: NewEventOrderCreated(NewOrder(1).WithAsk(&AskOrder{ExternalId: "stuff"})),
expEvent: sdk.Event{
Type: "provenance.exchange.v1.EventOrderCreated",
Attributes: []abci.EventAttribute{
+ {Key: []byte("external_id"), Value: quoteBz("stuff")},
{Key: []byte("order_id"), Value: quoteBz("1")},
{Key: []byte("order_type"), Value: quoteBz("ask")},
},
@@ -464,22 +612,36 @@ func TestTypedEventToEvent(t *testing.T) {
},
{
name: "EventOrderCreated bid",
- tev: NewEventOrderCreated(NewOrder(2).WithBid(&BidOrder{})),
+ tev: NewEventOrderCreated(NewOrder(2).WithBid(&BidOrder{ExternalId: "something else"})),
expEvent: sdk.Event{
Type: "provenance.exchange.v1.EventOrderCreated",
Attributes: []abci.EventAttribute{
+ {Key: []byte("external_id"), Value: quoteBz("something else")},
{Key: []byte("order_id"), Value: quoteBz("2")},
{Key: []byte("order_type"), Value: quoteBz("bid")},
},
},
},
{
- name: "EventOrderCancelled",
- tev: NewEventOrderCancelled(3, cancelledBy),
+ name: "EventOrderCancelled ask",
+ tev: NewEventOrderCancelled(NewOrder(3).WithAsk(&AskOrder{ExternalId: "outside 8"}), cancelledBy),
expEvent: sdk.Event{
Type: "provenance.exchange.v1.EventOrderCancelled",
Attributes: []abci.EventAttribute{
{Key: []byte("cancelled_by"), Value: cancelledByQ},
+ {Key: []byte("external_id"), Value: quoteBz("outside 8")},
+ {Key: []byte("order_id"), Value: quoteBz("3")},
+ },
+ },
+ },
+ {
+ name: "EventOrderCancelled bid",
+ tev: NewEventOrderCancelled(NewOrder(3).WithBid(&BidOrder{ExternalId: "outside 8"}), cancelledBy),
+ expEvent: sdk.Event{
+ Type: "provenance.exchange.v1.EventOrderCancelled",
+ Attributes: []abci.EventAttribute{
+ {Key: []byte("cancelled_by"), Value: cancelledByQ},
+ {Key: []byte("external_id"), Value: quoteBz("outside 8")},
{Key: []byte("order_id"), Value: quoteBz("3")},
},
},
@@ -490,11 +652,13 @@ func TestTypedEventToEvent(t *testing.T) {
Assets: acoin,
Price: pcoin,
SellerSettlementFlatFee: &fcoin,
+ ExternalId: "eeeeiiiiiddddd",
})),
expEvent: sdk.Event{
Type: "provenance.exchange.v1.EventOrderFilled",
Attributes: []abci.EventAttribute{
{Key: []byte("assets"), Value: acoinQ},
+ {Key: []byte("external_id"), Value: quoteBz("eeeeiiiiiddddd")},
{Key: []byte("fees"), Value: fcoinQ},
{Key: []byte("order_id"), Value: quoteBz("4")},
{Key: []byte("price"), Value: pcoinQ},
@@ -507,11 +671,13 @@ func TestTypedEventToEvent(t *testing.T) {
Assets: acoin,
Price: pcoin,
BuyerSettlementFees: sdk.Coins{fcoin},
+ ExternalId: "that one thing",
})),
expEvent: sdk.Event{
Type: "provenance.exchange.v1.EventOrderFilled",
Attributes: []abci.EventAttribute{
{Key: []byte("assets"), Value: acoinQ},
+ {Key: []byte("external_id"), Value: quoteBz("that one thing")},
{Key: []byte("fees"), Value: fcoinQ},
{Key: []byte("order_id"), Value: quoteBz("104")},
{Key: []byte("price"), Value: pcoinQ},
@@ -524,11 +690,13 @@ func TestTypedEventToEvent(t *testing.T) {
Assets: acoin,
Price: pcoin,
SellerSettlementFlatFee: &fcoin,
+ ExternalId: "12345",
})),
expEvent: sdk.Event{
Type: "provenance.exchange.v1.EventOrderPartiallyFilled",
Attributes: []abci.EventAttribute{
{Key: []byte("assets"), Value: acoinQ},
+ {Key: []byte("external_id"), Value: quoteBz("12345")},
{Key: []byte("fees"), Value: fcoinQ},
{Key: []byte("order_id"), Value: quoteBz("5")},
{Key: []byte("price"), Value: pcoinQ},
@@ -541,17 +709,41 @@ func TestTypedEventToEvent(t *testing.T) {
Assets: acoin,
Price: pcoin,
BuyerSettlementFees: sdk.Coins{fcoin},
+ ExternalId: "67890",
})),
expEvent: sdk.Event{
Type: "provenance.exchange.v1.EventOrderPartiallyFilled",
Attributes: []abci.EventAttribute{
{Key: []byte("assets"), Value: acoinQ},
+ {Key: []byte("external_id"), Value: quoteBz("67890")},
{Key: []byte("fees"), Value: fcoinQ},
{Key: []byte("order_id"), Value: quoteBz("5")},
{Key: []byte("price"), Value: pcoinQ},
},
},
},
+ {
+ name: "EventOrderExternalIDUpdated ask",
+ tev: NewEventOrderExternalIDUpdated(NewOrder(8).WithAsk(&AskOrder{ExternalId: "yellow"})),
+ expEvent: sdk.Event{
+ Type: "provenance.exchange.v1.EventOrderExternalIDUpdated",
+ Attributes: []abci.EventAttribute{
+ {Key: []byte("external_id"), Value: quoteBz("yellow")},
+ {Key: []byte("order_id"), Value: quoteBz("8")},
+ },
+ },
+ },
+ {
+ name: "EventOrderExternalIDUpdated bid",
+ tev: NewEventOrderExternalIDUpdated(NewOrder(8).WithBid(&BidOrder{ExternalId: "yellow"})),
+ expEvent: sdk.Event{
+ Type: "provenance.exchange.v1.EventOrderExternalIDUpdated",
+ Attributes: []abci.EventAttribute{
+ {Key: []byte("external_id"), Value: quoteBz("yellow")},
+ {Key: []byte("order_id"), Value: quoteBz("8")},
+ },
+ },
+ },
{
name: "EventMarketWithdraw",
tev: NewEventMarketWithdraw(6, coins1, destination, withdrawnBy),
diff --git a/x/exchange/fulfillment.go b/x/exchange/fulfillment.go
index c1d2b1181f..eb4c69cfdd 100644
--- a/x/exchange/fulfillment.go
+++ b/x/exchange/fulfillment.go
@@ -280,6 +280,11 @@ func (f orderFulfillment) PartialFillAllowed() bool {
return f.Order.PartialFillAllowed()
}
+// GetExternalID gets this fulfillment's external id.
+func (f orderFulfillment) GetExternalID() string {
+ return f.Order.GetExternalID()
+}
+
// GetOrderType gets this fulfillment's order's type string.
func (f orderFulfillment) GetOrderType() string {
return f.Order.GetOrderType()
diff --git a/x/exchange/fulfillment_test.go b/x/exchange/fulfillment_test.go
index 1b8e007781..cb4b94ba4b 100644
--- a/x/exchange/fulfillment_test.go
+++ b/x/exchange/fulfillment_test.go
@@ -166,11 +166,6 @@ func transferString(t *Transfer) string {
return fmt.Sprintf("T{Inputs:%s, Outputs: %s}", inputs, outputs)
}
-// transfersStringsLines creates a string for each transfer.
-func transfersStringsLines(ts []*Transfer) []string {
- return stringerLines(ts, transferString)
-}
-
// String converts a indexedAddrAmtsString to a string.
// This is mostly because test failure output of sdk.Coin and sdk.Coins is impossible to understand.
func indexedAddrAmtsString(i *indexedAddrAmts) string {
@@ -2520,6 +2515,43 @@ func TestOrderFulfillment_PartialFillAllowed(t *testing.T) {
}
}
+func TestOrderFulfillment_GetExternalID(t *testing.T) {
+ askOrder := func(externalID string) orderFulfillment {
+ return orderFulfillment{
+ Order: NewOrder(999).WithAsk(&AskOrder{ExternalId: externalID}),
+ }
+ }
+ bidOrder := func(externalID string) orderFulfillment {
+ return orderFulfillment{
+ Order: NewOrder(999).WithBid(&BidOrder{ExternalId: externalID}),
+ }
+ }
+
+ tests := []struct {
+ name string
+ f orderFulfillment
+ exp string
+ }{
+ {name: "ask empty", f: askOrder(""), exp: ""},
+ {name: "ask something", f: askOrder("something"), exp: "something"},
+ {name: "ask uuid", f: askOrder("5E50E61A-43E7-4C35-86BF-04040B49C1CB"), exp: "5E50E61A-43E7-4C35-86BF-04040B49C1CB"},
+ {name: "bid empty", f: bidOrder(""), exp: ""},
+ {name: "bid something", f: bidOrder("SOMETHING"), exp: "SOMETHING"},
+ {name: "bid uuid", f: bidOrder("1AD88BB9-86FA-42F1-A824-66AB27547904"), exp: "1AD88BB9-86FA-42F1-A824-66AB27547904"},
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ var actual string
+ testFunc := func() {
+ actual = tc.f.GetExternalID()
+ }
+ require.NotPanics(t, testFunc, "GetExternalID()")
+ assert.Equal(t, tc.exp, actual, "GetExternalID() result")
+ })
+ }
+}
+
func TestOrderFulfillment_GetOrderType(t *testing.T) {
tests := []struct {
name string
diff --git a/x/exchange/keeper/grpc_query.go b/x/exchange/keeper/grpc_query.go
index 7d1ba69434..a7177b9e81 100644
--- a/x/exchange/keeper/grpc_query.go
+++ b/x/exchange/keeper/grpc_query.go
@@ -88,6 +88,25 @@ func (k QueryServer) QueryGetOrder(goCtx context.Context, req *exchange.QueryGet
return &exchange.QueryGetOrderResponse{Order: order}, nil
}
+// QueryGetOrderByExternalID looks up an order by market id and external id.
+func (k QueryServer) QueryGetOrderByExternalID(goCtx context.Context, req *exchange.QueryGetOrderByExternalIDRequest) (*exchange.QueryGetOrderByExternalIDResponse, error) {
+ if req == nil {
+ return nil, status.Error(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ order, err := k.GetOrderByExternalID(ctx, req.MarketId, req.ExternalId)
+ if err != nil {
+ return nil, status.Error(codes.InvalidArgument, err.Error())
+ }
+ if order == nil {
+ return nil, status.Errorf(codes.InvalidArgument, "order not found in market %d with external id %q",
+ req.MarketId, req.ExternalId)
+ }
+
+ return &exchange.QueryGetOrderByExternalIDResponse{Order: order}, nil
+}
+
// QueryGetMarketOrders looks up the orders in a market.
func (k QueryServer) QueryGetMarketOrders(goCtx context.Context, req *exchange.QueryGetMarketOrdersRequest) (*exchange.QueryGetMarketOrdersResponse, error) {
if req == nil || req.MarketId == 0 {
diff --git a/x/exchange/keeper/grpc_query_test.go b/x/exchange/keeper/grpc_query_test.go
index 8c345f04b9..c78e483e08 100644
--- a/x/exchange/keeper/grpc_query_test.go
+++ b/x/exchange/keeper/grpc_query_test.go
@@ -1,11 +1,11 @@
package keeper_test
-// TODO[1658]: func (s *TestSuite) TestNewQueryServer()
-
// TODO[1658]: func (s *TestSuite) TestQueryServer_QueryOrderFeeCalc()
// TODO[1658]: func (s *TestSuite) TestQueryServer_QueryGetOrder()
+// TODO[1658]: func (s *TestSuite) TestQueryServer_QueryGetOrderByExternalID()
+
// TODO[1658]: func (s *TestSuite) TestQueryServer_QueryGetMarketOrders()
// TODO[1658]: func (s *TestSuite) TestQueryServer_QueryGetOwnerOrders()
diff --git a/x/exchange/keeper/keys.go b/x/exchange/keeper/keys.go
index 29760a938b..2af00d2028 100644
--- a/x/exchange/keeper/keys.go
+++ b/x/exchange/keeper/keys.go
@@ -68,6 +68,9 @@ import (
//
// An asset type to order index is maintained with the following format:
// 0x05 | | (8 bytes) =>
+//
+// A market external id to order index is maintained with the following format:
+// 0x09 | (4 bytes) | => (8 bytes)
const (
// KeyTypeParams is the type byte for params entries.
@@ -88,6 +91,8 @@ const (
KeyTypeAddressToOrderIndex = byte(0x04)
// KeyTypeAssetToOrderIndex is the type byte for entries in the asset to order index.
KeyTypeAssetToOrderIndex = byte(0x05)
+ // KeyTypeMarketExternalIDToOrderIndex is the type byte for entries in the market and uuid to order index.
+ KeyTypeMarketExternalIDToOrderIndex = byte(0x09)
// MarketKeyTypeCreateAskFlat is the market-specific type byte for the create-ask flat fees.
MarketKeyTypeCreateAskFlat = byte(0x00)
@@ -724,3 +729,16 @@ func ParseIndexKeyAssetToOrder(key []byte) (string, uint64, error) {
}
return denom, orderID, nil
}
+
+// MakeIndexKeyMarketExternalIDToOrder creates the key to use for the market and uuid to order index for the provided values.
+func MakeIndexKeyMarketExternalIDToOrder(marketID uint32, externalID string) []byte {
+ if len(externalID) == 0 {
+ panic(errors.New("cannot create market external id to order index with empty external id"))
+ }
+ if err := exchange.ValidateExternalID(externalID); err != nil {
+ panic(fmt.Errorf("cannot create market external id to order index: %w", err))
+ }
+ rv := prepKey(KeyTypeMarketExternalIDToOrderIndex, uint32Bz(marketID), len(externalID))
+ rv = append(rv, externalID...)
+ return rv
+}
diff --git a/x/exchange/keeper/keys_test.go b/x/exchange/keeper/keys_test.go
index 51b5bc13f3..b329a423ab 100644
--- a/x/exchange/keeper/keys_test.go
+++ b/x/exchange/keeper/keys_test.go
@@ -2,6 +2,7 @@ package keeper_test
import (
"bytes"
+ "strings"
"testing"
"github.com/stretchr/testify/assert"
@@ -96,6 +97,7 @@ func TestKeyTypeUniqueness(t *testing.T) {
{name: "KeyTypeMarketToOrderIndex", value: keeper.KeyTypeMarketToOrderIndex},
{name: "KeyTypeAddressToOrderIndex", value: keeper.KeyTypeAddressToOrderIndex},
{name: "KeyTypeAssetToOrderIndex", value: keeper.KeyTypeAssetToOrderIndex},
+ {name: "KeyTypeMarketExternalIDToOrderIndex", value: keeper.KeyTypeMarketExternalIDToOrderIndex},
},
},
{
@@ -3728,3 +3730,68 @@ func TestParseIndexKeyAssetToOrder(t *testing.T) {
})
}
}
+
+func TestMakeIndexKeyMarketExternalIDToOrder(t *testing.T) {
+ tests := []struct {
+ name string
+ marketID uint32
+ externalID string
+ expected []byte
+ expPanic string
+ }{
+ {
+ name: "empty external id",
+ marketID: 1,
+ externalID: "",
+ expPanic: "cannot create market external id to order index with empty external id",
+ },
+ {
+ name: "41 char external id",
+ marketID: 2,
+ externalID: "This id has forty-one chars. That's long!",
+ expPanic: "cannot create market external id to order index: invalid external id " +
+ "\"This id has forty-one chars. That's long!\": max length 40",
+ },
+ {
+ name: "market 0, a zeroed uuid",
+ marketID: 0,
+ externalID: "00000000-0000-0000-0000-000000000000",
+ expected: append([]byte{keeper.KeyTypeMarketExternalIDToOrderIndex, 0, 0, 0, 0},
+ "00000000-0000-0000-0000-000000000000"...),
+ },
+ {
+ name: "market 1, random uuid",
+ marketID: 1,
+ externalID: "814348F5-DE62-4954-81D1-65874E37C0BE",
+ expected: append([]byte{keeper.KeyTypeMarketExternalIDToOrderIndex, 0, 0, 0, 1},
+ "814348F5-DE62-4954-81D1-65874E37C0BE"...),
+ },
+ {
+ name: "market 67,305,985, a wierd external id",
+ marketID: 67_305_985,
+ externalID: "ThisIsWierd",
+ expected: append([]byte{keeper.KeyTypeMarketExternalIDToOrderIndex, 4, 3, 2, 1}, "ThisIsWierd"...),
+ },
+ {
+ name: "max market id and lots of Zs",
+ marketID: 4_294_967_295,
+ externalID: strings.Repeat("Z", 40),
+ expected: append([]byte{keeper.KeyTypeMarketExternalIDToOrderIndex, 255, 255, 255, 255},
+ strings.Repeat("Z", 40)...),
+ },
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ ktc := keyTestCase{
+ maker: func() []byte {
+ return keeper.MakeIndexKeyMarketExternalIDToOrder(tc.marketID, tc.externalID)
+ },
+ expected: tc.expected,
+ expPanic: tc.expPanic,
+ }
+
+ checkKey(t, ktc, "MakeIndexKeyMarketExternalIDToOrder(%d, %v)", tc.marketID, tc.externalID)
+ })
+ }
+}
diff --git a/x/exchange/keeper/market.go b/x/exchange/keeper/market.go
index 5aad8a9c08..16459ac13e 100644
--- a/x/exchange/keeper/market.go
+++ b/x/exchange/keeper/market.go
@@ -833,6 +833,12 @@ func (k Keeper) CanSettleOrders(ctx sdk.Context, marketID uint32, admin string)
return k.HasPermission(ctx, marketID, admin, exchange.Permission_settle)
}
+// CanSetIDs returns true if the provided admin bech32 address has permission to
+// set UUIDs on orders for a market. Also returns true if the provided address is the authority address.
+func (k Keeper) CanSetIDs(ctx sdk.Context, marketID uint32, admin string) bool {
+ return k.HasPermission(ctx, marketID, admin, exchange.Permission_set_ids)
+}
+
// CanCancelOrdersForMarket returns true if the provided admin bech32 address has permission to
// cancel orders for a market. Also returns true if the provided address is the authority address.
func (k Keeper) CanCancelOrdersForMarket(ctx sdk.Context, marketID uint32, admin string) bool {
diff --git a/x/exchange/keeper/market_test.go b/x/exchange/keeper/market_test.go
index b50542ba0e..c71d155bf3 100644
--- a/x/exchange/keeper/market_test.go
+++ b/x/exchange/keeper/market_test.go
@@ -42,6 +42,8 @@ package keeper_test
// TODO[1658]: func (s *TestSuite) TestKeeper_CanSettleOrders()
+// TODO[1658]: func (s *TestSuite) TestKeeper_CanSetIDs()
+
// TODO[1658]: func (s *TestSuite) TestKeeper_CanCancelOrdersForMarket()
// TODO[1658]: func (s *TestSuite) TestKeeper_CanWithdrawMarketFunds()
diff --git a/x/exchange/keeper/msg_server.go b/x/exchange/keeper/msg_server.go
index 50ac8b9096..16c5756736 100644
--- a/x/exchange/keeper/msg_server.go
+++ b/x/exchange/keeper/msg_server.go
@@ -90,6 +90,19 @@ func (k MsgServer) MarketSettle(goCtx context.Context, msg *exchange.MsgMarketSe
return &exchange.MsgMarketSettleResponse{}, nil
}
+// MarketSetOrderExternalID updates an order's external id field.
+func (k MsgServer) MarketSetOrderExternalID(goCtx context.Context, msg *exchange.MsgMarketSetOrderExternalIDRequest) (*exchange.MsgMarketSetOrderExternalIDResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+ if !k.CanSetIDs(ctx, msg.MarketId, msg.Admin) {
+ return nil, permError("set uuids on orders for", msg.Admin, msg.MarketId)
+ }
+ err := k.SetOrderExternalID(ctx, msg.MarketId, msg.OrderId, msg.ExternalId)
+ if err != nil {
+ return nil, sdkerrors.ErrInvalidRequest.Wrap(err.Error())
+ }
+ return &exchange.MsgMarketSetOrderExternalIDResponse{}, nil
+}
+
// MarketWithdraw is a market endpoint to withdraw fees that have been collected.
func (k MsgServer) MarketWithdraw(goCtx context.Context, msg *exchange.MsgMarketWithdrawRequest) (*exchange.MsgMarketWithdrawResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
diff --git a/x/exchange/keeper/msg_server_test.go b/x/exchange/keeper/msg_server_test.go
index 77e9b49ce0..73ed058097 100644
--- a/x/exchange/keeper/msg_server_test.go
+++ b/x/exchange/keeper/msg_server_test.go
@@ -14,6 +14,8 @@ package keeper_test
// TODO[1658]: func (s *TestSuite) TestMsgServer_MarketSettle()
+// TODO[1658]: func (s *TestSuite) TestMsgServer_MarketSetOrderExternalID()
+
// TODO[1658]: func (s *TestSuite) TestMsgServer_MarketWithdraw()
// TODO[1658]: func (s *TestSuite) TestMsgServer_MarketUpdateDetails()
diff --git a/x/exchange/keeper/orders.go b/x/exchange/keeper/orders.go
index a85ed3b7e6..5f20e1a2df 100644
--- a/x/exchange/keeper/orders.go
+++ b/x/exchange/keeper/orders.go
@@ -112,8 +112,9 @@ func (k Keeper) parseOrderStoreKeyValue(key, value []byte) (*exchange.Order, err
return k.parseOrderStoreValue(orderID, value)
}
-// createIndexEntries creates all the key/value index entries for an order.
-func createIndexEntries(order exchange.Order) []sdk.KVPair {
+// createConstantIndexEntries creates all the key/value index entries for an order that don't change.
+// See also: createMarketExternalIDToOrderEntry.
+func createConstantIndexEntries(order exchange.Order) []sdk.KVPair {
marketID := order.GetMarketID()
orderID := order.GetOrderID()
orderTypeByte := order.GetOrderTypeByte()
@@ -137,6 +138,19 @@ func createIndexEntries(order exchange.Order) []sdk.KVPair {
}
}
+// createMarketExternalIDToOrderEntry creates the market external id to order store entry.
+// See also createConstantIndexEntries
+func createMarketExternalIDToOrderEntry(order exchange.OrderI) *sdk.KVPair {
+ externalID := order.GetExternalID()
+ if len(externalID) == 0 {
+ return nil
+ }
+ return &sdk.KVPair{
+ Key: MakeIndexKeyMarketExternalIDToOrder(order.GetMarketID(), externalID),
+ Value: uint64Bz(order.GetOrderID()),
+ }
+}
+
// getOrderFromStore looks up an order from the store. Returns nil, nil if the order does not exist.
func (k Keeper) getOrderFromStore(store sdk.KVStore, orderID uint64) (*exchange.Order, error) {
key := MakeKeyOrder(orderID)
@@ -157,17 +171,29 @@ func (k Keeper) setOrderInStore(store sdk.KVStore, order exchange.Order) error {
if err != nil {
return fmt.Errorf("failed to create order %d store key/value: %w", order.GetOrderID(), err)
}
+
+ externalIDEntry := createMarketExternalIDToOrderEntry(order)
+ if externalIDEntry != nil && store.Has(externalIDEntry.Key) {
+ orderIDBz := store.Get(externalIDEntry.Value)
+ otherOrderID, ok := uint64FromBz(orderIDBz)
+ if ok && otherOrderID != order.GetOrderID() {
+ return fmt.Errorf("external id %q is already in use by order %d: cannot be used for order %d",
+ order.GetExternalID(), otherOrderID, order.GetOrderID())
+ }
+ }
+
isUpdate := store.Has(key)
store.Set(key, value)
+
if !isUpdate {
- indexEntries := createIndexEntries(order)
+ indexEntries := createConstantIndexEntries(order)
for _, entry := range indexEntries {
store.Set(entry.Key, entry.Value)
}
- // It is assumed that these index entries cannot change over the life of an order.
- // The only change that is allowed to an order is the assets (due to partial fulfillment).
- // Partial fulfillment is only allowed when there's a single asset type (denom), though.
- // That's why no attempt is made in here to update index entries when the order already exists.
+ }
+
+ if externalIDEntry != nil {
+ store.Set(externalIDEntry.Key, externalIDEntry.Value)
}
return nil
}
@@ -176,10 +202,14 @@ func (k Keeper) setOrderInStore(store sdk.KVStore, order exchange.Order) error {
func deleteAndDeIndexOrder(store sdk.KVStore, order exchange.Order) {
key := MakeKeyOrder(order.OrderId)
store.Delete(key)
- indexEntries := createIndexEntries(order)
+ indexEntries := createConstantIndexEntries(order)
for _, entry := range indexEntries {
store.Delete(entry.Key)
}
+ externalIDEntry := createMarketExternalIDToOrderEntry(order)
+ if externalIDEntry != nil {
+ store.Delete(externalIDEntry.Key)
+ }
}
// iterateOrderIndex iterates over a -to-order index with keys that have the provided prefixBz.
@@ -562,6 +592,26 @@ func (k Keeper) GetOrder(ctx sdk.Context, orderID uint64) (*exchange.Order, erro
return k.getOrderFromStore(k.getStore(ctx), orderID)
}
+// GetOrderByExternalID gets an order by its market id and UUID.
+func (k Keeper) GetOrderByExternalID(ctx sdk.Context, marketID uint32, externalID string) (*exchange.Order, error) {
+ if marketID == 0 {
+ return nil, errors.New("invalid market id: cannot be zero")
+ }
+ if len(externalID) == 0 || len(externalID) > exchange.MaxExternalIDLength {
+ return nil, nil
+ }
+
+ store := k.getStore(ctx)
+ key := MakeIndexKeyMarketExternalIDToOrder(marketID, externalID)
+ orderIDBz := store.Get(key)
+ orderID, ok := uint64FromBz(orderIDBz)
+ if !ok {
+ return nil, nil
+ }
+
+ return k.getOrderFromStore(store, orderID)
+}
+
// CreateAskOrder creates an ask order, collects the creation fee, and places all needed holds.
func (k Keeper) CreateAskOrder(ctx sdk.Context, askOrder exchange.AskOrder, creationFee *sdk.Coin) (uint64, error) {
if err := askOrder.Validate(); err != nil {
@@ -671,8 +721,56 @@ func (k Keeper) CancelOrder(ctx sdk.Context, orderID uint64, signer string) erro
}
deleteAndDeIndexOrder(k.getStore(ctx), *order)
- k.emitEvent(ctx, exchange.NewEventOrderCancelled(orderID, signerAddr))
+ k.emitEvent(ctx, exchange.NewEventOrderCancelled(order, signerAddr))
+
+ return nil
+}
+
+// SetOrderExternalID updates an order's external id.
+func (k Keeper) SetOrderExternalID(ctx sdk.Context, marketID uint32, orderID uint64, newExternalID string) error {
+ if err := exchange.ValidateExternalID(newExternalID); err != nil {
+ return err
+ }
+
+ store := k.getStore(ctx)
+ order, err := k.getOrderFromStore(store, orderID)
+ if err != nil {
+ return err
+ }
+ if order == nil {
+ return fmt.Errorf("order %d not found", orderID)
+ }
+
+ orderMarketID := order.GetMarketID()
+ if marketID != orderMarketID {
+ return fmt.Errorf("order %d has market id %d, expected %d", orderID, orderMarketID, marketID)
+ }
+
+ orderExternalID := order.GetExternalID()
+ if orderExternalID == newExternalID {
+ return fmt.Errorf("order %d already has external id %q", orderID, orderExternalID)
+ }
+
+ switch {
+ case order.IsAskOrder():
+ order.GetAskOrder().ExternalId = newExternalID
+ case order.IsBidOrder():
+ order.GetBidOrder().ExternalId = newExternalID
+ default:
+ return fmt.Errorf("order %d has unexpected type %s", orderID, order.GetOrderType())
+ }
+
+ if len(orderExternalID) > 0 {
+ oldIDIndex := MakeIndexKeyMarketExternalIDToOrder(orderMarketID, orderExternalID)
+ store.Delete(oldIDIndex)
+ }
+
+ err = k.setOrderInStore(store, *order)
+ if err != nil {
+ return err
+ }
+ k.emitEvent(ctx, exchange.NewEventOrderExternalIDUpdated(order))
return nil
}
diff --git a/x/exchange/keeper/orders_test.go b/x/exchange/keeper/orders_test.go
index f254497902..9e07d297e8 100644
--- a/x/exchange/keeper/orders_test.go
+++ b/x/exchange/keeper/orders_test.go
@@ -2,12 +2,16 @@ package keeper_test
// TODO[1658]: func (s *TestSuite) TestKeeper_GetOrder()
+// TODO[1658]: func (s *TestSuite) TestKeeper_GetOrderByExternalID()
+
// TODO[1658]: func (s *TestSuite) TestKeeper_CreateAskOrder()
// TODO[1658]: func (s *TestSuite) TestKeeper_CreateBidOrder()
// TODO[1658]: func (s *TestSuite) TestKeeper_CancelOrder()
+// TODO[1658]: func (s *TestSuite) TestKeeper_SetOrderExternalID()
+
// TODO[1658]: func (s *TestSuite) TestKeeper_IterateOrders()
// TODO[1658]: func (s *TestSuite) TestKeeper_IterateMarketOrders()
diff --git a/x/exchange/market.go b/x/exchange/market.go
index ff9cd863bf..5e9a5e245d 100644
--- a/x/exchange/market.go
+++ b/x/exchange/market.go
@@ -506,16 +506,15 @@ func AllPermissions() []Permission {
// Example inputs: "settle", "CanCel", "WITHDRAW", "permission_update", "PermISSion_PErmissioNs", "PERMISSION_ATTRIBUTES"
func ParsePermission(permission string) (Permission, error) {
permUC := strings.ToUpper(strings.TrimSpace(permission))
- val, found := Permission_value["PERMISSION_"+permUC]
- if found {
- if val != 0 {
- return Permission(val), nil
- }
- } else {
- val, found = Permission_value[permUC]
- if found && val != 0 {
- return Permission(val), nil
- }
+ if !strings.HasPrefix(permUC, "PERMISSION_") {
+ permUC = "PERMISSION_" + permUC
+ }
+ if val, found := Permission_value[permUC]; found && val != int32(Permission_unspecified) {
+ return Permission(val), nil
+ }
+ // special case to allow the underscore to be optional in "set_ids".
+ if permUC == "PERMISSION_SETIDS" {
+ return Permission_set_ids, nil
}
return Permission_unspecified, fmt.Errorf("invalid permission: %q", permission)
}
diff --git a/x/exchange/market.pb.go b/x/exchange/market.pb.go
index 2121da6eb0..1fbb6cf1d8 100644
--- a/x/exchange/market.pb.go
+++ b/x/exchange/market.pb.go
@@ -34,36 +34,40 @@ const (
Permission_unspecified Permission = 0
// PERMISSION_SETTLE is the ability to use the Settle Tx endpoint on behalf of a market.
Permission_settle Permission = 1
+ // PERMISSION_SET_IDS is the ability to use the SetOrderExternalID Tx endpoint on behalf of a market.
+ Permission_set_ids Permission = 2
// PERMISSION_CANCEL is the ability to use the Cancel Tx endpoint on behalf of a market.
- Permission_cancel Permission = 2
+ Permission_cancel Permission = 3
// PERMISSION_WITHDRAW is the ability to use the MarketWithdraw Tx endpoint.
- Permission_withdraw Permission = 3
+ Permission_withdraw Permission = 4
// PERMISSION_UPDATE is the ability to use the MarketUpdate* Tx endpoints.
- Permission_update Permission = 4
+ Permission_update Permission = 5
// PERMISSION_PERMISSIONS is the ability to use the MarketManagePermissions Tx endpoint.
- Permission_permissions Permission = 5
+ Permission_permissions Permission = 6
// PERMISSION_ATTRIBUTES is the ability to use the MarketManageReqAttrs Tx endpoint.
- Permission_attributes Permission = 6
+ Permission_attributes Permission = 7
)
var Permission_name = map[int32]string{
0: "PERMISSION_UNSPECIFIED",
1: "PERMISSION_SETTLE",
- 2: "PERMISSION_CANCEL",
- 3: "PERMISSION_WITHDRAW",
- 4: "PERMISSION_UPDATE",
- 5: "PERMISSION_PERMISSIONS",
- 6: "PERMISSION_ATTRIBUTES",
+ 2: "PERMISSION_SET_IDS",
+ 3: "PERMISSION_CANCEL",
+ 4: "PERMISSION_WITHDRAW",
+ 5: "PERMISSION_UPDATE",
+ 6: "PERMISSION_PERMISSIONS",
+ 7: "PERMISSION_ATTRIBUTES",
}
var Permission_value = map[string]int32{
"PERMISSION_UNSPECIFIED": 0,
"PERMISSION_SETTLE": 1,
- "PERMISSION_CANCEL": 2,
- "PERMISSION_WITHDRAW": 3,
- "PERMISSION_UPDATE": 4,
- "PERMISSION_PERMISSIONS": 5,
- "PERMISSION_ATTRIBUTES": 6,
+ "PERMISSION_SET_IDS": 2,
+ "PERMISSION_CANCEL": 3,
+ "PERMISSION_WITHDRAW": 4,
+ "PERMISSION_UPDATE": 5,
+ "PERMISSION_PERMISSIONS": 6,
+ "PERMISSION_ATTRIBUTES": 7,
}
func (x Permission) String() string {
@@ -555,70 +559,71 @@ func init() {
}
var fileDescriptor_d5cf198f1dd7e167 = []byte{
- // 1001 bytes of a gzipped FileDescriptorProto
+ // 1022 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x6f, 0x1a, 0x47,
- 0x14, 0x66, 0x0d, 0xb6, 0x61, 0xb0, 0x1d, 0x3a, 0x4e, 0xdc, 0x35, 0xa9, 0x60, 0x4b, 0x14, 0x89,
- 0xb4, 0x32, 0xc8, 0xae, 0x7a, 0xf1, 0xa5, 0x02, 0x1b, 0xb7, 0x48, 0x89, 0x83, 0x16, 0x50, 0xa4,
- 0xa8, 0xd2, 0x6a, 0xd8, 0x7d, 0xe0, 0x91, 0x97, 0x5d, 0x32, 0x33, 0xd8, 0x69, 0xff, 0x40, 0x2b,
- 0x9f, 0x7a, 0xec, 0xc5, 0x92, 0xfb, 0x0f, 0x7a, 0xe8, 0xbd, 0xd7, 0x1c, 0xad, 0x4a, 0x95, 0x7a,
- 0x8a, 0x2a, 0xfb, 0xd2, 0x9f, 0x51, 0xed, 0xcc, 0xb2, 0x6c, 0x08, 0xae, 0x13, 0x55, 0xb9, 0xcd,
- 0x7b, 0xdf, 0x37, 0xdf, 0xfb, 0xde, 0xe3, 0x31, 0x5a, 0xf4, 0x60, 0xc4, 0xfc, 0x13, 0xf0, 0x88,
- 0x67, 0x43, 0x15, 0x5e, 0xda, 0x47, 0xc4, 0x1b, 0x40, 0xf5, 0x64, 0xbb, 0x3a, 0x24, 0xec, 0x18,
- 0x44, 0x65, 0xc4, 0x7c, 0xe1, 0xe3, 0x8d, 0x29, 0xa9, 0x32, 0x21, 0x55, 0x4e, 0xb6, 0xf3, 0x05,
- 0xdb, 0xe7, 0x43, 0x9f, 0x57, 0xc9, 0x58, 0x1c, 0x55, 0x4f, 0xb6, 0x7b, 0x20, 0xc8, 0xb6, 0x0c,
- 0xd4, 0xbd, 0x08, 0xef, 0x11, 0x0e, 0x11, 0x6e, 0xfb, 0xd4, 0x0b, 0xf1, 0x4d,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, 0x17, 0xe5, 0x3e, 0x15, 0x47, 0xa3, 0x6e, 0xd9, 0xf6, 0x07, 0x95, 0x29,
+ 0x69, 0x8b, 0xfa, 0xb1, 0x53, 0xe5, 0xd5, 0xe4, 0x5f, 0x52, 0x77, 0x49, 0xfe, 0x27, 0xf9, 0xe2,
+ 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x2e, 0x9b, 0x71, 0x43, 0x09, 0x00, 0x00,
}
func (this *MarketDetails) Equal(that interface{}) bool {
diff --git a/x/exchange/market_test.go b/x/exchange/market_test.go
index f230a9c273..f4c61ff317 100644
--- a/x/exchange/market_test.go
+++ b/x/exchange/market_test.go
@@ -2843,6 +2843,11 @@ func TestPermission_Validate(t *testing.T) {
p: Permission_settle,
exp: "",
},
+ {
+ name: "set_ids",
+ p: Permission_set_ids,
+ exp: "",
+ },
{
name: "cancel",
p: Permission_cancel,
@@ -2911,6 +2916,7 @@ func TestPermission_Validate(t *testing.T) {
func TestAllPermissions(t *testing.T) {
expected := []Permission{
Permission_settle,
+ Permission_set_ids,
Permission_cancel,
Permission_withdraw,
Permission_update,
@@ -2938,6 +2944,25 @@ func TestParsePermission(t *testing.T) {
{permission: "PERMISSION_SETTLE", expected: Permission_settle},
{permission: "pERmiSSion_seTTle", expected: Permission_settle},
+ // Permission_set_ids
+ {permission: "set_ids", expected: Permission_set_ids},
+ {permission: " set_ids", expected: Permission_set_ids},
+ {permission: "set_ids ", expected: Permission_set_ids},
+ {permission: "SET_IDS", expected: Permission_set_ids},
+ {permission: "Set_Ids", expected: Permission_set_ids},
+ {permission: "setids", expected: Permission_set_ids},
+ {permission: "setids ", expected: Permission_set_ids},
+ {permission: " setids", expected: Permission_set_ids},
+ {permission: "setIds", expected: Permission_set_ids},
+ {permission: "SetIds", expected: Permission_set_ids},
+ {permission: "SETIDS", expected: Permission_set_ids},
+ {permission: "permission_set_ids", expected: Permission_set_ids},
+ {permission: "PERMISSION_SET_IDS", expected: Permission_set_ids},
+ {permission: "peRMissiOn_sEt_iDs", expected: Permission_set_ids},
+ {permission: "permission_setids", expected: Permission_set_ids},
+ {permission: "PERMISSION_SETIDS", expected: Permission_set_ids},
+ {permission: "peRMissiOn_sEtiDs", expected: Permission_set_ids},
+
// Permission_cancel
{permission: "cancel", expected: Permission_cancel},
{permission: " cancel", expected: Permission_cancel},
diff --git a/x/exchange/msg.go b/x/exchange/msg.go
index 5efbd00166..1f4e0c81a9 100644
--- a/x/exchange/msg.go
+++ b/x/exchange/msg.go
@@ -14,6 +14,7 @@ var allRequestMsgs = []sdk.Msg{
(*MsgFillBidsRequest)(nil),
(*MsgFillAsksRequest)(nil),
(*MsgMarketSettleRequest)(nil),
+ (*MsgMarketSetOrderExternalIDRequest)(nil),
(*MsgMarketWithdrawRequest)(nil),
(*MsgMarketUpdateDetailsRequest)(nil),
(*MsgMarketUpdateEnabledRequest)(nil),
@@ -196,6 +197,33 @@ func (m MsgMarketSettleRequest) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{addr}
}
+func (m MsgMarketSetOrderExternalIDRequest) ValidateBasic() error {
+ var errs []error
+
+ if _, err := sdk.AccAddressFromBech32(m.Admin); err != nil {
+ errs = append(errs, fmt.Errorf("invalid administrator %q: %w", m.Admin, err))
+ }
+
+ if m.MarketId == 0 {
+ errs = append(errs, errors.New("invalid market id: cannot be zero"))
+ }
+
+ if err := ValidateExternalID(m.ExternalId); err != nil {
+ errs = append(errs, err)
+ }
+
+ if m.OrderId == 0 {
+ errs = append(errs, errors.New("invalid order id: cannot be zero"))
+ }
+
+ return errors.Join(errs...)
+}
+
+func (m MsgMarketSetOrderExternalIDRequest) GetSigners() []sdk.AccAddress {
+ addr := sdk.MustAccAddressFromBech32(m.Admin)
+ return []sdk.AccAddress{addr}
+}
+
func (m MsgMarketWithdrawRequest) ValidateBasic() error {
var errs []error
diff --git a/x/exchange/msg_test.go b/x/exchange/msg_test.go
index bfa473d6ff..03c4fa953c 100644
--- a/x/exchange/msg_test.go
+++ b/x/exchange/msg_test.go
@@ -53,6 +53,9 @@ func TestAllMsgsGetSigners(t *testing.T) {
func(signer string) sdk.Msg {
return &MsgMarketSettleRequest{Admin: signer}
},
+ func(signer string) sdk.Msg {
+ return &MsgMarketSetOrderExternalIDRequest{Admin: signer}
+ },
func(signer string) sdk.Msg {
return &MsgMarketWithdrawRequest{Admin: signer}
},
@@ -779,6 +782,122 @@ func TestMsgMarketSettleRequest_ValidateBasic(t *testing.T) {
}
}
+func TestMsgMarketSetOrderExternalIDRequest_ValidateBasic(t *testing.T) {
+ admin := sdk.AccAddress("admin_address_______").String()
+
+ tests := []struct {
+ name string
+ msg MsgMarketSetOrderExternalIDRequest
+ expErr []string
+ }{
+ {
+ name: "control",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: admin,
+ MarketId: 5,
+ OrderId: 12,
+ ExternalId: "twenty-eight",
+ },
+ expErr: nil,
+ },
+ {
+ name: "no admin",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: "",
+ MarketId: 5,
+ OrderId: 12,
+ ExternalId: "twenty-eight",
+ },
+ expErr: []string{"invalid administrator \"\"", emptyAddrErr},
+ },
+ {
+ name: "bad admin",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: "badadmin",
+ MarketId: 5,
+ OrderId: 12,
+ ExternalId: "twenty-eight",
+ },
+ expErr: []string{"invalid administrator \"badadmin\"", bech32Err},
+ },
+ {
+ name: "market zero",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: admin,
+ MarketId: 0,
+ OrderId: 12,
+ ExternalId: "twenty-eight",
+ },
+ expErr: []string{"invalid market id: cannot be zero"},
+ },
+ {
+ name: "empty external id",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: admin,
+ MarketId: 5,
+ OrderId: 12,
+ ExternalId: "",
+ },
+ expErr: nil,
+ },
+ {
+ name: "external id at max length",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: admin,
+ MarketId: 5,
+ OrderId: 12,
+ ExternalId: strings.Repeat("y", MaxExternalIDLength),
+ },
+ expErr: nil,
+ },
+ {
+ name: "external id more than max length",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: admin,
+ MarketId: 5,
+ OrderId: 12,
+ ExternalId: strings.Repeat("r", MaxExternalIDLength+1),
+ },
+ expErr: []string{
+ fmt.Sprintf("invalid external id %q: max length %d",
+ strings.Repeat("r", MaxExternalIDLength+1), MaxExternalIDLength),
+ },
+ },
+ {
+ name: "order zero",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: admin,
+ MarketId: 5,
+ OrderId: 0,
+ ExternalId: "twenty-eight",
+ },
+ expErr: []string{"invalid order id: cannot be zero"},
+ },
+ {
+ name: "multiple errors",
+ msg: MsgMarketSetOrderExternalIDRequest{
+ Admin: "",
+ MarketId: 0,
+ OrderId: 0,
+ ExternalId: strings.Repeat("V", MaxExternalIDLength+1),
+ },
+ expErr: []string{
+ "invalid administrator \"\"", emptyAddrErr,
+ "invalid market id: cannot be zero",
+ fmt.Sprintf("invalid external id %q: max length %d",
+ strings.Repeat("V", MaxExternalIDLength+1), MaxExternalIDLength),
+ "invalid order id: cannot be zero",
+ },
+ },
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ testValidateBasic(t, &tc.msg, tc.expErr)
+ })
+ }
+}
+
func TestMsgMarketWithdrawRequest_ValidateBasic(t *testing.T) {
coin := func(amount int64, denom string) sdk.Coin {
return sdk.Coin{Denom: denom, Amount: sdkmath.NewInt(amount)}
diff --git a/x/exchange/orders.go b/x/exchange/orders.go
index 74e1877377..5a014bffc1 100644
--- a/x/exchange/orders.go
+++ b/x/exchange/orders.go
@@ -19,6 +19,8 @@ const (
OrderTypeByteBid = byte(0x01)
)
+const MaxExternalIDLength = 40
+
// SubOrderI is an interface with getters for the fields in a sub-order (i.e. AskOrder or BidOrder).
type SubOrderI interface {
GetMarketID() uint32
@@ -27,6 +29,7 @@ type SubOrderI interface {
GetPrice() sdk.Coin
GetSettlementFees() sdk.Coins
PartialFillAllowed() bool
+ GetExternalID() string
GetOrderType() string
GetOrderTypeByte() byte
GetHoldAmount() sdk.Coins
@@ -90,6 +93,14 @@ func ValidateOrderIDs(field string, orderIDs []uint64) error {
return nil
}
+// ValidateExternalID makes sure an external id is okay.
+func ValidateExternalID(externalID string) error {
+ if len(externalID) > MaxExternalIDLength {
+ return fmt.Errorf("invalid external id %q: max length %d", externalID, MaxExternalIDLength)
+ }
+ return nil
+}
+
// NewOrder creates a new empty Order with the provided order id.
// The order details are set using one of: WithAsk, WithBid.
func NewOrder(orderID uint64) *Order {
@@ -182,6 +193,11 @@ func (o Order) PartialFillAllowed() bool {
return o.MustGetSubOrder().PartialFillAllowed()
}
+// GetUUID returns this order's UUID.
+func (o Order) GetExternalID() string {
+ return o.MustGetSubOrder().GetExternalID()
+}
+
// GetOrderType returns a string indicating what type this order is.
// E.g: OrderTypeAsk or OrderTypeBid
func (o Order) GetOrderType() string {
@@ -327,6 +343,11 @@ func (a AskOrder) PartialFillAllowed() bool {
return a.AllowPartial
}
+// GetExternalID returns this ask order's external id.
+func (a AskOrder) GetExternalID() string {
+ return a.ExternalId
+}
+
// GetOrderType returns the order type string for this ask order: "ask".
func (a AskOrder) GetOrderType() string {
return OrderTypeAsk
@@ -386,6 +407,10 @@ func (a AskOrder) Validate() error {
// Nothing to check on the AllowPartial boolean.
+ if err := ValidateExternalID(a.ExternalId); err != nil {
+ errs = append(errs, err)
+ }
+
return errors.Join(errs...)
}
@@ -398,6 +423,7 @@ func (a AskOrder) CopyChange(newAssets, newPrice sdk.Coin, newFee *sdk.Coin) *As
Price: newPrice,
SellerSettlementFlatFee: newFee,
AllowPartial: a.AllowPartial,
+ ExternalId: a.ExternalId,
}
}
@@ -431,6 +457,11 @@ func (b BidOrder) PartialFillAllowed() bool {
return b.AllowPartial
}
+// GetExternalID returns this bid order's external id.
+func (b BidOrder) GetExternalID() string {
+ return b.ExternalId
+}
+
// GetOrderType returns the order type string for this bid order: "bid".
func (b BidOrder) GetOrderType() string {
return OrderTypeBid
@@ -482,6 +513,10 @@ func (b BidOrder) Validate() error {
// Nothing to check on the AllowPartial boolean.
+ if err := ValidateExternalID(b.ExternalId); err != nil {
+ errs = append(errs, err)
+ }
+
return errors.Join(errs...)
}
@@ -494,6 +529,7 @@ func (b BidOrder) CopyChange(newAssets, newPrice sdk.Coin, newFees sdk.Coins) *B
Price: newPrice,
BuyerSettlementFees: newFees,
AllowPartial: b.AllowPartial,
+ ExternalId: b.ExternalId,
}
}
@@ -576,6 +612,11 @@ func (o FilledOrder) PartialFillAllowed() bool {
return o.order.PartialFillAllowed()
}
+// GetExternalID returns this order's external id.
+func (o FilledOrder) GetExternalID() string {
+ return o.order.GetExternalID()
+}
+
// GetOrderType returns a string indicating what type this order is.
// E.g: OrderTypeAsk or OrderTypeBid
func (o FilledOrder) GetOrderType() string {
diff --git a/x/exchange/orders.pb.go b/x/exchange/orders.pb.go
index 606965dab3..3598427aa7 100644
--- a/x/exchange/orders.pb.go
+++ b/x/exchange/orders.pb.go
@@ -136,6 +136,9 @@ type AskOrder struct {
// allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the
// order must be either filled in full or not filled at all.
AllowPartial bool `protobuf:"varint,6,opt,name=allow_partial,json=allowPartial,proto3" json:"allow_partial,omitempty"`
+ // external_id is an optional string used to externally identify this order. Max length is 40 characters.
+ // If an order in this market with this external id already exists, this order will be rejected.
+ ExternalId string `protobuf:"bytes,7,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
}
func (m *AskOrder) Reset() { *m = AskOrder{} }
@@ -188,6 +191,9 @@ type BidOrder struct {
// allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the
// order must be either filled in full or not filled at all.
AllowPartial bool `protobuf:"varint,6,opt,name=allow_partial,json=allowPartial,proto3" json:"allow_partial,omitempty"`
+ // external_id is an optional string used to externally identify this order. Max length is 40 characters.
+ // If an order in this market with this external id already exists, this order will be rejected.
+ ExternalId string `protobuf:"bytes,7,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
}
func (m *BidOrder) Reset() { *m = BidOrder{} }
@@ -234,40 +240,42 @@ func init() {
}
var fileDescriptor_dab7cbe63f582471 = []byte{
- // 525 bytes of a gzipped FileDescriptorProto
+ // 545 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x31, 0x6f, 0xd3, 0x40,
- 0x14, 0xb6, 0xd3, 0x38, 0x75, 0x0e, 0xba, 0x98, 0x02, 0x4e, 0x90, 0x9c, 0x28, 0x5d, 0xb2, 0xe4,
- 0xdc, 0x80, 0x10, 0x12, 0x0b, 0x6a, 0x90, 0x2a, 0x3a, 0x51, 0xb9, 0x12, 0x03, 0x8b, 0x75, 0xb6,
- 0x5f, 0xdd, 0x53, 0x1c, 0x9f, 0xe5, 0xbb, 0x86, 0x76, 0x62, 0x65, 0xe4, 0x27, 0x30, 0xb3, 0xc2,
- 0x8f, 0xe8, 0xc0, 0x50, 0x31, 0x31, 0x01, 0x4a, 0x7e, 0x02, 0x7f, 0x00, 0xf9, 0xee, 0x92, 0x06,
- 0x09, 0x42, 0x59, 0x98, 0xfc, 0xde, 0xbb, 0xef, 0xfb, 0xde, 0xa7, 0x4f, 0x7a, 0x46, 0x3b, 0x45,
- 0xc9, 0xa6, 0x90, 0x93, 0x3c, 0x06, 0x1f, 0xce, 0xe2, 0x13, 0x92, 0xa7, 0xe0, 0x4f, 0x87, 0x3e,
- 0x2b, 0x13, 0x28, 0x39, 0x2e, 0x4a, 0x26, 0x98, 0x73, 0xe7, 0x0a, 0x84, 0x17, 0x20, 0x3c, 0x1d,
- 0xb6, 0xbd, 0x98, 0xf1, 0x09, 0xe3, 0x7e, 0x44, 0x78, 0x45, 0x8a, 0x40, 0x90, 0xa1, 0x1f, 0x33,
- 0x9a, 0x2b, 0x5e, 0xbb, 0xa5, 0xde, 0x43, 0xd9, 0x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, 0x31, 0xba, 0x04, 0x00,
+ 0x00,
}
func (m *Order) Marshal() (dAtA []byte, err error) {
@@ -369,6 +377,13 @@ func (m *AskOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintOrders(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x3a
+ }
if m.AllowPartial {
i--
if m.AllowPartial {
@@ -446,6 +461,13 @@ func (m *BidOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintOrders(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x3a
+ }
if m.AllowPartial {
i--
if m.AllowPartial {
@@ -579,6 +601,10 @@ func (m *AskOrder) Size() (n int) {
if m.AllowPartial {
n += 2
}
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovOrders(uint64(l))
+ }
return n
}
@@ -608,6 +634,10 @@ func (m *BidOrder) Size() (n int) {
if m.AllowPartial {
n += 2
}
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovOrders(uint64(l))
+ }
return n
}
@@ -958,6 +988,38 @@ func (m *AskOrder) Unmarshal(dAtA []byte) error {
}
}
m.AllowPartial = bool(v != 0)
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowOrders
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthOrders
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthOrders
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipOrders(dAtA[iNdEx:])
@@ -1179,6 +1241,38 @@ func (m *BidOrder) Unmarshal(dAtA []byte) error {
}
}
m.AllowPartial = bool(v != 0)
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowOrders
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthOrders
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthOrders
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipOrders(dAtA[iNdEx:])
diff --git a/x/exchange/orders_test.go b/x/exchange/orders_test.go
index c375f67102..dc671745ae 100644
--- a/x/exchange/orders_test.go
+++ b/x/exchange/orders_test.go
@@ -52,6 +52,7 @@ func copyAskOrder(askOrder *AskOrder) *AskOrder {
Price: copyCoin(askOrder.Price),
SellerSettlementFlatFee: copyCoinP(askOrder.SellerSettlementFlatFee),
AllowPartial: askOrder.AllowPartial,
+ ExternalId: askOrder.ExternalId,
}
}
@@ -67,6 +68,7 @@ func copyBidOrder(bidOrder *BidOrder) *BidOrder {
Price: copyCoin(bidOrder.Price),
BuyerSettlementFees: copyCoins(bidOrder.BuyerSettlementFees),
AllowPartial: bidOrder.AllowPartial,
+ ExternalId: bidOrder.ExternalId,
}
}
@@ -107,6 +109,7 @@ func askOrderString(askOrder *AskOrder) string {
fmt.Sprintf("Price:%q", askOrder.Price),
fmt.Sprintf("SellerSettlementFlatFee:%s", coinPString(askOrder.SellerSettlementFlatFee)),
fmt.Sprintf("AllowPartial:%t", askOrder.AllowPartial),
+ fmt.Sprintf("ExternalID:%s", askOrder.ExternalId),
}
return fmt.Sprintf("{%s}", strings.Join(fields, ", "))
}
@@ -124,6 +127,7 @@ func bidOrderString(bidOrder *BidOrder) string {
fmt.Sprintf("Price:%q", bidOrder.Price),
fmt.Sprintf("BuyerSettlementFees:%s", coinsString(bidOrder.BuyerSettlementFees)),
fmt.Sprintf("AllowPartial:%t", bidOrder.AllowPartial),
+ fmt.Sprintf("ExternalID:%s", bidOrder.ExternalId),
}
return fmt.Sprintf("{%s}", strings.Join(fields, ", "))
}
@@ -258,6 +262,42 @@ func TestValidateOrderIDs(t *testing.T) {
}
}
+func TestValidateExternalID(t *testing.T) {
+ tests := []struct {
+ name string
+ externalID string
+ expErr string
+ }{
+ {
+ name: "empty",
+ externalID: "",
+ expErr: "",
+ },
+ {
+ name: "max length",
+ externalID: strings.Repeat("m", MaxExternalIDLength),
+ expErr: "",
+ },
+ {
+ name: "max length + 1",
+ externalID: strings.Repeat("n", MaxExternalIDLength+1),
+ expErr: fmt.Sprintf("invalid external id %q: max length %d",
+ strings.Repeat("n", MaxExternalIDLength+1), MaxExternalIDLength),
+ },
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ var err error
+ testFunc := func() {
+ err = ValidateExternalID(tc.externalID)
+ }
+ require.NotPanics(t, testFunc, "ValidateExternalID(%q)", tc.externalID)
+ assertions.AssertErrorValue(t, err, tc.expErr, "ValidateExternalID(%q)", tc.externalID)
+ })
+ }
+}
+
func TestOrderSizes(t *testing.T) {
// This unit test is mostly just to see the sizes of different orders and compare
// that to the initial array size used in getOrderStoreKeyValue.
@@ -945,6 +985,47 @@ func TestOrder_PartialFillAllowed(t *testing.T) {
}
}
+func TestOrder_GetExternalID(t *testing.T) {
+ tests := []struct {
+ name string
+ order *Order
+ expected string
+ expPanic string
+ }{
+ {
+ name: "AskOrder",
+ order: NewOrder(1).WithAsk(&AskOrder{ExternalId: "ask12345"}),
+ expected: "ask12345",
+ },
+ {
+ name: "BidOrder",
+ order: NewOrder(2).WithBid(&BidOrder{ExternalId: "bid987654"}),
+ expected: "bid987654",
+ },
+ {
+ name: "nil inside order",
+ order: NewOrder(3),
+ expPanic: nilSubTypeErr(3),
+ },
+ {
+ name: "unknown order type",
+ order: newUnknownOrder(4),
+ expPanic: unknownSubTypeErr(4),
+ },
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ var actual string
+ testFunc := func() {
+ actual = tc.order.GetExternalID()
+ }
+ assertions.RequirePanicEquals(t, testFunc, tc.expPanic, "GetExternalID()")
+ assert.Equal(t, tc.expected, actual, "GetExternalID() result")
+ })
+ }
+}
+
func TestOrder_GetOrderType(t *testing.T) {
tests := []struct {
name string
@@ -1481,6 +1562,29 @@ func TestAskOrder_PartialFillAllowed(t *testing.T) {
}
}
+func TestAskOrder_GetExternalID(t *testing.T) {
+ tests := []struct {
+ name string
+ order AskOrder
+ exp string
+ }{
+ {name: "empty", order: AskOrder{ExternalId: ""}, exp: ""},
+ {name: "something", order: AskOrder{ExternalId: "something"}, exp: "something"},
+ {name: "a uuid", order: AskOrder{ExternalId: "36585FC1-C11D-42A4-B1F7-92B0D8229BC7"}, exp: "36585FC1-C11D-42A4-B1F7-92B0D8229BC7"},
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ var actual string
+ testFunc := func() {
+ actual = tc.order.GetExternalID()
+ }
+ require.NotPanics(t, testFunc, "GetExternalID()")
+ assert.Equal(t, tc.exp, actual, "GetExternalID() result")
+ })
+ }
+}
+
func TestAskOrder_GetOrderType(t *testing.T) {
expected := OrderTypeAsk
order := AskOrder{}
@@ -2068,6 +2172,29 @@ func TestBidOrder_PartialFillAllowed(t *testing.T) {
}
}
+func TestBidOrder_GetExternalID(t *testing.T) {
+ tests := []struct {
+ name string
+ order BidOrder
+ exp string
+ }{
+ {name: "empty", order: BidOrder{ExternalId: ""}, exp: ""},
+ {name: "something", order: BidOrder{ExternalId: "something"}, exp: "something"},
+ {name: "a uuid", order: BidOrder{ExternalId: "36585FC1-C11D-42A4-B1F7-92B0D8229BC7"}, exp: "36585FC1-C11D-42A4-B1F7-92B0D8229BC7"},
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ var actual string
+ testFunc := func() {
+ actual = tc.order.GetExternalID()
+ }
+ require.NotPanics(t, testFunc, "GetExternalID()")
+ assert.Equal(t, tc.exp, actual, "GetExternalID() result")
+ })
+ }
+}
+
func TestBidOrder_GetOrderType(t *testing.T) {
expected := OrderTypeBid
order := BidOrder{}
@@ -2510,6 +2637,7 @@ func TestFilledOrderGetters(t *testing.T) {
Price: sdk.NewInt64Coin("peach", 111),
SellerSettlementFlatFee: &sdk.Coin{Denom: "fig", Amount: sdkmath.NewInt(8)},
AllowPartial: true,
+ ExternalId: "ask order abc",
}
ask := NewOrder(51).WithAsk(askOrder)
askActualPrice := sdk.NewInt64Coin("peach", 123)
@@ -2523,6 +2651,7 @@ func TestFilledOrderGetters(t *testing.T) {
Price: sdk.NewInt64Coin("peach", 112),
BuyerSettlementFees: sdk.NewCoins(sdk.NewInt64Coin("fig", 9)),
AllowPartial: true,
+ ExternalId: "bid order def",
}
bid := NewOrder(52).WithBid(bidOrder)
bidActualPrice := sdk.NewInt64Coin("peach", 124)
@@ -2607,6 +2736,12 @@ func TestFilledOrderGetters(t *testing.T) {
expAsk: askOrder.AllowPartial,
expBid: bidOrder.AllowPartial,
},
+ {
+ name: "GetExternalID",
+ getter: func(of *FilledOrder) interface{} { return of.GetExternalID() },
+ expAsk: askOrder.ExternalId,
+ expBid: bidOrder.ExternalId,
+ },
{
name: "GetOrderType",
getter: func(of *FilledOrder) interface{} { return of.GetOrderType() },
diff --git a/x/exchange/query.pb.go b/x/exchange/query.pb.go
index b801156ecf..5b93f1b8ad 100644
--- a/x/exchange/query.pb.go
+++ b/x/exchange/query.pb.go
@@ -255,6 +255,107 @@ func (m *QueryGetOrderResponse) GetOrder() *Order {
return nil
}
+// QueryGetOrderByExternalIDRequest is a request message for the QueryGetOrderByExternalID endpoint.
+type QueryGetOrderByExternalIDRequest struct {
+ // market_id is the id of the market that's expected to have the order.
+ MarketId uint32 `protobuf:"varint,1,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"`
+ // external_id the external id to look up.
+ ExternalId string `protobuf:"bytes,2,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
+}
+
+func (m *QueryGetOrderByExternalIDRequest) Reset() { *m = QueryGetOrderByExternalIDRequest{} }
+func (m *QueryGetOrderByExternalIDRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryGetOrderByExternalIDRequest) ProtoMessage() {}
+func (*QueryGetOrderByExternalIDRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_00949b75b1c10bfe, []int{4}
+}
+func (m *QueryGetOrderByExternalIDRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryGetOrderByExternalIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryGetOrderByExternalIDRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryGetOrderByExternalIDRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryGetOrderByExternalIDRequest.Merge(m, src)
+}
+func (m *QueryGetOrderByExternalIDRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryGetOrderByExternalIDRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryGetOrderByExternalIDRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryGetOrderByExternalIDRequest proto.InternalMessageInfo
+
+func (m *QueryGetOrderByExternalIDRequest) GetMarketId() uint32 {
+ if m != nil {
+ return m.MarketId
+ }
+ return 0
+}
+
+func (m *QueryGetOrderByExternalIDRequest) GetExternalId() string {
+ if m != nil {
+ return m.ExternalId
+ }
+ return ""
+}
+
+// QueryGetOrderByExternalIDResponse is a response message for the QueryGetOrderByExternalID endpoint.
+type QueryGetOrderByExternalIDResponse struct {
+ // order is the requested order.
+ Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
+}
+
+func (m *QueryGetOrderByExternalIDResponse) Reset() { *m = QueryGetOrderByExternalIDResponse{} }
+func (m *QueryGetOrderByExternalIDResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryGetOrderByExternalIDResponse) ProtoMessage() {}
+func (*QueryGetOrderByExternalIDResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_00949b75b1c10bfe, []int{5}
+}
+func (m *QueryGetOrderByExternalIDResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryGetOrderByExternalIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryGetOrderByExternalIDResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryGetOrderByExternalIDResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryGetOrderByExternalIDResponse.Merge(m, src)
+}
+func (m *QueryGetOrderByExternalIDResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryGetOrderByExternalIDResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryGetOrderByExternalIDResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryGetOrderByExternalIDResponse proto.InternalMessageInfo
+
+func (m *QueryGetOrderByExternalIDResponse) GetOrder() *Order {
+ if m != nil {
+ return m.Order
+ }
+ return nil
+}
+
// QueryGetMarketOrdersRequest is a request message for the QueryGetMarketOrders endpoint.
type QueryGetMarketOrdersRequest struct {
// market_id is the id of the market to get all the orders for.
@@ -271,7 +372,7 @@ func (m *QueryGetMarketOrdersRequest) Reset() { *m = QueryGetMarketOrder
func (m *QueryGetMarketOrdersRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetMarketOrdersRequest) ProtoMessage() {}
func (*QueryGetMarketOrdersRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{4}
+ return fileDescriptor_00949b75b1c10bfe, []int{6}
}
func (m *QueryGetMarketOrdersRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -340,7 +441,7 @@ func (m *QueryGetMarketOrdersResponse) Reset() { *m = QueryGetMarketOrde
func (m *QueryGetMarketOrdersResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetMarketOrdersResponse) ProtoMessage() {}
func (*QueryGetMarketOrdersResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{5}
+ return fileDescriptor_00949b75b1c10bfe, []int{7}
}
func (m *QueryGetMarketOrdersResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -399,7 +500,7 @@ func (m *QueryGetOwnerOrdersRequest) Reset() { *m = QueryGetOwnerOrdersR
func (m *QueryGetOwnerOrdersRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetOwnerOrdersRequest) ProtoMessage() {}
func (*QueryGetOwnerOrdersRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{6}
+ return fileDescriptor_00949b75b1c10bfe, []int{8}
}
func (m *QueryGetOwnerOrdersRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -468,7 +569,7 @@ func (m *QueryGetOwnerOrdersResponse) Reset() { *m = QueryGetOwnerOrders
func (m *QueryGetOwnerOrdersResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetOwnerOrdersResponse) ProtoMessage() {}
func (*QueryGetOwnerOrdersResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{7}
+ return fileDescriptor_00949b75b1c10bfe, []int{9}
}
func (m *QueryGetOwnerOrdersResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -527,7 +628,7 @@ func (m *QueryGetAssetOrdersRequest) Reset() { *m = QueryGetAssetOrdersR
func (m *QueryGetAssetOrdersRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetAssetOrdersRequest) ProtoMessage() {}
func (*QueryGetAssetOrdersRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{8}
+ return fileDescriptor_00949b75b1c10bfe, []int{10}
}
func (m *QueryGetAssetOrdersRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -596,7 +697,7 @@ func (m *QueryGetAssetOrdersResponse) Reset() { *m = QueryGetAssetOrders
func (m *QueryGetAssetOrdersResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetAssetOrdersResponse) ProtoMessage() {}
func (*QueryGetAssetOrdersResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{9}
+ return fileDescriptor_00949b75b1c10bfe, []int{11}
}
func (m *QueryGetAssetOrdersResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -649,7 +750,7 @@ func (m *QueryGetAllOrdersRequest) Reset() { *m = QueryGetAllOrdersReque
func (m *QueryGetAllOrdersRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetAllOrdersRequest) ProtoMessage() {}
func (*QueryGetAllOrdersRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{10}
+ return fileDescriptor_00949b75b1c10bfe, []int{12}
}
func (m *QueryGetAllOrdersRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -697,7 +798,7 @@ func (m *QueryGetAllOrdersResponse) Reset() { *m = QueryGetAllOrdersResp
func (m *QueryGetAllOrdersResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetAllOrdersResponse) ProtoMessage() {}
func (*QueryGetAllOrdersResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{11}
+ return fileDescriptor_00949b75b1c10bfe, []int{13}
}
func (m *QueryGetAllOrdersResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -750,7 +851,7 @@ func (m *QueryGetMarketRequest) Reset() { *m = QueryGetMarketRequest{} }
func (m *QueryGetMarketRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetMarketRequest) ProtoMessage() {}
func (*QueryGetMarketRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{12}
+ return fileDescriptor_00949b75b1c10bfe, []int{14}
}
func (m *QueryGetMarketRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -798,7 +899,7 @@ func (m *QueryGetMarketResponse) Reset() { *m = QueryGetMarketResponse{}
func (m *QueryGetMarketResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetMarketResponse) ProtoMessage() {}
func (*QueryGetMarketResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{13}
+ return fileDescriptor_00949b75b1c10bfe, []int{15}
}
func (m *QueryGetMarketResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -851,7 +952,7 @@ func (m *QueryGetAllMarketsRequest) Reset() { *m = QueryGetAllMarketsReq
func (m *QueryGetAllMarketsRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetAllMarketsRequest) ProtoMessage() {}
func (*QueryGetAllMarketsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{14}
+ return fileDescriptor_00949b75b1c10bfe, []int{16}
}
func (m *QueryGetAllMarketsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -899,7 +1000,7 @@ func (m *QueryGetAllMarketsResponse) Reset() { *m = QueryGetAllMarketsRe
func (m *QueryGetAllMarketsResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetAllMarketsResponse) ProtoMessage() {}
func (*QueryGetAllMarketsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{15}
+ return fileDescriptor_00949b75b1c10bfe, []int{17}
}
func (m *QueryGetAllMarketsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -950,7 +1051,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
func (*QueryParamsRequest) ProtoMessage() {}
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{16}
+ return fileDescriptor_00949b75b1c10bfe, []int{18}
}
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -989,7 +1090,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
func (*QueryParamsResponse) ProtoMessage() {}
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{17}
+ return fileDescriptor_00949b75b1c10bfe, []int{19}
}
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1035,7 +1136,7 @@ func (m *QueryValidateCreateMarketRequest) Reset() { *m = QueryValidateC
func (m *QueryValidateCreateMarketRequest) String() string { return proto.CompactTextString(m) }
func (*QueryValidateCreateMarketRequest) ProtoMessage() {}
func (*QueryValidateCreateMarketRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{18}
+ return fileDescriptor_00949b75b1c10bfe, []int{20}
}
func (m *QueryValidateCreateMarketRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1087,7 +1188,7 @@ func (m *QueryValidateCreateMarketResponse) Reset() { *m = QueryValidate
func (m *QueryValidateCreateMarketResponse) String() string { return proto.CompactTextString(m) }
func (*QueryValidateCreateMarketResponse) ProtoMessage() {}
func (*QueryValidateCreateMarketResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{19}
+ return fileDescriptor_00949b75b1c10bfe, []int{21}
}
func (m *QueryValidateCreateMarketResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1140,7 +1241,7 @@ func (m *QueryValidateMarketRequest) Reset() { *m = QueryValidateMarketR
func (m *QueryValidateMarketRequest) String() string { return proto.CompactTextString(m) }
func (*QueryValidateMarketRequest) ProtoMessage() {}
func (*QueryValidateMarketRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{20}
+ return fileDescriptor_00949b75b1c10bfe, []int{22}
}
func (m *QueryValidateMarketRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1186,7 +1287,7 @@ func (m *QueryValidateMarketResponse) Reset() { *m = QueryValidateMarket
func (m *QueryValidateMarketResponse) String() string { return proto.CompactTextString(m) }
func (*QueryValidateMarketResponse) ProtoMessage() {}
func (*QueryValidateMarketResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{21}
+ return fileDescriptor_00949b75b1c10bfe, []int{23}
}
func (m *QueryValidateMarketResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1232,7 +1333,7 @@ func (m *QueryValidateManageFeesRequest) Reset() { *m = QueryValidateMan
func (m *QueryValidateManageFeesRequest) String() string { return proto.CompactTextString(m) }
func (*QueryValidateManageFeesRequest) ProtoMessage() {}
func (*QueryValidateManageFeesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{22}
+ return fileDescriptor_00949b75b1c10bfe, []int{24}
}
func (m *QueryValidateManageFeesRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1284,7 +1385,7 @@ func (m *QueryValidateManageFeesResponse) Reset() { *m = QueryValidateMa
func (m *QueryValidateManageFeesResponse) String() string { return proto.CompactTextString(m) }
func (*QueryValidateManageFeesResponse) ProtoMessage() {}
func (*QueryValidateManageFeesResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_00949b75b1c10bfe, []int{23}
+ return fileDescriptor_00949b75b1c10bfe, []int{25}
}
func (m *QueryValidateManageFeesResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1332,6 +1433,8 @@ func init() {
proto.RegisterType((*QueryOrderFeeCalcResponse)(nil), "provenance.exchange.v1.QueryOrderFeeCalcResponse")
proto.RegisterType((*QueryGetOrderRequest)(nil), "provenance.exchange.v1.QueryGetOrderRequest")
proto.RegisterType((*QueryGetOrderResponse)(nil), "provenance.exchange.v1.QueryGetOrderResponse")
+ proto.RegisterType((*QueryGetOrderByExternalIDRequest)(nil), "provenance.exchange.v1.QueryGetOrderByExternalIDRequest")
+ proto.RegisterType((*QueryGetOrderByExternalIDResponse)(nil), "provenance.exchange.v1.QueryGetOrderByExternalIDResponse")
proto.RegisterType((*QueryGetMarketOrdersRequest)(nil), "provenance.exchange.v1.QueryGetMarketOrdersRequest")
proto.RegisterType((*QueryGetMarketOrdersResponse)(nil), "provenance.exchange.v1.QueryGetMarketOrdersResponse")
proto.RegisterType((*QueryGetOwnerOrdersRequest)(nil), "provenance.exchange.v1.QueryGetOwnerOrdersRequest")
@@ -1359,94 +1462,100 @@ func init() {
}
var fileDescriptor_00949b75b1c10bfe = []byte{
- // 1387 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0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 0x0a,
- 0x3c, 0x62, 0x58, 0xdf, 0x8f, 0x77, 0x8b, 0x18, 0xd6, 0x7e, 0x24, 0xf4, 0x33, 0x80, 0x6f, 0xc5,
- 0x68, 0x0b, 0xb4, 0x98, 0xb1, 0x88, 0x3e, 0xb9, 0x52, 0x7c, 0x7b, 0x68, 0xbf, 0xac, 0x33, 0x30,
- 0x40, 0x40, 0x57, 0x6f, 0x2d, 0x93, 0xc3, 0xa3, 0x12, 0x78, 0x7d, 0x54, 0x02, 0x7f, 0x1d, 0x95,
- 0xc0, 0x97, 0xc7, 0xa5, 0x91, 0xd7, 0xc7, 0xa5, 0x91, 0xdf, 0x8f, 0x4b, 0x23, 0xb0, 0xa0, 0xd3,
- 0x18, 0x28, 0x1b, 0xe0, 0xa9, 0xac, 0xe9, 0xee, 0xd6, 0x4e, 0x43, 0x6e, 0xd2, 0x76, 0x20, 0xdd,
- 0x9c, 0x4e, 0x83, 0xc9, 0x77, 0xbb, 0xe9, 0x1b, 0x13, 0xec, 0x7f, 0xa7, 0xb5, 0xff, 0x02, 0x00,
- 0x00, 0xff, 0xff, 0x14, 0xc9, 0x3c, 0x3d, 0xa4, 0x16, 0x00, 0x00,
+ // 1480 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6f, 0x13, 0xc7,
+ 0x1b, 0xcf, 0x24, 0x24, 0x24, 0x93, 0x3f, 0xfc, 0xc5, 0xc4, 0x50, 0xc7, 0x80, 0x13, 0x16, 0x04,
+ 0x51, 0x20, 0xbb, 0xd8, 0x86, 0xb4, 0x1c, 0x68, 0x4b, 0x68, 0x83, 0x22, 0x15, 0x11, 0xb6, 0x55,
+ 0x5b, 0x71, 0xa8, 0x19, 0xdb, 0x93, 0x65, 0xc5, 0x7a, 0x67, 0xd9, 0x59, 0x4c, 0xa2, 0x28, 0x87,
+ 0xbe, 0x5c, 0xda, 0x43, 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, 0x85, 0x44, 0x43, 0x4f, 0x83, 0xeb, 0x46, 0x9c, 0x2e, 0xca, 0x38, 0x02, 0x52, 0x54,
+ 0x5d, 0xc6, 0x11, 0x90, 0x26, 0xc2, 0x94, 0x65, 0x0e, 0xfd, 0x3c, 0x52, 0x93, 0xa0, 0x77, 0xa4,
+ 0xb7, 0x16, 0xd1, 0x8d, 0xe8, 0xef, 0x60, 0x04, 0x44, 0xf5, 0x53, 0xc6, 0x08, 0x88, 0xd5, 0x69,
+ 0x19, 0x23, 0x20, 0x5e, 0xa0, 0x29, 0x2e, 0x07, 0x6e, 0xa1, 0x5a, 0x26, 0xf0, 0x98, 0x61, 0x7d,
+ 0x31, 0xd9, 0x2d, 0x66, 0x58, 0x07, 0x91, 0xd0, 0x0f, 0x00, 0xbe, 0x94, 0xa0, 0xbd, 0xd0, 0x72,
+ 0xce, 0x22, 0xfa, 0xe4, 0x5c, 0xe9, 0xe5, 0xa1, 0xfd, 0xf2, 0xce, 0xc0, 0x10, 0x01, 0x5d, 0x3d,
+ 0xba, 0x42, 0x9e, 0x3e, 0x2f, 0x83, 0x67, 0xcf, 0xcb, 0xe0, 0x8f, 0xe7, 0x65, 0xf0, 0xc5, 0x8b,
+ 0xf2, 0xc8, 0xb3, 0x17, 0xe5, 0x91, 0x5f, 0x5f, 0x94, 0x47, 0xe0, 0xac, 0x49, 0x13, 0xa0, 0xac,
+ 0x83, 0x5b, 0xaa, 0x61, 0x7a, 0x77, 0xee, 0x37, 0xd4, 0x26, 0x6d, 0x87, 0xd2, 0x2d, 0x99, 0x34,
+ 0x9c, 0x7c, 0xb3, 0x9b, 0xbe, 0x31, 0xc1, 0xff, 0x2f, 0x5e, 0xfb, 0x27, 0x00, 0x00, 0xff, 0xff,
+ 0x3b, 0xd0, 0x8c, 0xac, 0x80, 0x18, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1465,6 +1574,8 @@ type QueryClient interface {
QueryOrderFeeCalc(ctx context.Context, in *QueryOrderFeeCalcRequest, opts ...grpc.CallOption) (*QueryOrderFeeCalcResponse, error)
// QueryGetOrder looks up an order by id.
QueryGetOrder(ctx context.Context, in *QueryGetOrderRequest, opts ...grpc.CallOption) (*QueryGetOrderResponse, error)
+ // QueryGetOrderByExternalID looks up an order by market id and external id.
+ QueryGetOrderByExternalID(ctx context.Context, in *QueryGetOrderByExternalIDRequest, opts ...grpc.CallOption) (*QueryGetOrderByExternalIDResponse, error)
// QueryGetMarketOrders looks up the orders in a market.
QueryGetMarketOrders(ctx context.Context, in *QueryGetMarketOrdersRequest, opts ...grpc.CallOption) (*QueryGetMarketOrdersResponse, error)
// QueryGetOwnerOrders looks up the orders from the provided owner address.
@@ -1513,6 +1624,15 @@ func (c *queryClient) QueryGetOrder(ctx context.Context, in *QueryGetOrderReques
return out, nil
}
+func (c *queryClient) QueryGetOrderByExternalID(ctx context.Context, in *QueryGetOrderByExternalIDRequest, opts ...grpc.CallOption) (*QueryGetOrderByExternalIDResponse, error) {
+ out := new(QueryGetOrderByExternalIDResponse)
+ err := c.cc.Invoke(ctx, "/provenance.exchange.v1.Query/QueryGetOrderByExternalID", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *queryClient) QueryGetMarketOrders(ctx context.Context, in *QueryGetMarketOrdersRequest, opts ...grpc.CallOption) (*QueryGetMarketOrdersResponse, error) {
out := new(QueryGetMarketOrdersResponse)
err := c.cc.Invoke(ctx, "/provenance.exchange.v1.Query/QueryGetMarketOrders", in, out, opts...)
@@ -1609,6 +1729,8 @@ type QueryServer interface {
QueryOrderFeeCalc(context.Context, *QueryOrderFeeCalcRequest) (*QueryOrderFeeCalcResponse, error)
// QueryGetOrder looks up an order by id.
QueryGetOrder(context.Context, *QueryGetOrderRequest) (*QueryGetOrderResponse, error)
+ // QueryGetOrderByExternalID looks up an order by market id and external id.
+ QueryGetOrderByExternalID(context.Context, *QueryGetOrderByExternalIDRequest) (*QueryGetOrderByExternalIDResponse, error)
// QueryGetMarketOrders looks up the orders in a market.
QueryGetMarketOrders(context.Context, *QueryGetMarketOrdersRequest) (*QueryGetMarketOrdersResponse, error)
// QueryGetOwnerOrders looks up the orders from the provided owner address.
@@ -1641,6 +1763,9 @@ func (*UnimplementedQueryServer) QueryOrderFeeCalc(ctx context.Context, req *Que
func (*UnimplementedQueryServer) QueryGetOrder(ctx context.Context, req *QueryGetOrderRequest) (*QueryGetOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryGetOrder not implemented")
}
+func (*UnimplementedQueryServer) QueryGetOrderByExternalID(ctx context.Context, req *QueryGetOrderByExternalIDRequest) (*QueryGetOrderByExternalIDResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method QueryGetOrderByExternalID not implemented")
+}
func (*UnimplementedQueryServer) QueryGetMarketOrders(ctx context.Context, req *QueryGetMarketOrdersRequest) (*QueryGetMarketOrdersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryGetMarketOrders not implemented")
}
@@ -1712,6 +1837,24 @@ func _Query_QueryGetOrder_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
+func _Query_QueryGetOrderByExternalID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryGetOrderByExternalIDRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(QueryServer).QueryGetOrderByExternalID(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/provenance.exchange.v1.Query/QueryGetOrderByExternalID",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(QueryServer).QueryGetOrderByExternalID(ctx, req.(*QueryGetOrderByExternalIDRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _Query_QueryGetMarketOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetMarketOrdersRequest)
if err := dec(in); err != nil {
@@ -1904,6 +2047,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{
MethodName: "QueryGetOrder",
Handler: _Query_QueryGetOrder_Handler,
},
+ {
+ MethodName: "QueryGetOrderByExternalID",
+ Handler: _Query_QueryGetOrderByExternalID_Handler,
+ },
{
MethodName: "QueryGetMarketOrders",
Handler: _Query_QueryGetMarketOrders_Handler,
@@ -2124,6 +2271,76 @@ func (m *QueryGetOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *QueryGetOrderByExternalIDRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryGetOrderByExternalIDRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryGetOrderByExternalIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x12
+ }
+ if m.MarketId != 0 {
+ i = encodeVarintQuery(dAtA, i, uint64(m.MarketId))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *QueryGetOrderByExternalIDResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryGetOrderByExternalIDResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryGetOrderByExternalIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Order != nil {
+ {
+ size, err := m.Order.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
func (m *QueryGetMarketOrdersRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -3035,6 +3252,35 @@ func (m *QueryGetOrderResponse) Size() (n int) {
return n
}
+func (m *QueryGetOrderByExternalIDRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.MarketId != 0 {
+ n += 1 + sovQuery(uint64(m.MarketId))
+ }
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryGetOrderByExternalIDResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Order != nil {
+ l = m.Order.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
func (m *QueryGetMarketOrdersRequest) Size() (n int) {
if m == nil {
return 0
@@ -3796,6 +4042,193 @@ func (m *QueryGetOrderResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *QueryGetOrderByExternalIDRequest) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: QueryGetOrderByExternalIDRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryGetOrderByExternalIDRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType)
+ }
+ m.MarketId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.MarketId |= uint32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *QueryGetOrderByExternalIDResponse) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: QueryGetOrderByExternalIDResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryGetOrderByExternalIDResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Order == nil {
+ m.Order = &Order{}
+ }
+ if err := m.Order.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *QueryGetMarketOrdersRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
diff --git a/x/exchange/query.pb.gw.go b/x/exchange/query.pb.gw.go
index 33f2a941e8..7eacc45cdf 100644
--- a/x/exchange/query.pb.gw.go
+++ b/x/exchange/query.pb.gw.go
@@ -121,6 +121,158 @@ func local_request_Query_QueryGetOrder_0(ctx context.Context, marshaler runtime.
}
+func request_Query_QueryGetOrderByExternalID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryGetOrderByExternalIDRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["market_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "market_id")
+ }
+
+ protoReq.MarketId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "market_id", err)
+ }
+
+ val, ok = pathParams["external_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "external_id")
+ }
+
+ protoReq.ExternalId, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "external_id", err)
+ }
+
+ msg, err := client.QueryGetOrderByExternalID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_QueryGetOrderByExternalID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryGetOrderByExternalIDRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["market_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "market_id")
+ }
+
+ protoReq.MarketId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "market_id", err)
+ }
+
+ val, ok = pathParams["external_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "external_id")
+ }
+
+ protoReq.ExternalId, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "external_id", err)
+ }
+
+ msg, err := server.QueryGetOrderByExternalID(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_Query_QueryGetOrderByExternalID_1(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryGetOrderByExternalIDRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["market_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "market_id")
+ }
+
+ protoReq.MarketId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "market_id", err)
+ }
+
+ val, ok = pathParams["external_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "external_id")
+ }
+
+ protoReq.ExternalId, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "external_id", err)
+ }
+
+ msg, err := client.QueryGetOrderByExternalID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_QueryGetOrderByExternalID_1(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryGetOrderByExternalIDRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["market_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "market_id")
+ }
+
+ protoReq.MarketId, err = runtime.Uint32(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "market_id", err)
+ }
+
+ val, ok = pathParams["external_id"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "external_id")
+ }
+
+ protoReq.ExternalId, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "external_id", err)
+ }
+
+ msg, err := server.QueryGetOrderByExternalID(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
var (
filter_Query_QueryGetMarketOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{"market_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
@@ -779,6 +931,46 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
})
+ mux.Handle("GET", pattern_Query_QueryGetOrderByExternalID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Query_QueryGetOrderByExternalID_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_QueryGetOrderByExternalID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_QueryGetOrderByExternalID_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Query_QueryGetOrderByExternalID_1(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_QueryGetOrderByExternalID_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("GET", pattern_Query_QueryGetMarketOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1100,6 +1292,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
})
+ mux.Handle("GET", pattern_Query_QueryGetOrderByExternalID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_Query_QueryGetOrderByExternalID_0(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_QueryGetOrderByExternalID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_QueryGetOrderByExternalID_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_Query_QueryGetOrderByExternalID_1(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_QueryGetOrderByExternalID_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("GET", pattern_Query_QueryGetMarketOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1348,6 +1580,10 @@ var (
pattern_Query_QueryGetOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"provenance", "exchange", "v1", "order", "order_id"}, "", runtime.AssumeColonVerbOpt(false)))
+ pattern_Query_QueryGetOrderByExternalID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"provenance", "exchange", "v1", "orders", "market", "market_id", "external_id"}, "", runtime.AssumeColonVerbOpt(false)))
+
+ pattern_Query_QueryGetOrderByExternalID_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"provenance", "exchange", "v1", "market", "market_id", "order", "external_id"}, "", runtime.AssumeColonVerbOpt(false)))
+
pattern_Query_QueryGetMarketOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"provenance", "exchange", "v1", "orders", "market", "market_id"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_QueryGetMarketOrders_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"provenance", "exchange", "v1", "market", "market_id", "orders"}, "", runtime.AssumeColonVerbOpt(false)))
@@ -1378,6 +1614,10 @@ var (
forward_Query_QueryGetOrder_0 = runtime.ForwardResponseMessage
+ forward_Query_QueryGetOrderByExternalID_0 = runtime.ForwardResponseMessage
+
+ forward_Query_QueryGetOrderByExternalID_1 = runtime.ForwardResponseMessage
+
forward_Query_QueryGetMarketOrders_0 = runtime.ForwardResponseMessage
forward_Query_QueryGetMarketOrders_1 = runtime.ForwardResponseMessage
diff --git a/x/exchange/tx.pb.go b/x/exchange/tx.pb.go
index 7d02d6f000..6c9f57c84d 100644
--- a/x/exchange/tx.pb.go
+++ b/x/exchange/tx.pb.go
@@ -712,6 +712,117 @@ func (m *MsgMarketSettleResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgMarketSettleResponse proto.InternalMessageInfo
+// MsgMarketSetOrderExternalIDRequest is a request message for the MarketSetOrderExternalID endpoint.
+type MsgMarketSetOrderExternalIDRequest struct {
+ // admin is the account with "set_ids" permission requesting this settlement.
+ Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty"`
+ // market_id is the numerical identifier of the market to update required attributes for.
+ MarketId uint32 `protobuf:"varint,2,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"`
+ // order_id is the numerical identifier of the order to update.
+ OrderId uint64 `protobuf:"varint,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
+ // external_id is the new external id to associate with the order. Max length is 40 characters.
+ // If the external id is already associated with another order in this market, this update will fail.
+ ExternalId string `protobuf:"bytes,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
+}
+
+func (m *MsgMarketSetOrderExternalIDRequest) Reset() { *m = MsgMarketSetOrderExternalIDRequest{} }
+func (m *MsgMarketSetOrderExternalIDRequest) String() string { return proto.CompactTextString(m) }
+func (*MsgMarketSetOrderExternalIDRequest) ProtoMessage() {}
+func (*MsgMarketSetOrderExternalIDRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e333fcffc093bd1b, []int{12}
+}
+func (m *MsgMarketSetOrderExternalIDRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgMarketSetOrderExternalIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgMarketSetOrderExternalIDRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgMarketSetOrderExternalIDRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgMarketSetOrderExternalIDRequest.Merge(m, src)
+}
+func (m *MsgMarketSetOrderExternalIDRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgMarketSetOrderExternalIDRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgMarketSetOrderExternalIDRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgMarketSetOrderExternalIDRequest proto.InternalMessageInfo
+
+func (m *MsgMarketSetOrderExternalIDRequest) GetAdmin() string {
+ if m != nil {
+ return m.Admin
+ }
+ return ""
+}
+
+func (m *MsgMarketSetOrderExternalIDRequest) GetMarketId() uint32 {
+ if m != nil {
+ return m.MarketId
+ }
+ return 0
+}
+
+func (m *MsgMarketSetOrderExternalIDRequest) GetOrderId() uint64 {
+ if m != nil {
+ return m.OrderId
+ }
+ return 0
+}
+
+func (m *MsgMarketSetOrderExternalIDRequest) GetExternalId() string {
+ if m != nil {
+ return m.ExternalId
+ }
+ return ""
+}
+
+// MsgMarketSetOrderExternalIDResponse is a response message for the MarketSetOrderExternalID endpoint.
+type MsgMarketSetOrderExternalIDResponse struct {
+}
+
+func (m *MsgMarketSetOrderExternalIDResponse) Reset() { *m = MsgMarketSetOrderExternalIDResponse{} }
+func (m *MsgMarketSetOrderExternalIDResponse) String() string { return proto.CompactTextString(m) }
+func (*MsgMarketSetOrderExternalIDResponse) ProtoMessage() {}
+func (*MsgMarketSetOrderExternalIDResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e333fcffc093bd1b, []int{13}
+}
+func (m *MsgMarketSetOrderExternalIDResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgMarketSetOrderExternalIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgMarketSetOrderExternalIDResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgMarketSetOrderExternalIDResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgMarketSetOrderExternalIDResponse.Merge(m, src)
+}
+func (m *MsgMarketSetOrderExternalIDResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgMarketSetOrderExternalIDResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgMarketSetOrderExternalIDResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgMarketSetOrderExternalIDResponse proto.InternalMessageInfo
+
// MsgMarketWithdrawRequest is a request message for the MarketWithdraw endpoint.
type MsgMarketWithdrawRequest struct {
// admin is the account with withdraw permission requesting the withdrawal.
@@ -728,7 +839,7 @@ func (m *MsgMarketWithdrawRequest) Reset() { *m = MsgMarketWithdrawReque
func (m *MsgMarketWithdrawRequest) String() string { return proto.CompactTextString(m) }
func (*MsgMarketWithdrawRequest) ProtoMessage() {}
func (*MsgMarketWithdrawRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{12}
+ return fileDescriptor_e333fcffc093bd1b, []int{14}
}
func (m *MsgMarketWithdrawRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -793,7 +904,7 @@ func (m *MsgMarketWithdrawResponse) Reset() { *m = MsgMarketWithdrawResp
func (m *MsgMarketWithdrawResponse) String() string { return proto.CompactTextString(m) }
func (*MsgMarketWithdrawResponse) ProtoMessage() {}
func (*MsgMarketWithdrawResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{13}
+ return fileDescriptor_e333fcffc093bd1b, []int{15}
}
func (m *MsgMarketWithdrawResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -836,7 +947,7 @@ func (m *MsgMarketUpdateDetailsRequest) Reset() { *m = MsgMarketUpdateDe
func (m *MsgMarketUpdateDetailsRequest) String() string { return proto.CompactTextString(m) }
func (*MsgMarketUpdateDetailsRequest) ProtoMessage() {}
func (*MsgMarketUpdateDetailsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{14}
+ return fileDescriptor_e333fcffc093bd1b, []int{16}
}
func (m *MsgMarketUpdateDetailsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -894,7 +1005,7 @@ func (m *MsgMarketUpdateDetailsResponse) Reset() { *m = MsgMarketUpdateD
func (m *MsgMarketUpdateDetailsResponse) String() string { return proto.CompactTextString(m) }
func (*MsgMarketUpdateDetailsResponse) ProtoMessage() {}
func (*MsgMarketUpdateDetailsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{15}
+ return fileDescriptor_e333fcffc093bd1b, []int{17}
}
func (m *MsgMarketUpdateDetailsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -937,7 +1048,7 @@ func (m *MsgMarketUpdateEnabledRequest) Reset() { *m = MsgMarketUpdateEn
func (m *MsgMarketUpdateEnabledRequest) String() string { return proto.CompactTextString(m) }
func (*MsgMarketUpdateEnabledRequest) ProtoMessage() {}
func (*MsgMarketUpdateEnabledRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{16}
+ return fileDescriptor_e333fcffc093bd1b, []int{18}
}
func (m *MsgMarketUpdateEnabledRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -995,7 +1106,7 @@ func (m *MsgMarketUpdateEnabledResponse) Reset() { *m = MsgMarketUpdateE
func (m *MsgMarketUpdateEnabledResponse) String() string { return proto.CompactTextString(m) }
func (*MsgMarketUpdateEnabledResponse) ProtoMessage() {}
func (*MsgMarketUpdateEnabledResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{17}
+ return fileDescriptor_e333fcffc093bd1b, []int{19}
}
func (m *MsgMarketUpdateEnabledResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1040,7 +1151,7 @@ func (m *MsgMarketUpdateUserSettleRequest) Reset() { *m = MsgMarketUpdat
func (m *MsgMarketUpdateUserSettleRequest) String() string { return proto.CompactTextString(m) }
func (*MsgMarketUpdateUserSettleRequest) ProtoMessage() {}
func (*MsgMarketUpdateUserSettleRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{18}
+ return fileDescriptor_e333fcffc093bd1b, []int{20}
}
func (m *MsgMarketUpdateUserSettleRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1098,7 +1209,7 @@ func (m *MsgMarketUpdateUserSettleResponse) Reset() { *m = MsgMarketUpda
func (m *MsgMarketUpdateUserSettleResponse) String() string { return proto.CompactTextString(m) }
func (*MsgMarketUpdateUserSettleResponse) ProtoMessage() {}
func (*MsgMarketUpdateUserSettleResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{19}
+ return fileDescriptor_e333fcffc093bd1b, []int{21}
}
func (m *MsgMarketUpdateUserSettleResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1145,7 +1256,7 @@ func (m *MsgMarketManagePermissionsRequest) Reset() { *m = MsgMarketMana
func (m *MsgMarketManagePermissionsRequest) String() string { return proto.CompactTextString(m) }
func (*MsgMarketManagePermissionsRequest) ProtoMessage() {}
func (*MsgMarketManagePermissionsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{20}
+ return fileDescriptor_e333fcffc093bd1b, []int{22}
}
func (m *MsgMarketManagePermissionsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1217,7 +1328,7 @@ func (m *MsgMarketManagePermissionsResponse) Reset() { *m = MsgMarketMan
func (m *MsgMarketManagePermissionsResponse) String() string { return proto.CompactTextString(m) }
func (*MsgMarketManagePermissionsResponse) ProtoMessage() {}
func (*MsgMarketManagePermissionsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{21}
+ return fileDescriptor_e333fcffc093bd1b, []int{23}
}
func (m *MsgMarketManagePermissionsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1266,7 +1377,7 @@ func (m *MsgMarketManageReqAttrsRequest) Reset() { *m = MsgMarketManageR
func (m *MsgMarketManageReqAttrsRequest) String() string { return proto.CompactTextString(m) }
func (*MsgMarketManageReqAttrsRequest) ProtoMessage() {}
func (*MsgMarketManageReqAttrsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{22}
+ return fileDescriptor_e333fcffc093bd1b, []int{24}
}
func (m *MsgMarketManageReqAttrsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1345,7 +1456,7 @@ func (m *MsgMarketManageReqAttrsResponse) Reset() { *m = MsgMarketManage
func (m *MsgMarketManageReqAttrsResponse) String() string { return proto.CompactTextString(m) }
func (*MsgMarketManageReqAttrsResponse) ProtoMessage() {}
func (*MsgMarketManageReqAttrsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{23}
+ return fileDescriptor_e333fcffc093bd1b, []int{25}
}
func (m *MsgMarketManageReqAttrsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1388,7 +1499,7 @@ func (m *MsgGovCreateMarketRequest) Reset() { *m = MsgGovCreateMarketReq
func (m *MsgGovCreateMarketRequest) String() string { return proto.CompactTextString(m) }
func (*MsgGovCreateMarketRequest) ProtoMessage() {}
func (*MsgGovCreateMarketRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{24}
+ return fileDescriptor_e333fcffc093bd1b, []int{26}
}
func (m *MsgGovCreateMarketRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1439,7 +1550,7 @@ func (m *MsgGovCreateMarketResponse) Reset() { *m = MsgGovCreateMarketRe
func (m *MsgGovCreateMarketResponse) String() string { return proto.CompactTextString(m) }
func (*MsgGovCreateMarketResponse) ProtoMessage() {}
func (*MsgGovCreateMarketResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{25}
+ return fileDescriptor_e333fcffc093bd1b, []int{27}
}
func (m *MsgGovCreateMarketResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1504,7 +1615,7 @@ func (m *MsgGovManageFeesRequest) Reset() { *m = MsgGovManageFeesRequest
func (m *MsgGovManageFeesRequest) String() string { return proto.CompactTextString(m) }
func (*MsgGovManageFeesRequest) ProtoMessage() {}
func (*MsgGovManageFeesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{26}
+ return fileDescriptor_e333fcffc093bd1b, []int{28}
}
func (m *MsgGovManageFeesRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1639,7 +1750,7 @@ func (m *MsgGovManageFeesResponse) Reset() { *m = MsgGovManageFeesRespon
func (m *MsgGovManageFeesResponse) String() string { return proto.CompactTextString(m) }
func (*MsgGovManageFeesResponse) ProtoMessage() {}
func (*MsgGovManageFeesResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{27}
+ return fileDescriptor_e333fcffc093bd1b, []int{29}
}
func (m *MsgGovManageFeesResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1680,7 +1791,7 @@ func (m *MsgGovUpdateParamsRequest) Reset() { *m = MsgGovUpdateParamsReq
func (m *MsgGovUpdateParamsRequest) String() string { return proto.CompactTextString(m) }
func (*MsgGovUpdateParamsRequest) ProtoMessage() {}
func (*MsgGovUpdateParamsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{28}
+ return fileDescriptor_e333fcffc093bd1b, []int{30}
}
func (m *MsgGovUpdateParamsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1731,7 +1842,7 @@ func (m *MsgGovUpdateParamsResponse) Reset() { *m = MsgGovUpdateParamsRe
func (m *MsgGovUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
func (*MsgGovUpdateParamsResponse) ProtoMessage() {}
func (*MsgGovUpdateParamsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_e333fcffc093bd1b, []int{29}
+ return fileDescriptor_e333fcffc093bd1b, []int{31}
}
func (m *MsgGovUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1773,6 +1884,8 @@ func init() {
proto.RegisterType((*MsgFillAsksResponse)(nil), "provenance.exchange.v1.MsgFillAsksResponse")
proto.RegisterType((*MsgMarketSettleRequest)(nil), "provenance.exchange.v1.MsgMarketSettleRequest")
proto.RegisterType((*MsgMarketSettleResponse)(nil), "provenance.exchange.v1.MsgMarketSettleResponse")
+ proto.RegisterType((*MsgMarketSetOrderExternalIDRequest)(nil), "provenance.exchange.v1.MsgMarketSetOrderExternalIDRequest")
+ proto.RegisterType((*MsgMarketSetOrderExternalIDResponse)(nil), "provenance.exchange.v1.MsgMarketSetOrderExternalIDResponse")
proto.RegisterType((*MsgMarketWithdrawRequest)(nil), "provenance.exchange.v1.MsgMarketWithdrawRequest")
proto.RegisterType((*MsgMarketWithdrawResponse)(nil), "provenance.exchange.v1.MsgMarketWithdrawResponse")
proto.RegisterType((*MsgMarketUpdateDetailsRequest)(nil), "provenance.exchange.v1.MsgMarketUpdateDetailsRequest")
@@ -1796,118 +1909,122 @@ func init() {
func init() { proto.RegisterFile("provenance/exchange/v1/tx.proto", fileDescriptor_e333fcffc093bd1b) }
var fileDescriptor_e333fcffc093bd1b = []byte{
- // 1766 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0x4b, 0x6f, 0xdc, 0x5e,
- 0x15, 0x8f, 0xf3, 0xea, 0xcc, 0x49, 0x93, 0xf6, 0x7f, 0xf3, 0x9a, 0xb8, 0xcd, 0x64, 0x3a, 0xa1,
- 0x52, 0x69, 0xc9, 0x4c, 0x12, 0x44, 0x81, 0x88, 0x05, 0x99, 0x94, 0x44, 0x5d, 0x04, 0x22, 0x97,
- 0x82, 0x04, 0x0b, 0xeb, 0x8e, 0x7d, 0x3b, 0xb1, 0xe2, 0xb1, 0xa7, 0xbe, 0x37, 0x69, 0xba, 0x42,
- 0x42, 0x48, 0xac, 0x90, 0xba, 0x64, 0x8b, 0x60, 0x03, 0x42, 0x02, 0x24, 0x36,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34, 0x3a, 0x56, 0x30, 0xea, 0x5f, 0x9f, 0x59, 0x4f, 0x21, 0xb9, 0x80, 0x3b, 0x63, 0xe5, 0x08,
+ 0x9a, 0xb6, 0x01, 0xd2, 0xab, 0x2b, 0x7d, 0x77, 0x16, 0x15, 0xe5, 0x39, 0x80, 0xa5, 0xc4, 0xed,
+ 0x8c, 0x5a, 0xd3, 0x8d, 0x4c, 0xd4, 0x44, 0xfa, 0xd3, 0xe2, 0x0a, 0x09, 0xb6, 0xf1, 0x1b, 0x35,
+ 0x8f, 0x6d, 0xca, 0x03, 0x21, 0x8f, 0x6d, 0xda, 0x85, 0xdd, 0x21, 0x9f, 0xbf, 0xab, 0x69, 0x5f,
+ 0xbc, 0xab, 0x69, 0x6f, 0xdf, 0xd5, 0xb4, 0x4f, 0xdf, 0xd7, 0x6e, 0x7c, 0xf1, 0xbe, 0x76, 0xe3,
+ 0x9f, 0xef, 0x6b, 0x37, 0x60, 0xd3, 0xf1, 0x33, 0xec, 0x9d, 0x68, 0x3f, 0x6a, 0xc6, 0x1a, 0x8d,
+ 0x23, 0xa1, 0x27, 0x8e, 0x1f, 0xfb, 0x6a, 0x5d, 0x44, 0xbf, 0x9a, 0x76, 0x17, 0xc4, 0x8f, 0xa5,
+ 0x5f, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x4b, 0x96, 0xdc, 0x40, 0x1e, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1934,6 +2051,8 @@ type MsgClient interface {
FillAsks(ctx context.Context, in *MsgFillAsksRequest, opts ...grpc.CallOption) (*MsgFillAsksResponse, error)
// MarketSettle is a market endpoint to trigger the settlement of orders.
MarketSettle(ctx context.Context, in *MsgMarketSettleRequest, opts ...grpc.CallOption) (*MsgMarketSettleResponse, error)
+ // MarketSetOrderExternalID updates an order's external id field.
+ MarketSetOrderExternalID(ctx context.Context, in *MsgMarketSetOrderExternalIDRequest, opts ...grpc.CallOption) (*MsgMarketSetOrderExternalIDResponse, error)
// MarketWithdraw is a market endpoint to withdraw fees that have been collected.
MarketWithdraw(ctx context.Context, in *MsgMarketWithdrawRequest, opts ...grpc.CallOption) (*MsgMarketWithdrawResponse, error)
// MarketUpdateDetails is a market endpoint to update its details.
@@ -2016,6 +2135,15 @@ func (c *msgClient) MarketSettle(ctx context.Context, in *MsgMarketSettleRequest
return out, nil
}
+func (c *msgClient) MarketSetOrderExternalID(ctx context.Context, in *MsgMarketSetOrderExternalIDRequest, opts ...grpc.CallOption) (*MsgMarketSetOrderExternalIDResponse, error) {
+ out := new(MsgMarketSetOrderExternalIDResponse)
+ err := c.cc.Invoke(ctx, "/provenance.exchange.v1.Msg/MarketSetOrderExternalID", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *msgClient) MarketWithdraw(ctx context.Context, in *MsgMarketWithdrawRequest, opts ...grpc.CallOption) (*MsgMarketWithdrawResponse, error) {
out := new(MsgMarketWithdrawResponse)
err := c.cc.Invoke(ctx, "/provenance.exchange.v1.Msg/MarketWithdraw", in, out, opts...)
@@ -2111,6 +2239,8 @@ type MsgServer interface {
FillAsks(context.Context, *MsgFillAsksRequest) (*MsgFillAsksResponse, error)
// MarketSettle is a market endpoint to trigger the settlement of orders.
MarketSettle(context.Context, *MsgMarketSettleRequest) (*MsgMarketSettleResponse, error)
+ // MarketSetOrderExternalID updates an order's external id field.
+ MarketSetOrderExternalID(context.Context, *MsgMarketSetOrderExternalIDRequest) (*MsgMarketSetOrderExternalIDResponse, error)
// MarketWithdraw is a market endpoint to withdraw fees that have been collected.
MarketWithdraw(context.Context, *MsgMarketWithdrawRequest) (*MsgMarketWithdrawResponse, error)
// MarketUpdateDetails is a market endpoint to update its details.
@@ -2153,6 +2283,9 @@ func (*UnimplementedMsgServer) FillAsks(ctx context.Context, req *MsgFillAsksReq
func (*UnimplementedMsgServer) MarketSettle(ctx context.Context, req *MsgMarketSettleRequest) (*MsgMarketSettleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method MarketSettle not implemented")
}
+func (*UnimplementedMsgServer) MarketSetOrderExternalID(ctx context.Context, req *MsgMarketSetOrderExternalIDRequest) (*MsgMarketSetOrderExternalIDResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method MarketSetOrderExternalID not implemented")
+}
func (*UnimplementedMsgServer) MarketWithdraw(ctx context.Context, req *MsgMarketWithdrawRequest) (*MsgMarketWithdrawResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method MarketWithdraw not implemented")
}
@@ -2293,6 +2426,24 @@ func _Msg_MarketSettle_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler)
}
+func _Msg_MarketSetOrderExternalID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(MsgMarketSetOrderExternalIDRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(MsgServer).MarketSetOrderExternalID(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/provenance.exchange.v1.Msg/MarketSetOrderExternalID",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(MsgServer).MarketSetOrderExternalID(ctx, req.(*MsgMarketSetOrderExternalIDRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _Msg_MarketWithdraw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgMarketWithdrawRequest)
if err := dec(in); err != nil {
@@ -2483,6 +2634,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
MethodName: "MarketSettle",
Handler: _Msg_MarketSettle_Handler,
},
+ {
+ MethodName: "MarketSetOrderExternalID",
+ Handler: _Msg_MarketSetOrderExternalID_Handler,
+ },
{
MethodName: "MarketWithdraw",
Handler: _Msg_MarketWithdraw_Handler,
@@ -3058,6 +3213,76 @@ func (m *MsgMarketSettleResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
return len(dAtA) - i, nil
}
+func (m *MsgMarketSetOrderExternalIDRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgMarketSetOrderExternalIDRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgMarketSetOrderExternalIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.ExternalId) > 0 {
+ i -= len(m.ExternalId)
+ copy(dAtA[i:], m.ExternalId)
+ i = encodeVarintTx(dAtA, i, uint64(len(m.ExternalId)))
+ i--
+ dAtA[i] = 0x22
+ }
+ if m.OrderId != 0 {
+ i = encodeVarintTx(dAtA, i, uint64(m.OrderId))
+ i--
+ dAtA[i] = 0x18
+ }
+ if m.MarketId != 0 {
+ i = encodeVarintTx(dAtA, i, uint64(m.MarketId))
+ i--
+ dAtA[i] = 0x10
+ }
+ if len(m.Admin) > 0 {
+ i -= len(m.Admin)
+ copy(dAtA[i:], m.Admin)
+ i = encodeVarintTx(dAtA, i, uint64(len(m.Admin)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *MsgMarketSetOrderExternalIDResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgMarketSetOrderExternalIDResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgMarketSetOrderExternalIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ return len(dAtA) - i, nil
+}
+
func (m *MsgMarketWithdrawRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -4104,6 +4329,38 @@ func (m *MsgMarketSettleResponse) Size() (n int) {
return n
}
+func (m *MsgMarketSetOrderExternalIDRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Admin)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ if m.MarketId != 0 {
+ n += 1 + sovTx(uint64(m.MarketId))
+ }
+ if m.OrderId != 0 {
+ n += 1 + sovTx(uint64(m.OrderId))
+ }
+ l = len(m.ExternalId)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ return n
+}
+
+func (m *MsgMarketSetOrderExternalIDResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ return n
+}
+
func (m *MsgMarketWithdrawRequest) Size() (n int) {
if m == nil {
return 0
@@ -5978,6 +6235,208 @@ func (m *MsgMarketSettleResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *MsgMarketSetOrderExternalIDRequest) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MsgMarketSetOrderExternalIDRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgMarketSetOrderExternalIDRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Admin = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType)
+ }
+ m.MarketId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.MarketId |= uint32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field OrderId", wireType)
+ }
+ m.OrderId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.OrderId |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field ExternalId", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.ExternalId = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MsgMarketSetOrderExternalIDResponse) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MsgMarketSetOrderExternalIDResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgMarketSetOrderExternalIDResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func (m *MsgMarketWithdrawRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0