-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implement price API #542
Implement price API #542
Conversation
5ac4393
to
e6004cf
Compare
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
src/aleph/web/controllers/prices.py
Outdated
required_tokens = compute_cost(session=session, content=content) | ||
|
||
return web.Response( | ||
text=MessagePrice(required_tokens=required_tokens).to_json(), |
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 use a dataclass here ?
text=MessagePrice(required_tokens=required_tokens).to_json(), | |
json={"required_tokens": required_tokens}, |
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 suggestion doesn't work, because web.Response
method don't have any json
field.
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 branch should be based on |
f40a897
to
0e91f05
Compare
3553810
to
179f731
Compare
I added the payment type in the JSON response. |
…ance or program VM. Solution: Create a price API to request it just passing the message item hash.
179f731
to
273df6b
Compare
Problem: We are unable to get the required tokens or flow for an instance or program VM.
Solution: Create a price API to request it just passing the message item hash.