-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: made some changes to pass grader
* Print Coinbase tx after the serliased coinbase tx * Include coinbase tx in tx_hash_list & tx_id_list -> thus include it in merkle_root & witness_commitment
- Loading branch information
Showing
6 changed files
with
97 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const WITNESS_RESERVED_VALUE = Buffer.from( | ||
'0000000000000000000000000000000000000000000000000000000000000000', | ||
'hex', | ||
) | ||
|
||
// print(WITNESS_RESERVED_VALUE) | ||
console.log(typeof WITNESS_RESERVED_VALUE) | ||
console.log(WITNESS_RESERVED_VALUE.toString('hex')); | ||
|
||
|
||
const str = WITNESS_RESERVED_VALUE.toString('hex'); | ||
let count = 0; | ||
|
||
for (let i = 0; i < str.length; i++) { | ||
if (str[i] === '0') { | ||
count++; | ||
} | ||
} | ||
|
||
console.log("Number of zeros:", count); |