-
Notifications
You must be signed in to change notification settings - Fork 103
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: ecocredit ORM proto definitions #700
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start @technicallyty ! Left a few suggestions
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aaron Craelius <aaron@regen.network>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Don't we have sequences to track for generating class, project and batch IDs?
right, so these would be separate messages/tables right? i think batches are covered now with the addition of the auto_increment id |
Yes separate tables, but I think not quite for batch ID because these batch IDs are unique per project and project IDs unique per class right? |
We also need balances and supply |
actually looks like we were tracking batch sequence in the class via the field i've added a project seq table, and credit/basket balance. looks like the supply was already tracked in |
I sort of have the preference that things that get updated somewhat frequently - like sequences and supply - should live on separate tables from things which rarely or never change. It's not a huge deal, but I want to avoid the pattern that is done some places in the SDK like x/auth where every acct seq update rewrites the whole account with vesting, pub key and all |
ok, added batch sequence and separate batch supply table |
Co-authored-by: Aaron Craelius <aaron@regen.network>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @technicallyty 🎉 !
Just need to fix conflicts |
Co-authored-by: Aaron Craelius <aaron@regen.network>
Codecov Report
@@ Coverage Diff @@
## master #700 +/- ##
=======================================
Coverage 74.80% 74.80%
=======================================
Files 118 118
Lines 19542 19542
=======================================
Hits 14618 14618
Misses 3947 3947
Partials 977 977
Flags with carried forward coverage won't be shown. Click here to find out more. |
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Co-authored-by: Cory <cjlevinson@gmail.com>
// sell_order_id is the sell order ID against which the buyer is trying to buy. | ||
// When sell_order_id is set, this is known as a direct buy order because it | ||
// is placed directly against a specific sell order. | ||
uint64 sell_order_id = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think that would be out of the scope of this PR. this structure was copied from existing proto defs. so i believe this concern would warrant its own issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronc to select multiple orders to fill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this model is just based on buying from a specific sell order. it's not a batch operation. it's like a shopping cart where you buy one product from one vendor
|
||
// next_id is the sequence number for the project | ||
uint64 next_id = 2; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need it? This could be easily done with a simple counter (no need to store the project_id in value).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the format of the project id, when auto-generated, is classID + sequence number. looking at it again, i think actually the project_id field should be class_id. but in any case, the 2 fields are needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be class_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, so ProjectSequence
is a type for a key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@technicallyty if you will be updating the project_id
field, let's update the message
documentation as well.
Description
adds ORM proto definitions for x/ecocredit
Closes: n/a
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change