@@ -101,8 +101,8 @@ async def test_get_unknown_block_by_hash(request, event_loop):
101
101
async def test_get_canonical_block_range_by_slot (request , event_loop ):
102
102
chain_db = get_fresh_chain_db ()
103
103
base_branch = create_branch (3 , root = chain_db .get_canonical_block_by_slot (0 ))
104
- non_canonical_branch = create_branch (3 , root = base_branch [- 1 ])
105
- canonical_branch = create_branch (4 , root = base_branch [- 1 ])
104
+ non_canonical_branch = create_branch (3 , root = base_branch [- 1 ], state_root = b" \x00 " * 32 )
105
+ canonical_branch = create_branch (4 , root = base_branch [- 1 ], state_root = b" \x11 " * 32 )
106
106
for branch in [base_branch , non_canonical_branch , canonical_branch ]:
107
107
chain_db .persist_block_chain (branch )
108
108
@@ -121,8 +121,8 @@ async def test_get_canonical_block_range_by_slot(request, event_loop):
121
121
async def test_get_canonical_block_range_by_hash (request , event_loop ):
122
122
chain_db = get_fresh_chain_db ()
123
123
base_branch = create_branch (3 , root = chain_db .get_canonical_block_by_slot (0 ))
124
- non_canonical_branch = create_branch (3 , root = base_branch [- 1 ])
125
- canonical_branch = create_branch (4 , root = base_branch [- 1 ])
124
+ non_canonical_branch = create_branch (3 , root = base_branch [- 1 ], state_root = b" \x00 " * 32 )
125
+ canonical_branch = create_branch (4 , root = base_branch [- 1 ], state_root = b" \x11 " * 32 )
126
126
for branch in [base_branch , non_canonical_branch , canonical_branch ]:
127
127
chain_db .persist_block_chain (branch )
128
128
@@ -141,8 +141,8 @@ async def test_get_canonical_block_range_by_hash(request, event_loop):
141
141
async def test_get_incomplete_canonical_block_range (request , event_loop ):
142
142
chain_db = get_fresh_chain_db ()
143
143
base_branch = create_branch (3 , root = chain_db .get_canonical_block_by_slot (0 ))
144
- non_canonical_branch = create_branch (3 , root = base_branch [- 1 ])
145
- canonical_branch = create_branch (4 , root = base_branch [- 1 ])
144
+ non_canonical_branch = create_branch (3 , root = base_branch [- 1 ], state_root = b" \x00 " * 32 )
145
+ canonical_branch = create_branch (4 , root = base_branch [- 1 ], state_root = b" \x11 " * 32 )
146
146
for branch in [base_branch , non_canonical_branch , canonical_branch ]:
147
147
chain_db .persist_block_chain (branch )
148
148
@@ -161,8 +161,8 @@ async def test_get_incomplete_canonical_block_range(request, event_loop):
161
161
async def test_get_non_canonical_branch (request , event_loop ):
162
162
chain_db = get_fresh_chain_db ()
163
163
base_branch = create_branch (3 , root = chain_db .get_canonical_block_by_slot (0 ))
164
- non_canonical_branch = create_branch (3 , root = base_branch [- 1 ])
165
- canonical_branch = create_branch (4 , root = base_branch [- 1 ])
164
+ non_canonical_branch = create_branch (3 , root = base_branch [- 1 ], state_root = b" \x00 " * 32 )
165
+ canonical_branch = create_branch (4 , root = base_branch [- 1 ], state_root = b" \x11 " * 32 )
166
166
for branch in [base_branch , non_canonical_branch , canonical_branch ]:
167
167
chain_db .persist_block_chain (branch )
168
168
@@ -173,5 +173,5 @@ async def test_get_non_canonical_branch(request, event_loop):
173
173
174
174
assert isinstance (response .command , BeaconBlocks )
175
175
assert len (response .payload ) == 1
176
- assert [block .slot for block in response .payload ] == [2 ]
176
+ assert [block .slot for block in response .payload ] == [5 ]
177
177
assert response .payload == (non_canonical_branch [1 ],)
0 commit comments