py3port: support pyethereum >v2.3.2 (b704a5c)

This commit is contained in:
The MMGen Project 2019-02-05 10:57:31 +00:00
commit 0b9a3fb0d8
2 changed files with 4 additions and 4 deletions

View file

@ -104,10 +104,9 @@ class Token(MMGenObject): # ERC20
'data': unhexlify(data) }
def txsign(self,tx_in,key,from_addr,chain_id=None):
tx = Transaction(**tx_in)
if chain_id is None:
chain_id = int(g.rpch.parity_chainId(),16)
tx.sign(key,chain_id)
tx = Transaction(**tx_in).sign(key,chain_id)
hex_tx = hexlify(rlp.encode(tx))
coin_txid = CoinTxID(hexlify(tx.hash))
if hexlify(tx.sender).decode() != from_addr:

View file

@ -286,8 +286,9 @@ class EthereumMMGenTX(MMGenTX):
'data': unhexlify(d['data'])}
from ethereum.transactions import Transaction
etx = Transaction(**d_in)
etx.sign(wif,d['chainId'])
etx = Transaction(**d_in).sign(wif,d['chainId'])
assert hexlify(etx.sender).decode() == d['from'],(
'Sender address recovered from signature does not match true sender')
import rlp
self.hex = hexlify(rlp.encode(etx))
self.coin_txid = CoinTxID(hexlify(etx.hash))