Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 3c248e9

Browse files
committed
fix: test_chain.py
1 parent 30ee096 commit 3c248e9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ethereum/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ def init_from_header(cls, header_rlp, db):
600600
:param header_rlp: the RLP encoded block header
601601
:param db: the database for the block
602602
"""
603-
header = rlp.decode(rlpdata, BlockHeader, db=db)
603+
header = rlp.decode(header_rlp, BlockHeader, db=db)
604604
return cls(header, None, [], db=db)
605605

606606
@classmethod

ethereum/tests/test_chain.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ def test_simple_chain():
394394
assert chain.index.get_transaction(tx.hash) == (tx, blk2, 0)
395395

396396

397-
@pytest.mark.xfail
398397
def test_add_side_chain():
399398
""""
400399
Local: L0, L1, L2
@@ -423,11 +422,13 @@ def test_add_side_chain():
423422
# receive serialized remote blocks, newest first
424423
transient_blocks = [rlp.decode(rlp.encode(R0), blocks.TransientBlock),
425424
rlp.decode(rlp.encode(R1), blocks.TransientBlock)]
426-
chain.receive_chain(transient_blocks=transient_blocks)
425+
for t_block in transient_blocks:
426+
block = blocks.Block(t_block.header, t_block.transaction_list, t_block.uncles, db=chain.db)
427+
chain.add_block(block)
428+
427429
assert L2.hash in chain
428430

429431

430-
@pytest.mark.xfail
431432
def test_add_longer_side_chain():
432433
""""
433434
Local: L0, L1, L2
@@ -457,7 +458,11 @@ def test_add_longer_side_chain():
457458
# receive serialized remote blocks, newest first
458459
transient_blocks = [rlp.decode(rlp.encode(b), blocks.TransientBlock)
459460
for b in remote_blocks]
460-
chain.receive_chain(transient_blocks=transient_blocks)
461+
462+
for t_block in transient_blocks:
463+
block = blocks.Block(t_block.header, t_block.transaction_list, t_block.uncles, db=chain.db)
464+
chain.add_block(block)
465+
461466
assert chain.head == remote_blocks[-1]
462467

463468

0 commit comments

Comments
 (0)