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

dapp: Refactor to use smart meter API calls + bring back Eve and draw energy consumption graph #74

Closed
wants to merge 7 commits into from

Conversation

Norbo11
Copy link
Collaborator

@Norbo11 Norbo11 commented Nov 17, 2017

The energy consumption graph is now drawn, using real data fetched from the smart meter Eve API.

@Norbo11
Copy link
Collaborator Author

Norbo11 commented Nov 17, 2017

Don't merge this yet

const unitPrice = await contract.unitPrice();
contracts.push({contractAddr, unitPrice, offeredAmount})
contracts.push({contractAddr: contractAddr, unitPrice: unitPrice, offeredAmount: offeredAmount})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why?

Copy link
Collaborator Author

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?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

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

@fangyi-zhou
Copy link
Collaborator

Please rebase master and cherry pick commits related to this PR

async getAvailableContracts() {
fetch('http://localhost:3000/contract/available_contracts')
.then(response => response.json())
.then(contracts => contracts.filter((c) => c.offeredAmount > 0))
Copy link
Collaborator

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

async getSellerContracts() {
fetch('http://localhost:3000/contract/my_seller_contracts')
.then(response => response.json())
.then(contracts => contracts.filter((c) => c.offeredAmount > 0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@fangyi-zhou
Copy link
Collaborator

Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants