chainlib

Generic blockchain access library and tooling
Log | Files | Refs | README | LICENSE

commit 72b52a35630e4f408ad49264aad63a303ca34961
parent 1680f00e0eb55d91a78e635ce4b01a7e34d8abae
Author: lash <dev@holbrook.no>
Date:   Fri, 17 Feb 2023 18:10:09 +0000

Fix none overwrite of sender address when no sender arg

Diffstat:
MCHANGELOG | 2++
Mchainlib/cli/rpc.py | 20++++++++++++--------
Msetup.cfg | 2+-
3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,3 +1,5 @@ +- 0.4.11 + * Fix unsigned address none overwrite when no sender arg is set - 0.4.10 * Fix remaining unsigned address key error in rpc cli handler - 0.4.9 diff --git a/chainlib/cli/rpc.py b/chainlib/cli/rpc.py @@ -66,16 +66,20 @@ class Rpc: self.chain_spec = config.get('CHAIN_SPEC') self.conn = self.constructor(url=config.get('RPC_PROVIDER'), chain_spec=self.chain_spec, auth=auth, verify_identity=config.true('RPC_VERIFY'), timeout=float(config.get('RPC_TIMEOUT'))) + self.sender_address = self.default_sender_address + sender_address = None + try: + sender_address = config.get('_UNSIGNED_SENDER_ADDRESS') + except KeyError: + pass + except ValueError: + pass + if self.wallet.signer != None: self.sender_address = self.wallet.signer_address - else: - try: - self.sender_address = config.get('_UNSIGNED_SENDER_ADDRESS') - logg.debug('default sender address {}'.format(self.sender_address)) - except KeyError: - pass - except ValueError: - pass + elif sender_address != None: + self.sender_address = sender_address + return self.conn diff --git a/setup.cfg b/setup.cfg @@ -3,7 +3,7 @@ name=chainlib license=AGPLv3+ author_email=dev@holbrook.no description=Generic blockchain access library and tooling -version=0.4.10 +version=0.4.11 url=https://git.defalsify.org/chainlib author=Louis Holbrook