WIP add enviornment support

This commit is contained in:
lash 2022-02-22 14:47:06 +00:00
parent 79a1123dc8
commit d3f2b1f1fa
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
9 changed files with 37 additions and 4 deletions

View File

@ -1,3 +1,7 @@
- 0.0.27:
* Add man pages
- 0.0.26:
* Remove manual 0x handling bug in tx
- 0.0.25: - 0.0.25:
* Upgrade chainlib to get passphrase file for wallet keyfile * Upgrade chainlib to get passphrase file for wallet keyfile
- 0.0.24: - 0.0.24:

View File

@ -1,3 +1,4 @@
import sys
# external imports # external imports
from chainlib.jsonrpc import JSONRPCRequest from chainlib.jsonrpc import JSONRPCRequest
from chainlib.block import Block as BaseBlock 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 """Implements chainlib.interface.ChainInterface method
""" """
hx = strip_0x(hex(n)) hx = strip_0x(hex(n))
sys.stderr.write('hx {} {}\n'.format(n, hx))
nhx = add_0x(compact(hx), compact_value=True) nhx = add_0x(compact(hx), compact_value=True)
j = JSONRPCRequest(id_generator) j = JSONRPCRequest(id_generator)
o = j.template() o = j.template()

View File

@ -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)))

View File

@ -397,11 +397,13 @@ class TxFactory:
""" """
txe = EIP155Transaction(tx, tx['nonce'], tx['chainId']) txe = EIP155Transaction(tx, tx['nonce'], tx['chainId'])
txes = txe.serialize() txes = txe.serialize()
gas_price = strip_0x(txes['gasPrice'])
gas = strip_0x(txes['gas'])
return { return {
'from': tx['from'], 'from': tx['from'],
'to': txes['to'], 'to': txes['to'],
'gasPrice': '0x' + compact(txes['gasPrice']), 'gasPrice': add_0x(compact(gas_price)),
'gas': '0x' + compact(txes['gas']), 'gas': add_0x(compact(gas)),
'data': txes['data'], 'data': txes['data'],
} }

1
man/gas.env.overrides Normal file
View File

@ -0,0 +1 @@
WALLET_KEY_FILE foobar baz

9
man/gas.head.groff Normal file
View File

@ -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

1
man/gas.overrides Normal file
View File

@ -0,0 +1 @@
a Beneficiary of the gas token transaction.

View File

@ -1,6 +1,6 @@
funga-eth~=0.5.3 funga-eth~=0.5.3
pysha3==1.0.2 pysha3==1.0.2
hexathon~=0.1.3 hexathon~=0.1.5
websocket-client==0.57.0 websocket-client==0.57.0
potaahto~=0.1.0 potaahto~=0.1.0
chainlib~=0.0.19 chainlib~=0.0.19

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = chainlib-eth name = chainlib-eth
version = 0.0.25 version = 0.0.27
description = Ethereum implementation of the chainlib interface description = Ethereum implementation of the chainlib interface
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no