chainlib-eth

Ethereum implementation of the chainlib interface
Log | Files | Refs | README | LICENSE

commit 5b1755e50d5ab74194cc5140ee1315aa5012aa69
parent bff9305aac7f3486f1d68e7212e3263b6196fdbb
Author: nolash <dev@holbrook.no>
Date:   Wed, 25 Aug 2021 12:05:48 +0200

Allow nonce/fee setting not to be present in chainlib cli

Diffstat:
Mchainlib/eth/cli.py | 20++++++++++++++++----
Msetup.cfg | 2+-
2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/chainlib/eth/cli.py b/chainlib/eth/cli.py @@ -56,14 +56,26 @@ class Rpc(BaseRpc): super(Rpc, self).connect_by_config(config) if self.can_sign(): - nonce = config.get('_NONCE') + nonce = None + fee_price = None + fee_limit = None + try: + nonce = config.get('_NONCE') + except KeyError: + pass if nonce != None: self.nonce_oracle = OverrideNonceOracle(self.get_sender_address(), nonce, id_generator=self.id_generator) else: self.nonce_oracle = RPCNonceOracle(self.get_sender_address(), self.conn, id_generator=self.id_generator) - - fee_price = config.get('_FEE_PRICE') - fee_limit = config.get('_FEE_LIMIT') + + try: + fee_price = config.get('_FEE_PRICE') + except KeyError: + pass + try: + fee_limit = config.get('_FEE_LIMIT') + except KeyError: + pass if fee_price != None or fee_limit != None: self.fee_oracle = OverrideGasOracle(price=fee_price, limit=fee_limit, conn=self.conn, id_generator=self.id_generator) else: diff --git a/setup.cfg b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = chainlib-eth -version = 0.0.9a3 +version = 0.0.9a4 description = Ethereum implementation of the chainlib interface author = Louis Holbrook author_email = dev@holbrook.no