jimmysong / programmingbitcoin

Repository for the book
Other
1.75k stars 656 forks source link

Chapter 9, Exercise 9 Error #251

Closed vvronskyFX closed 2 years ago

vvronskyFX commented 2 years ago

Getting this output error when running the solution to Exercise 9 in Chapter 9: image

Here's the code that's running the test: image

I've commented out the difficulty portion in this block as pointed out by @bolatovumar here: https://github.com/jimmysong/programmingbitcoin/issues/179

Here's my code for bits_to_target in helper.py: image

Not sure why I'm getting this. Has anyone went through this portion experience this? Cheers for the help!

bolatovumar commented 2 years ago

You are getting a NotImplementedError which means there is some code that's missing that needs to be filled in.

vvronskyFX commented 2 years ago

You are getting a NotImplementedError which means there is some code that's missing that needs to be filled in.

That's why I'm posting in here because i can't find what I may be missing. I went through the solutions and wrote in the code for each exercise.

Getting the same error. It has something to do with this bits_to_target and anything involving target somehow.

vvronskyFX commented 2 years ago

image

Error still appearing in Ex. 10, Ex. 11, Ex. 12. Been scanning around the files trying to see but I haven't found any block of code that has NotImplementedError anywhere. It almost seems like a bug but I'm not sure.

vvronskyFX commented 2 years ago

Right after Ex. 11, the example that goes into "difficulty adjustment" outputs this error: Screen Shot 2022-08-18 at 9 26 39 AM

Could it be something in the packages?

vvronskyFX commented 2 years ago

FIXED!

Solution: Coding calculate_new_bits in Exercise 13. Looks like that was the missing piece. I re-ran the cells again and all tests and exercises passed as they should!

image

Thanks for your support earlier @bolatovumar. I will be closing this issue.