py3port: support pyethereum >v2.3.2 (b704a5c)
This commit is contained in:
parent
c2675c15ed
commit
0b9a3fb0d8
2 changed files with 4 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue