Skip to content

Instantly share code, notes, and snippets.

@kdembler
Last active June 9, 2020 20:29
Show Gist options
  • Save kdembler/a65d7cbed71608c6188bc5f54e5e26c2 to your computer and use it in GitHub Desktop.
Save kdembler/a65d7cbed71608c6188bc5f54e5e26c2 to your computer and use it in GitHub Desktop.
from eth_account._utils.transactions import serializable_unsigned_transaction_from_dict
from web3 import Web3
transaction = {
'to': Web3.toChecksumAddress('0x4d6bb4ed029b33cf25d0810b029bd8b1a6bcab7b'),
'gas': 21000,
'gasPrice': 10000000000,
'nonce': 1,
'value': 1,
}
serializable_transaction = serializable_unsigned_transaction_from_dict(transaction)
transaction_hash = serializable_transaction.hash()
print(transaction_hash.hex())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment