* Used a namedtuple for pending transaction. Issue #689 * Changed field names in namedtuple. Issue #689
This commit is contained in:
parent
9b75a1f0fe
commit
17e90986b8
@ -10,6 +10,7 @@ from ..core.smtlib.visitors import pretty_print, arithmetic_simplifier, translat
|
|||||||
from ..core.state import Concretize,TerminateState
|
from ..core.state import Concretize,TerminateState
|
||||||
import logging
|
import logging
|
||||||
import sys, hashlib
|
import sys, hashlib
|
||||||
|
from collections import namedtuple
|
||||||
if sys.version_info < (3, 6):
|
if sys.version_info < (3, 6):
|
||||||
import sha3
|
import sha3
|
||||||
|
|
||||||
@ -21,6 +22,8 @@ TT256M1 = 2 ** 256 - 1
|
|||||||
TT255 = 2 ** 255
|
TT255 = 2 ** 255
|
||||||
TOOHIGHMEM = 0x1000
|
TOOHIGHMEM = 0x1000
|
||||||
|
|
||||||
|
PendingTransaction = namedtuple("PendingTransaction", ['type', 'address', 'origin', 'price', 'data', 'caller', 'value', 'bytecode', 'header'])
|
||||||
|
|
||||||
def ceil32(x):
|
def ceil32(x):
|
||||||
return Operators.ITEBV(256, (x % 32) == 0, x , x + 32 - (x % 32))
|
return Operators.ITEBV(256, (x % 32) == 0, x , x + 32 - (x % 32))
|
||||||
|
|
||||||
@ -2233,7 +2236,7 @@ class EVMWorld(Platform):
|
|||||||
|
|
||||||
self.storage[address]['storage'] = EVMMemory(self.constraints, 256, 256)
|
self.storage[address]['storage'] = EVMMemory(self.constraints, 256, 256)
|
||||||
|
|
||||||
self._pending_transaction = ('Create', address, origin, price, '', origin, balance, ''.join(init), header)
|
self._pending_transaction = PendingTransaction('Create', address, origin, price, '', origin, balance, ''.join(init), header)
|
||||||
|
|
||||||
if run:
|
if run:
|
||||||
assert False
|
assert False
|
||||||
@ -2282,7 +2285,7 @@ class EVMWorld(Platform):
|
|||||||
else:
|
else:
|
||||||
data = ''.join(data)
|
data = ''.join(data)
|
||||||
bytecode = self.get_code(address)
|
bytecode = self.get_code(address)
|
||||||
self._pending_transaction = ('Call', address, origin, price, data, caller, value, bytecode, header)
|
self._pending_transaction = PendingTransaction('Call', address, origin, price, data, caller, value, bytecode, header)
|
||||||
|
|
||||||
if run:
|
if run:
|
||||||
assert self.depth == 0
|
assert self.depth == 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user