Skip to content

Commit

Permalink
feat(marketplace): cancel sell order (#891)
Browse files Browse the repository at this point in the history
* feat: escrow credits

* fix: revert mock times

* fix: typo

* chore: add event emission to sell

* fix: assert precision of sell order qty

* feat: pruning

* chore: fmt.Errorf -> sdkerrors.ErrInvalidRequest

* feat: cancel sell order

* chore: conflict

* chore: revert

* fix: comment

* chore: godoc

* chore: gomod/cleanup

* chore: cleanup imports

Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com>
  • Loading branch information
technicallyty and technicallyty authored Mar 25, 2022
1 parent db2a640 commit 907d8c1
Show file tree
Hide file tree
Showing 10 changed files with 1,789 additions and 294 deletions.
1,356 changes: 1,148 additions & 208 deletions api/regen/ecocredit/marketplace/v1/tx.pulsar.go

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go

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

16 changes: 16 additions & 0 deletions proto/regen/ecocredit/marketplace/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ service Msg {
// UpdateSellOrders updates existing sell orders.
rpc UpdateSellOrders(MsgUpdateSellOrders) returns (MsgUpdateSellOrdersResponse);

// CancelSellOrder cancels a sell order and returns the funds from escrow.
rpc CancelSellOrder(MsgCancelSellOrder) returns (MsgCancelSellOrderResponse);

// Buy creates credit buy orders.
rpc Buy (MsgBuy) returns (MsgBuyResponse);

Expand Down Expand Up @@ -104,6 +107,19 @@ message MsgUpdateSellOrders {
// MsgUpdateSellOrdersResponse is the Msg/UpdateSellOrders response type.
message MsgUpdateSellOrdersResponse {}

// MsgCancelSellOrder is the Msg/CancelSellOrder request type.
message MsgCancelSellOrder {

// seller is the address of the seller.
string seller = 1;

// sell_order_id is the id of the seller order to cancel.
uint64 sell_order_id = 2;
}

// MsgCancelSellOrder is the Msg/CancelSellOrder response type.
message MsgCancelSellOrderResponse {}

// MsgBuy is the Msg/Buy request type.
message MsgBuy {

Expand Down
3 changes: 2 additions & 1 deletion x/ecocredit/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/gogo/protobuf v1.3.3
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.7
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
Expand Down Expand Up @@ -68,7 +69,6 @@ require (
github.com/gogo/gateway v1.1.0 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down Expand Up @@ -125,6 +125,7 @@ require (
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
Expand Down
Loading

0 comments on commit 907d8c1

Please sign in to comment.