Add raw args option

This commit is contained in:
nolash 2021-12-06 19:00:55 +01:00
parent 6474a2399a
commit bfbb1dea26
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
4 changed files with 5 additions and 3 deletions

View File

@ -55,7 +55,7 @@ config_dir = os.path.join(script_dir, '..', 'data', 'config')
arg_flags = chainlib.eth.cli.argflag_std_write | chainlib.eth.cli.Flag.EXEC arg_flags = chainlib.eth.cli.argflag_std_write | chainlib.eth.cli.Flag.EXEC
argparser = chainlib.eth.cli.ArgumentParser(arg_flags) argparser = chainlib.eth.cli.ArgumentParser(arg_flags)
argparser.add_argument('--notx', type=str, help='Network send is not a transaction') argparser.add_argument('--notx', action='store_true', help='Network send is not a transaction')
argparser.add_argument('--signature', type=str, help='Method signature to encode') argparser.add_argument('--signature', type=str, help='Method signature to encode')
argparser.add_argument('contract_args', type=str, nargs='*', help='arguments to encode') argparser.add_argument('contract_args', type=str, nargs='*', help='arguments to encode')
args = argparser.parse_args() args = argparser.parse_args()

View File

@ -420,6 +420,8 @@ class TxFactory:
return self.build(tx, id_generator=id_generator) return self.build(tx, id_generator=id_generator)
elif tx_format == TxFormat.RLP_SIGNED: elif tx_format == TxFormat.RLP_SIGNED:
return self.build_raw(tx) return self.build_raw(tx)
elif tx_format == TxFormat.RAW_ARGS:
return strip_0x(tx['data'])
raise NotImplementedError('tx formatting {} not implemented'.format(tx_format)) raise NotImplementedError('tx formatting {} not implemented'.format(tx_format))

View File

@ -3,5 +3,5 @@ pysha3==1.0.2
hexathon~=0.1.0 hexathon~=0.1.0
websocket-client==0.57.0 websocket-client==0.57.0
potaahto~=0.1.0 potaahto~=0.1.0
chainlib~=0.0.12 chainlib~=0.0.13
confini~=0.5.1 confini~=0.5.1

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = chainlib-eth name = chainlib-eth
version = 0.0.13a1 version = 0.0.13
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