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

Fix bug when calling REST method with extension bin #43

Merged
merged 1 commit into from
Nov 17, 2017

Conversation

pedrobranco
Copy link
Collaborator

This PR fixes a bug when calling REST methods with extension: bin which were retrieving invalid data on response buffer.

@pedrobranco pedrobranco self-assigned this Oct 31, 2017
@pedrobranco pedrobranco force-pushed the bugfix/fix-bug-in-rest-with-bin-extension branch from 4deab74 to cb7161f Compare October 31, 2017 19:41
@pedrobranco pedrobranco force-pushed the bugfix/fix-bug-in-rest-with-bin-extension branch 2 times, most recently from 9ce9a14 to c2fc2f6 Compare November 17, 2017 15:15

hex.should.endWith('cf900000000\n');
});
it('should match a transaction binary-encoded with hex-encoded', async () => {
Copy link
Owner

Choose a reason for hiding this comment

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

I would keep the same description as the test implementation is not really important in this case.

@@ -434,13 +434,26 @@ describe('Client', () => {
block.should.have.keys('bits', 'chainwork', 'confirmations', 'difficulty', 'hash', 'height', 'mediantime', 'merkleroot', 'nextblockhash', 'nonce', 'size', 'strippedsize', 'time', 'tx', 'version', 'versionHex', 'weight');
block.tx.should.matchEach(value => value.should.be.a.String());
});

it('should match a transaction binary-encoded with hex-encoded', async () => {
Copy link
Owner

Choose a reason for hiding this comment

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

a block?

Copy link
Owner

Choose a reason for hiding this comment

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

Or keep the original test description:

should return a block binary-encoded if extension is `bin`

@pedrobranco pedrobranco force-pushed the bugfix/fix-bug-in-rest-with-bin-extension branch from c2fc2f6 to 492c82f Compare November 17, 2017 15:43
@ruimarinho ruimarinho force-pushed the bugfix/fix-bug-in-rest-with-bin-extension branch from 492c82f to b360dfc Compare November 17, 2017 18:06
@ruimarinho ruimarinho force-pushed the bugfix/fix-bug-in-rest-with-bin-extension branch from b360dfc to fdd41f8 Compare November 17, 2017 18:57
@ruimarinho ruimarinho merged commit 73c702f into master Nov 17, 2017
@ruimarinho ruimarinho deleted the bugfix/fix-bug-in-rest-with-bin-extension branch November 17, 2017 19:01
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.

2 participants