From ba99b114aafff8175f6b4716958325ecaf0f87a4 Mon Sep 17 00:00:00 2001 From: Stephen Bondor <43558517+StephenBondor@users.noreply.github.com> Date: Thu, 13 Jun 2019 21:28:41 -0700 Subject: [PATCH 1/2] Update Lesson.ipynb line 430: When I encountered this line, my inexperience with Jupyter had me thinking that there was some kind of function defined somewhere and I was like "OK, this doesn't work, but am I supposed to fix it or not?" Line 730: Is a repeat of line 699 Line 785: Comment is the same as the code, converted to English --- 1. Message Structure/Lesson.ipynb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/1. Message Structure/Lesson.ipynb b/1. Message Structure/Lesson.ipynb index 71b685a..0eb3e28 100644 --- a/1. Message Structure/Lesson.ipynb +++ b/1. Message Structure/Lesson.ipynb @@ -415,7 +415,9 @@ "Now how should we deal with these magic bytes in the process of reading and interpreting real Bitcoin network messages? This one is pretty simple -- just check whether they're equal to the values in the wiki / reference implementation!\n", "\n", "![image](../images/magic-values.png)\n", - "##### Exercise 2: Check Network Magic" + "##### Exercise 2: Check Network Magic", + "\n", + "Try and fix the code below to get all the tests to pass:\n" ] }, { @@ -427,7 +429,7 @@ "NETWORK_MAGIC = b'\\xf9\\xbe\\xb4\\xd9'\n", "\n", "def read_magic(stream):\n", - " raise NotImplementedError()\n", + " raise ImplementMeToMakeItWork() # What does this line need to be replaced with? \n", "\n", "def is_mainnet_msg(stream):\n", " magic = read_magic(stream)\n", @@ -581,7 +583,7 @@ "outputs": [], "source": [ "def read_length(stream):\n", - " raise NotImplementedError()" + " raise NotImplementedError() # Fix me!" ] }, { @@ -726,8 +728,6 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Where Bitcoin uses SHA256, it usually uses it twice. [Here's a discussion](https://bitcoin.stackexchange.com/questions/6037/why-are-hashes-in-the-bitcoin-protocol-typically-computed-twice-double-computed) of why Satoshi might have made this decision \n", - "\n", "##### Exercise 8: Write a `compute_checksum` function which returns the first four bytes of \"double-sha256\"" ] }, @@ -782,7 +782,7 @@ "\n", "print(\"Payload: \", payload)\n", "\n", - "print(\"checksum == compute_checksum(payload)?: \", \n", + "print(\"Is the recieved checksum the same as the computed checksum?: \", \n", " checksum == compute_checksum(payload))" ] }, From 08cdc9817a5a26bea02e11a735b77d022bf4b012 Mon Sep 17 00:00:00 2001 From: Stephen Bondor <43558517+StephenBondor@users.noreply.github.com> Date: Thu, 13 Jun 2019 21:34:45 -0700 Subject: [PATCH 2/2] Update Lesson.ipynb Spelling --- 1. Message Structure/Lesson.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1. Message Structure/Lesson.ipynb b/1. Message Structure/Lesson.ipynb index 0eb3e28..efbea58 100644 --- a/1. Message Structure/Lesson.ipynb +++ b/1. Message Structure/Lesson.ipynb @@ -782,7 +782,7 @@ "\n", "print(\"Payload: \", payload)\n", "\n", - "print(\"Is the recieved checksum the same as the computed checksum?: \", \n", + "print(\"Is the received checksum the same as the computed checksum?: \", \n", " checksum == compute_checksum(payload))" ] },