Update to Python3

This commit is contained in:
Clément Péron
2019-01-16 11:07:31 +01:00
parent 8c36aed554
commit db533b13b0
5 changed files with 74 additions and 45 deletions

View File

@@ -53,5 +53,22 @@ class Transaction(Serializable):
super(Transaction, self).__init__(
nonce, gasprice, startgas, to, value, data, v, r, s)
class UnsignedTransaction(Serializable):
fields = [
('nonce', big_endian_int),
('gasprice', big_endian_int),
('startgas', big_endian_int),
('to', address),
('value', big_endian_int),
('data', binary),
]
UnsignedTransaction = Transaction.exclude(['v', 'r', 's'])
def unsigned_tx_from_tx(tx):
return UnsignedTransaction(
nonce=tx.nonce,
gasprice=tx.gasprice,
startgas=tx.startgas,
to=tx.to,
value=tx.value,
data=tx.data,
)