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

Update blockchain readme example #836

Merged
merged 3 commits into from
Aug 21, 2020
Merged

Conversation

ryanio
Copy link
Contributor

@ryanio ryanio commented Aug 18, 2020

This PR updates the blockchain example in the readme after the changes in #833.

Note: the geth example may not be working anymore due to changes to the geth db structure (see #745), so we may want to consider using another example here.

@codecov
Copy link

codecov bot commented Aug 18, 2020

Codecov Report

Merging #836 into master will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

Flag Coverage Δ
#account 92.85% <ø> (ø)
#block 78.06% <ø> (+0.22%) ⬆️
#blockchain 81.33% <ø> (+0.30%) ⬆️
#common 93.98% <ø> (ø)
#ethash 83.33% <ø> (+1.11%) ⬆️
#tx 94.16% <ø> (ø)
#vm 92.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

},
(err) => console.log(err || 'Done.'),
)
blockchain.iterator('i', (block) => {
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended to leave the await here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes the await would be useful for awaiting until the iterator is finished before moving onto the next line of code but since there is none I thought it’d be okay (and then I’d have to wrap it in an inner async func since you can’t await from the top level). I didn’t actually test it but I think it’ll work like that! Please correct me if I’m wrong :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess another option could be to add a .then(() => { console.log('Done.') }).catch(console.error)

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Looks good.

@holgerd77 holgerd77 merged commit 1fcdc83 into master Aug 21, 2020
@holgerd77 holgerd77 deleted the update-blockchain-readme branch August 21, 2020 15:03
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