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

Commit 58c9685

Browse files
author
Jan Xie
committed
merge fixes
1 parent 8417328 commit 58c9685

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

ethereum/experimental/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from ethereum.experimental import pruning_trie, refcount_db

ethereum/experimental/refcount_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import rlp
22
import ethereum.utils as utils
33
import sys
4-
from .db import BaseDB
4+
from ethereum.db import BaseDB
55

66
DEATH_ROW_OFFSET = 2**62
77
ZERO_ENCODED = utils.encode_int(0)

ethereum/snapshot.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import rlp
22
from ethereum.block import BlockHeader, Block
33
from ethereum.utils import is_numeric, is_string, encode_hex, decode_hex, zpad, scan_bin, big_endian_to_int
4-
from ethereum import state_transition
4+
from ethereum import common
5+
from ethereum.pow import consensus
56
from ethereum.state import State, Account
67
from ethereum.securetrie import SecureTrie
78
from ethereum.trie import BLANK_NODE, BLANK_ROOT
8-
from ethereum.pruning_trie import Trie
9+
from ethereum.experimental.pruning_trie import Trie
910

1011

1112
class FakeHeader(object):
@@ -112,27 +113,27 @@ def load_snapshot(chain, snapshot):
112113
chain.env.db.commit()
113114

114115
print "Start loading recent blocks from snapshot"
115-
vbh = state_transition.validate_block_header
116-
vus = state_transition.validate_uncles
116+
vbh = common.validate_header
117+
vus = consensus.validate_uncles
117118
def _vbh(state, header):
118119
return True
119120
def _vus(state, block):
120121
return True
121-
state_transition.validate_block_header = _vbh
122-
state_transition.validate_uncles = _vus
122+
common.validate_header = _vbh
123+
consensus.validate_uncles = _vus
123124
# add the first block
124125
first_block = rlp.decode(first_block_rlp, sedes=Block)
125126
chain.head_hash = first_block.header.prevhash
126127
chain.add_block(first_block)
127128
assert chain.head_hash == first_block.header.hash
128-
state_transition.validate_block_header = vbh
129+
common.validate_header = vbh
129130

130131
count = 0
131132
for block_rlp in snapshot['blocks'][1:]:
132133
block_rlp = scan_bin(block_rlp)
133134
block = rlp.decode(block_rlp, Block)
134135
if count == chain.state.config['MAX_UNCLE_DEPTH']+2:
135-
state_transition.validate_uncles = vus
136+
consensus.validate_uncles = vus
136137
if not chain.add_block(block):
137138
print "Failed to load block #%d (%s), abort." % (block.number, encode_hex(block.hash)[:8])
138139
else:

0 commit comments

Comments
 (0)