-
Notifications
You must be signed in to change notification settings - Fork 22
Add Aleph Credits system with balance tracking and API endpoints #827
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
base: main
Are you sure you want to change the base?
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.
I think this PR is not base on main, because have code changes from the pricing recalculation, please rebase it on main or change the base branch here on GitHub.
Also, I have put some comments on the credit implementation.
# Build the initial pricing model from DEFAULT_PRICE_AGGREGATE | ||
initial_pricing_model = build_default_pricing_model() |
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.
Change a migration already executed it's not a good thing, as it can create differences with the nodes that have the previous migration.
) | ||
|
||
__table_args__ = ( | ||
UniqueConstraint("tx_hash", name="credit_balances_tx_hash_uindex"), |
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 unique constraint is only valid for provider transactions, but not for "free" credit transactions that don't have transactions itself.
model_config = ConfigDict(from_attributes=True) | ||
|
||
address: str | ||
credits: FloatDecimal |
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 we agreed to not allow decimals on credits.
Summary
Changes
Test plan