diff --git a/CHANGELOG b/CHANGELOG index 02d2f73..2fd23d2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +- 0.0.27: + * Add man pages +- 0.0.26: + * Remove manual 0x handling bug in tx - 0.0.25: * Upgrade chainlib to get passphrase file for wallet keyfile - 0.0.24: diff --git a/chainlib/eth/block.py b/chainlib/eth/block.py index 861ec97..11c2cbe 100644 --- a/chainlib/eth/block.py +++ b/chainlib/eth/block.py @@ -1,3 +1,4 @@ +import sys # external imports from chainlib.jsonrpc import JSONRPCRequest from chainlib.block import Block as BaseBlock @@ -35,6 +36,7 @@ def block_by_number(n, include_tx=True, id_generator=None): """Implements chainlib.interface.ChainInterface method """ hx = strip_0x(hex(n)) + sys.stderr.write('hx {} {}\n'.format(n, hx)) nhx = add_0x(compact(hx), compact_value=True) j = JSONRPCRequest(id_generator) o = j.template() diff --git a/chainlib/eth/runnable/flags.py b/chainlib/eth/runnable/flags.py new file mode 100644 index 0000000..5235685 --- /dev/null +++ b/chainlib/eth/runnable/flags.py @@ -0,0 +1,14 @@ +# standard imports +import sys + +# external imports +import chainlib.eth.cli +from hexathon import add_0x + +cmds = { + 'gas': chainlib.eth.cli.argflag_std_write | chainlib.eth.cli.Flag.WALLET, + } + +if __name__ == '__main__': + b = cmds[sys.argv[1]] + print(add_0x(hex(b))) diff --git a/chainlib/eth/tx.py b/chainlib/eth/tx.py index 9c43eb8..bdbbdcc 100644 --- a/chainlib/eth/tx.py +++ b/chainlib/eth/tx.py @@ -397,11 +397,13 @@ class TxFactory: """ txe = EIP155Transaction(tx, tx['nonce'], tx['chainId']) txes = txe.serialize() + gas_price = strip_0x(txes['gasPrice']) + gas = strip_0x(txes['gas']) return { 'from': tx['from'], 'to': txes['to'], - 'gasPrice': '0x' + compact(txes['gasPrice']), - 'gas': '0x' + compact(txes['gas']), + 'gasPrice': add_0x(compact(gas_price)), + 'gas': add_0x(compact(gas)), 'data': txes['data'], } diff --git a/man/gas.env.overrides b/man/gas.env.overrides new file mode 100644 index 0000000..587ab49 --- /dev/null +++ b/man/gas.env.overrides @@ -0,0 +1 @@ +WALLET_KEY_FILE foobar baz diff --git a/man/gas.head.groff b/man/gas.head.groff new file mode 100644 index 0000000..6e058ab --- /dev/null +++ b/man/gas.head.groff @@ -0,0 +1,9 @@ +.TH eth-gas 1 +.SH NAME +eth-gas - Create EVM gas token transaction +.SH SYNOPSIS +\fBeth-gas\fP -a RECIPIENT -y KEYFILE [ --fee-price PRICE ] [ --fee-limit LIMIT ] [ --nonce NONCE ] [ -s ] [ -u ] AMOUNT +.SH DESCRIPTION +\fBeth-gas\fP generates serialized gas token transactions. + +.SS OPTIONS diff --git a/man/gas.overrides b/man/gas.overrides new file mode 100644 index 0000000..46ed8f8 --- /dev/null +++ b/man/gas.overrides @@ -0,0 +1 @@ +a Beneficiary of the gas token transaction. diff --git a/requirements.txt b/requirements.txt index 61057a8..331a050 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ funga-eth~=0.5.3 pysha3==1.0.2 -hexathon~=0.1.3 +hexathon~=0.1.5 websocket-client==0.57.0 potaahto~=0.1.0 chainlib~=0.0.19 diff --git a/setup.cfg b/setup.cfg index d20bb01..ade232d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = chainlib-eth -version = 0.0.25 +version = 0.0.27 description = Ethereum implementation of the chainlib interface author = Louis Holbrook author_email = dev@holbrook.no