Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(marketplace): escrow sell order credits #878

Merged
merged 11 commits into from
Mar 15, 2022
215 changes: 183 additions & 32 deletions api/regen/ecocredit/v1/state.pulsar.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions proto/regen/ecocredit/v1/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ message BatchBalance {

// retired is the retired amount of credits
string retired = 4;

// escrowed is the amount of credits locked up in escrow for the marketplace.
string escrowed = 5;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is escrowed there right user facing name? Maybe in_sell_orders?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a specific concern you have regarding users and the word escrowed? i felt like it was a good fit - in_sell_orders seems a bit verbose

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could go either way. in_sell_orders is more specific and potentially more user friendly but provided the supporting documentation, escrowed seems ok to me as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about you make a call @ryanchristo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, escrowed it is. More aligned with tradable and retired.

}

// BatchSupply tracks the supply of a credit batch
Expand All @@ -220,4 +223,8 @@ message BatchSupply {
// cancelled, effectively undoing the issuance. The sum of total_amount and
// amount_cancelled will always equal the original credit issuance amount.
string cancelled_amount = 4;

// escrowed_amount is the amount of credits in the batch that have been
// locked up in escrow for use in the marketplace.
string escrowed_amount = 5;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to have a separate supply here? I guess maybe that's a useful invariant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seemed right to have it as the credits aren't necessarily tradable nor retired. if anything, it might be useful to be able to query a batch to see how many credits are in the market?

}
2 changes: 1 addition & 1 deletion x/data/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ require (
github.com/tendermint/tendermint v0.34.15
google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf
google.golang.org/grpc v1.44.0
google.golang.org/protobuf v1.27.1
)

require (
Expand Down Expand Up @@ -118,6 +117,7 @@ require (
golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.27.1 // 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
215 changes: 161 additions & 54 deletions x/ecocredit/core/state.pb.go

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

Loading