diff --git a/chainlib/eth/runnable/decode.py b/chainlib/eth/runnable/decode.py index b25ca35..632a62f 100644 --- a/chainlib/eth/runnable/decode.py +++ b/chainlib/eth/runnable/decode.py @@ -17,6 +17,7 @@ import logging # third-party imports from chainlib.eth.tx import unpack +from chainlib.chain import ChainSpec logging.basicConfig(level=logging.WARNING) @@ -34,7 +35,8 @@ args = argparser.parse_args() if args.v: logg.setLevel(logging.DEBUG) -(chain_name, chain_id) = args.i.split(':') +chain_spec = ChainSpec.from_chain_str(args.i) +chain_id = chain_spec.network_id() def main(): diff --git a/chainlib/eth/runnable/gas.py b/chainlib/eth/runnable/gas.py index aec91b2..2ea2371 100644 --- a/chainlib/eth/runnable/gas.py +++ b/chainlib/eth/runnable/gas.py @@ -38,6 +38,7 @@ from chainlib.eth.gas import ( GasTxFactory, ) from chainlib.eth.gas import balance as gas_balance +from chainlib.chain import ChainSpec logging.basicConfig(level=logging.WARNING) logg = logging.getLogger() @@ -106,8 +107,8 @@ else: gas_oracle = DefaultGasOracle(conn) -chain_pair = args.i.split(':') -chain_id = int(chain_pair[1]) +chain_spec = ChainSpec.from_chain_str(args.i) +chain_id = chain_spec.network_id() value = args.amount diff --git a/chainlib/eth/runnable/transfer.py b/chainlib/eth/runnable/transfer.py index 1114bf5..70790d9 100644 --- a/chainlib/eth/runnable/transfer.py +++ b/chainlib/eth/runnable/transfer.py @@ -30,6 +30,7 @@ from chainlib.eth.rpc import jsonrpc_template from chainlib.eth.nonce import DefaultNonceOracle from chainlib.eth.gas import DefaultGasOracle from chainlib.eth.erc20 import ERC20TxFactory +from chainlib.chain import ChainSpec logging.basicConfig(level=logging.WARNING) @@ -85,8 +86,8 @@ conn = HTTPConnection(args.p) nonce_oracle = DefaultNonceOracle(signer_address, conn) gas_oracle = DefaultGasOracle(conn) -chain_pair = args.i.split(':') -chain_id = int(chain_pair[1]) +chain_spec = ChainSpec.from_chain_str(args.i) +chain_id = chain_spec.network_id() value = args.amount