-
Notifications
You must be signed in to change notification settings - Fork 0
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
dapp: Refactor to use smart meter API calls + bring back Eve and draw energy consumption graph #74
Conversation
Don't merge this yet |
const unitPrice = await contract.unitPrice(); | ||
contracts.push({contractAddr, unitPrice, offeredAmount}) | ||
contracts.push({contractAddr: contractAddr, unitPrice: unitPrice, offeredAmount: offeredAmount}) |
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?
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 that I can access the fields by their name?
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.
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.
Oh right, I forgot about those. Will change
Please rebase master and cherry pick commits related to this PR |
dapp/src/client/scripts/app.jsx
Outdated
async getAvailableContracts() { | ||
fetch('http://localhost:3000/contract/available_contracts') | ||
.then(response => response.json()) | ||
.then(contracts => contracts.filter((c) => c.offeredAmount > 0)) |
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.
You shouldn't need to do that i suppose
dapp/src/client/scripts/app.jsx
Outdated
async getSellerContracts() { | ||
fetch('http://localhost:3000/contract/my_seller_contracts') | ||
.then(response => response.json()) | ||
.then(contracts => contracts.filter((c) => c.offeredAmount > 0)) |
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.
ditto
Closing |
The energy consumption graph is now drawn, using real data fetched from the smart meter Eve API.