Implement chain spec parsing in executable
This commit is contained in:
parent
b59d4b3c43
commit
fbfa7493f6
@ -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():
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user