Apply balance tool on new chainlib setup

This commit is contained in:
lash 2022-05-12 06:27:11 +00:00
parent a1896b40c1
commit 9012b9884a
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 27 additions and 16 deletions

View File

@ -1,15 +1,6 @@
## external imports
#from chainlib.cli import (
# ArgumentParser,
# argflag_std_read,
# argflag_std_write,
# argflag_std_base,
# argflag_std_base_read,
# flag_reset as argflag_reset,
# Flag,
# )
from chainlib.cli.arg import ( from chainlib.cli.arg import (
ArgumentParser, ArgumentParser,
Arg, Arg,
ArgFlag, ArgFlag,
process_args,
) )

View File

@ -5,6 +5,8 @@ credentials =
dialect = default dialect = default
scheme = http scheme = http
verify = 1 verify = 1
timeout = 10.0
proxy =
[chain] [chain]
spec = evm:berlin:1:ethereum spec = evm:berlin:1:ethereum

View File

@ -13,6 +13,16 @@ from hexathon import (
# local imports # local imports
import chainlib.eth.cli import chainlib.eth.cli
from chainlib.eth.cli.arg import (
Arg,
ArgFlag,
process_args,
)
from chainlib.eth.cli.config import (
Config,
process_config,
)
from chainlib.eth.cli.log import process_log
from chainlib.eth.address import AddressChecksum from chainlib.eth.address import AddressChecksum
from chainlib.jsonrpc import ( from chainlib.jsonrpc import (
jsonrpc_result, jsonrpc_result,
@ -26,17 +36,25 @@ from chainlib.eth.gas import (
from chainlib.chain import ChainSpec from chainlib.chain import ChainSpec
from funga.eth.signer import EIP155Signer from funga.eth.signer import EIP155Signer
logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger() logg = logging.getLogger()
script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.dirname(os.path.realpath(__file__))
#config_dir = os.path.join(script_dir, '..', 'data', 'config')
arg_flags = chainlib.eth.cli.argflag_std_read argparser = chainlib.eth.cli.ArgumentParser() #arg_flags)
argparser = chainlib.eth.cli.ArgumentParser(arg_flags) arg_flags = ArgFlag()
argparser.add_positional('address', type=str, help='Ethereum address of recipient') arg = Arg(arg_flags)
flags = arg_flags.STD_READ
argparser = process_args(argparser, arg, flags)
argparser.add_argument('address', type=str, help='Ethereum address of recipient')
args = argparser.parse_args() args = argparser.parse_args()
config = chainlib.eth.cli.Config.from_args(args, arg_flags)
logg = process_log(args, logg)
logg.debug('flags {} {} {}'.format(flags, arg_flags.SEQ, flags & arg_flags.SEQ))
config = Config()
config = process_config(config, arg, args, flags)
logg.debug('config loaded:\n{}'.format(config))
wallet = chainlib.eth.cli.Wallet() wallet = chainlib.eth.cli.Wallet()
wallet.from_config(config) wallet.from_config(config)