Skip to content

Client block header#862

Merged
braydonf merged 3 commits into
bcoin-org:masterfrom
tynes:client-block-header
Sep 28, 2019
Merged

Client block header#862
braydonf merged 3 commits into
bcoin-org:masterfrom
tynes:client-block-header

Conversation

@tynes

@tynes tynes commented Sep 26, 2019

Copy link
Copy Markdown
Member
  • Adds getBlockHeader method to the NodeClient
  • Adds header method to bcoin-cli
  • Updates tests to use getBlockHeader over get('/header')

Port of bcoin-org/bclient#21

@codecov-io

This comment has been minimized.

@braydonf braydonf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@braydonf

braydonf commented Sep 27, 2019

Copy link
Copy Markdown
Contributor

One thing I noticed when testing, there is an oddity with the behavior for hashes that are not 32 bytes, because of this pattern:

if (hash.length !== 64)
  hash = parseInt(hash, 10);

For example if hash is 3e364f28633de01e6707bb2a4eb78334dbd1f4cb it will become 3, and actually return a block at height 3. This is a pattern that is used several places, so I'll open an issue for it.

@jjggmimi

Copy link
Copy Markdown

Good find

braydonf added a commit that referenced this pull request Sep 28, 2019
@braydonf braydonf merged commit 40dac00 into bcoin-org:master Sep 28, 2019
@braydonf braydonf added this to the 2.0.0 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants