Skip to content

Commit

Permalink
Merge pull request #60 from TAdev0/generate_blocks
Browse files Browse the repository at this point in the history
[feat] Generate most important blocks
  • Loading branch information
maciejka authored Aug 12, 2024
2 parents 72c5c74 + 0632242 commit 09d4330
Show file tree
Hide file tree
Showing 15 changed files with 731,124 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/data/block_filter.jq
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def txin:

def txout:
"TxOut {
value: \(.value*100000000)_u64,
value: \((.value*100000000) | round)_u64,
pk_script: from_base16(\"\(.scriptPubKey.hex)\"),
}"
;
Expand Down
15 changes: 13 additions & 2 deletions scripts/data/get_blocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@ get_single_block() {

main() {
local block_hashes=(
"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" # Genesis block
"00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee" # Block containing first P2P tx to Hal Finney
"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" # Genesis block (0)
"00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee" # Block containing first P2P tx to Hal Finney (170)
"00000000132fbe8314fc571c0be60b31ccd461c9ee85f42bde8c6d160a9dacc0" # Bloc containing first off ramp tx from Martti Malmi (24835)
"00000000152340ca42227603908689183edc47355204e7aca59383b0aaac1fd8" # Block containing pizza tx (57043)
"000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e" # First halving block (210000)
"000000000000000002cce816c0ab2c5c269cb081896b7dcb34b8422d6b74ffa1" # Second halving block (420000)
"0000000000000000011865af4122fe3b144e2cbeea86142e8ff2fb4107352d43" # Bitcoin Cash hard fork block (478558)
"0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893" # Segwit soft fork block (481824)
"000000000000000000e5438564434edaf41e63829a637521a96235adf4653e1b" # Bitcoin Gold hard fork block (491407)
"000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d" # Third halving block (630000)
"0000000000000000000687bca986194dc2c1f949318629b44bb54ec0a94d8244" # Taproot soft fort block (709632)
"0000000000000000000515e202c8ae73c8155fc472422d7593af87aa74f2cf3d" # Biggest block in Bitcoin history - Taproot Wizards (774628)
"0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5" # Fourth halving block (840000)
)

# Loop through the block hashes and call get_block.sh for each
Expand Down
15 changes: 15 additions & 0 deletions tests/blocks.cairo
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
mod block_0;
mod block_170;
mod block_24835;
mod block_57043;
// mod block_210000;
// mod block_420000;
// mod block_478558;
// mod block_481824;
// mod block_491407;
// mod block_630000;
// mod block_709632;
// mod block_774628;
// mod block_840000;

// Blocks that are commented are too big and make compilation when running tests almost impossible


22,278 changes: 22,278 additions & 0 deletions tests/blocks/block_210000.cairo

Large diffs are not rendered by default.

945 changes: 945 additions & 0 deletions tests/blocks/block_24835.cairo

Large diffs are not rendered by default.

Loading

0 comments on commit 09d4330

Please sign in to comment.