Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Add expect for previousHash to addBlock test #112

Merged

Conversation

delventhalz
Copy link
Contributor

Fixes #96

Ensures that students set the previousHash properly when adding blocks to the blockchain. Previously this was not checked.

To test:

cd code/part-one/
npm install
npm test

These tests should all pass. Then if you modify line 140 of code/part-one/blockchain.js so it reads:

    const block = new Block(transactions, this.getHeadBlock().previousHash);

This is an error, and if you run npm test again, it should be caught by the tests. Previously it would have been missed.

Fixes hyperledger-archives#96

Ensures that students set the previousHash properly when adding blocks
to the blockchain. Previously this was not checked.

Signed-off-by: Zac Delventhal <delventhalz@gmail.com>
@therobinkim
Copy link
Contributor

lgtm -- tested & confirmed working on my end!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants