Bump registry
This commit is contained in:
parent
7838244a90
commit
0c43d17816
@ -16,7 +16,7 @@ import argparse
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
# third-party imports
|
# third-party imports
|
||||||
from chainlib.eth.tx import unpack_signed
|
from chainlib.eth.tx import unpack
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.WARNING)
|
logging.basicConfig(level=logging.WARNING)
|
||||||
@ -42,7 +42,7 @@ def main():
|
|||||||
if tx_raw[:2] == '0x':
|
if tx_raw[:2] == '0x':
|
||||||
tx_raw = tx_raw[2:]
|
tx_raw = tx_raw[2:]
|
||||||
tx_raw_bytes = bytes.fromhex(tx_raw)
|
tx_raw_bytes = bytes.fromhex(tx_raw)
|
||||||
tx = unpack_signed(tx_raw_bytes, int(chain_id))
|
tx = unpack(tx_raw_bytes, int(chain_id))
|
||||||
for k in tx.keys():
|
for k in tx.keys():
|
||||||
print('{}: {}'.format(k, tx[k]))
|
print('{}: {}'.format(k, tx[k]))
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ field_debugs = [
|
|||||||
's',
|
's',
|
||||||
]
|
]
|
||||||
|
|
||||||
def unpack_signed(tx_raw_bytes, chain_id=1):
|
def unpack(tx_raw_bytes, chain_id=1):
|
||||||
d = rlp_decode(tx_raw_bytes)
|
d = rlp_decode(tx_raw_bytes)
|
||||||
|
|
||||||
logg.debug('decoding using chain id {}'.format(chain_id))
|
logg.debug('decoding using chain id {}'.format(chain_id))
|
||||||
@ -94,6 +94,13 @@ def unpack_signed(tx_raw_bytes, chain_id=1):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def receipt(hsh):
|
||||||
|
o = jsonrpc_template()
|
||||||
|
o['method'] = 'eth_getTransactionReceipt'
|
||||||
|
o['params'].append(hsh)
|
||||||
|
return o
|
||||||
|
|
||||||
|
|
||||||
class TxFactory:
|
class TxFactory:
|
||||||
|
|
||||||
def __init__(self, signer=None, gas_oracle=None, nonce_oracle=None, chain_id=1):
|
def __init__(self, signer=None, gas_oracle=None, nonce_oracle=None, chain_id=1):
|
||||||
@ -103,12 +110,16 @@ class TxFactory:
|
|||||||
self.signer = signer
|
self.signer = signer
|
||||||
|
|
||||||
|
|
||||||
def build(self, tx):
|
def build_raw(self, tx):
|
||||||
txe = EIP155Transaction(tx, tx['nonce'], tx['chainId'])
|
txe = EIP155Transaction(tx, tx['nonce'], tx['chainId'])
|
||||||
self.signer.signTransaction(txe)
|
self.signer.signTransaction(txe)
|
||||||
tx_raw = txe.rlp_serialize()
|
tx_raw = txe.rlp_serialize()
|
||||||
tx_raw_hex = add_0x(tx_raw.hex())
|
tx_raw_hex = add_0x(tx_raw.hex())
|
||||||
tx_hash_hex = add_0x(keccak256_hex_to_hex(tx_raw_hex))
|
tx_hash_hex = add_0x(keccak256_hex_to_hex(tx_raw_hex))
|
||||||
|
return (tx_hash_hex, tx_raw_hex)
|
||||||
|
|
||||||
|
def build(self, tx):
|
||||||
|
(tx_hash_hex, tx_raw_hex) = self.build_raw(tx)
|
||||||
|
|
||||||
o = jsonrpc_template()
|
o = jsonrpc_template()
|
||||||
o['method'] = 'eth_sendRawTransaction'
|
o['method'] = 'eth_sendRawTransaction'
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
cryptocurrency-cli-tools==0.0.4
|
cryptocurrency-cli-tools~=0.0.4
|
||||||
faker==4.17.1
|
faker==4.17.1
|
||||||
crypto-dev-signer~=0.4.13rc2
|
crypto-dev-signer~=0.4.13rc2
|
||||||
pysha3==1.0.2
|
pysha3==1.0.2
|
||||||
hexathon==0.0.1a2
|
hexathon~=0.0.1a3
|
||||||
eth-abi==2.1.1
|
eth-abi==2.1.1
|
||||||
eth-keys==0.3.3
|
eth-keys==0.3.3
|
||||||
websocket-client==0.57.0
|
websocket-client==0.57.0
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = chainlib
|
name = chainlib
|
||||||
version = 0.0.1a11
|
version = 0.0.1a12
|
||||||
description = Generic blockchain access library and tooling
|
description = Generic blockchain access library and tooling
|
||||||
author = Louis Holbrook
|
author = Louis Holbrook
|
||||||
author_email = dev@holbrook.no
|
author_email = dev@holbrook.no
|
||||||
|
Loading…
Reference in New Issue
Block a user