commit 2e191625084b600ea51cc418af7b02846b387b95
parent a5ecd2deedf2ccc240f805e81f9bad0e65346183
Author: nolash <dev@holbrook.no>
Date: Sun, 14 Nov 2021 09:06:07 +0100
Minter with numeric token id
Diffstat:
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/python/eth_badgetoken/runnable/mint.py b/python/eth_badgetoken/runnable/mint.py
@@ -54,7 +54,14 @@ chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
token_id_bytes = bytes.fromhex(strip_0x(config.get('_TOKEN_ID')))
if len(token_id_bytes) != 32:
- raise ValueError('token id must be 32 bytes')
+ token_id_int = None
+ try:
+ token_id_int = int(config.get('_TOKEN_ID'))
+ except:
+ token_id_int = strip_0x(config.get('_TOKEN_ID'))
+ token_id_int = int(token_id_int, 16)
+ token_id_bytes = token_id_int.to_bytes(32, byteorder='big')
+ logg.info('numeric token id value {} parsed to {}'.format(config.get('_TOKEN_ID'), token_id_bytes.hex()))
token_id = int.from_bytes(token_id_bytes, byteorder='big')
diff --git a/python/requirements.txt b/python/requirements.txt
@@ -1,3 +1,3 @@
-chainlib-eth>=0.0.10a11,<0.1.0
-eth-erc20>=0.1.0,<0.2.0
-eth-owned>=0.0.3a1,<0.1.0
+chainlib-eth~=0.0.12
+eth-erc20~=0.1.2
+eth-owned~=0.0.4a3