AutoPEP8 Python scripts
This commit is contained in:
@@ -22,30 +22,36 @@ from rlp.sedes import big_endian_int, binary, Binary
|
||||
from rlp import Serializable
|
||||
|
||||
try:
|
||||
from Crypto.Hash import keccak
|
||||
sha3_256 = lambda x: keccak.new(digest_bits=256, data=x).digest()
|
||||
from Crypto.Hash import keccak
|
||||
|
||||
def sha3_256(x): return keccak.new(digest_bits=256, data=x).digest()
|
||||
except:
|
||||
import sha3 as _sha3
|
||||
sha3_256 = lambda x: _sha3.sha3_256(x).digest()
|
||||
import sha3 as _sha3
|
||||
|
||||
def sha3_256(x): return _sha3.sha3_256(x).digest()
|
||||
address = Binary.fixed_length(20, allow_empty=True)
|
||||
|
||||
|
||||
def sha3(seed):
|
||||
return sha3_256(str(seed))
|
||||
return sha3_256(str(seed))
|
||||
|
||||
|
||||
class Transaction(Serializable):
|
||||
fields = [
|
||||
('nonce', big_endian_int),
|
||||
('gasprice', big_endian_int),
|
||||
('startgas', big_endian_int),
|
||||
('to', address),
|
||||
('value', big_endian_int),
|
||||
('data', binary),
|
||||
('v', big_endian_int),
|
||||
('r', big_endian_int),
|
||||
('s', big_endian_int),
|
||||
]
|
||||
fields = [
|
||||
('nonce', big_endian_int),
|
||||
('gasprice', big_endian_int),
|
||||
('startgas', big_endian_int),
|
||||
('to', address),
|
||||
('value', big_endian_int),
|
||||
('data', binary),
|
||||
('v', big_endian_int),
|
||||
('r', big_endian_int),
|
||||
('s', big_endian_int),
|
||||
]
|
||||
|
||||
def __init__(self, nonce, gasprice, startgas, to, value, data, v=0, r=0, s=0):
|
||||
super(Transaction, self).__init__(
|
||||
nonce, gasprice, startgas, to, value, data, v, r, s)
|
||||
|
||||
def __init__(self, nonce, gasprice, startgas, to, value, data, v=0, r=0, s=0):
|
||||
super(Transaction, self).__init__(nonce, gasprice, startgas, to, value, data, v, r, s)
|
||||
|
||||
UnsignedTransaction = Transaction.exclude(['v', 'r', 's'])
|
||||
|
||||
Reference in New Issue
Block a user