programmingbitcoin icon indicating copy to clipboard operation
programmingbitcoin copied to clipboard

Chapter 11: Exercise 6 & 7

Open vvronskyFX opened this issue 2 years ago • 2 comments

I'm getting an error here when I run the test saying that "NameError: name 'merkleblock' is not defined"

Here's my output: image

Here's my code:

class MerkleBlock: image

Below, I have the 2 solutions to the two exercises respectively: image

I matched it up with the original book solutions and it looks correct from what I can tell.

I tried "MerkleBlock" instead of "merkleblock" and I'm still getting the NameError.

Has anyone encountered this? Any solutions?

vvronskyFX avatar Sep 01 '22 05:09 vvronskyFX

Still stuck with no solution yet. @jimmysong would you have any idea to fix this?

vvronskyFX avatar Sep 02 '22 05:09 vvronskyFX

Yes, I hit the same issue. I resolved it by adding import merkleblock to the top cell in the notebook that loads all the dependencies.

############## PLEASE RUN THIS CELL FIRST! ###################

# import everything and define a test runner function
from importlib import reload
from helper import run
import block
import ecc
import helper
import network
import script
import tx
import merkleblock

alexbarron avatar Oct 20 '22 07:10 alexbarron