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

Chapter 11: Exercise 6 & 7 #254

Open
vvronskyFX opened this issue Sep 1, 2022 · 2 comments
Open

Chapter 11: Exercise 6 & 7 #254

vvronskyFX opened this issue Sep 1, 2022 · 2 comments

Comments

@vvronskyFX
Copy link

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
Copy link
Author

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

@alexbarron
Copy link

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 added a commit to alexbarron/programmingbitcoin that referenced this issue Oct 20, 2022
Exercises 6 and 7 of Ch 11 fail to run due to merkleblock not being defined. Importing it in the top cell along with the other files fixes this.

See issue jimmysong#254
alexbarron added a commit to alexbarron/programmingbitcoin that referenced this issue Oct 20, 2022
Exercises 6 and 7 of Ch 11 fail to run due to merkleblock not being defined. Importing it in the top cell along with the other files fixes this.

See issue jimmysong#254
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

No branches or pull requests

2 participants