commit c957cc597b2a6e652d69403a28533d40ee54e1b4
parent fe7670270cdf353a0585c6a3cdacea7824c8b1c1
Author: nolash <dev@holbrook.no>
Date: Fri, 19 Feb 2021 13:42:08 +0100
Add chainlib chainspec parser
Diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/python/erc20_transfer_authorization/runnable/deploy.py b/python/erc20_transfer_authorization/runnable/deploy.py
@@ -16,6 +16,7 @@ import web3
from crypto_dev_signer.eth.signer import ReferenceSigner as EIP155Signer
from crypto_dev_signer.keystore import DictKeystore
from crypto_dev_signer.eth.helper import EthTxExecutor
+from chainlib.chain import ChainSpec
logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger()
@@ -57,8 +58,8 @@ if args.y != None:
logg.debug('now have key for signer address {}'.format(signer_address))
signer = EIP155Signer(keystore)
-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()
helper = EthTxExecutor(
w3,
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = erc20-transfer-authorization
-version = 0.3.0a7
+version = 0.3.0a9
description = Simple approval escrow for ERC20 spend approval
author = Louis Holbrook
author_email = dev@holbrook.no
@@ -29,6 +29,7 @@ packages =
install_requires =
web3==5.12.2
crypto-dev-signer~=0.4.13rc2
+ chainlib~=0.0.1a15
[options.package_data]
* =
diff --git a/python/tests/test_transfer.py b/python/tests/test_transfer.py
@@ -41,5 +41,6 @@ class ERC20TransferAuthorizationTransferTest(TestBase):
serial_compare = w.functions.requestRecipientIndex(self.w3.eth.accounts[3], 0).call()
self.assertEqual(serial_compare, req[0])
+
if __name__ == '__main__':
unittest.main()