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

Commit 182bb46

Browse files
committed
Merge branch 'state_revamp' of github.com:ethereum/pyethereum into state_revamp
2 parents e16d998 + 13743a4 commit 182bb46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ethereum/tools/tester2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(self, alloc=None, env=None):
112112

113113
@property
114114
def last_tx(self):
115-
return self.txs_this_block[-1] if self.txs_this_block else None
115+
return self.block.transactions[-1] if self.block.transactions else None
116116

117117
def tx(self, sender=k0, to=b'\x00' * 20, value=0, data=b'', startgas=STARTGAS, gasprice=GASPRICE):
118118
sender_addr = privtoaddr(sender)
@@ -135,7 +135,7 @@ def contract(self, sourcecode, args=[], sender=k0, value=0, language='evm', star
135135
code = compiler.compile(sourcecode) + (ct.encode_constructor_arguments(args) if args else b'')
136136
addr = self.tx(sender=sender, to=b'', value=value, data=code, startgas=startgas, gasprice=gasprice)
137137
return ABIContract(self, ct, addr)
138-
138+
139139
def mine(self, number_of_blocks=1, coinbase=a0):
140140
self.cs.finalize(self.head_state, self.block)
141141
set_execution_results(self.head_state, self.block)
@@ -151,6 +151,7 @@ def mine(self, number_of_blocks=1, coinbase=a0):
151151
self.cs.initialize(self.head_state, self.block)
152152

153153
def snapshot(self):
154+
self.head_state.commit()
154155
return self.head_state.snapshot(), len(self.block.transactions), self.block.number
155156

156157
def revert(self, snapshot):

0 commit comments

Comments
 (0)