commit f8a6a67c2639730a05fd5b1bde4f6357ae729291
parent 05234aa73c131325bbe4a680436021ee61312ffc
Author: nolash <dev@holbrook.no>
Date: Fri, 11 Dec 2020 16:48:38 +0100
Rename contracts-dir flag to abi-dir, use package-data as abi dir
Diffstat:
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/python/CHANGELOG b/python/CHANGELOG
@@ -1,3 +1,6 @@
+- 0.0.7
+ - Rename contracts-dir flag to abi-dir
+ - Use package data dir as default abi dir
- 0.0.6
* Add owner flag to deploy script
- 0.0.5
diff --git a/python/eth_accounts_index/runnable/deploy.py b/python/eth_accounts_index/runnable/deploy.py
@@ -21,13 +21,16 @@ logg = logging.getLogger()
logging.getLogger('web3').setLevel(logging.WARNING)
logging.getLogger('urllib3').setLevel(logging.WARNING)
+script_dir = os.path.dirname(__file__)
+data_dir = os.path.join(script_dir, '..', 'data')
+
argparser = argparse.ArgumentParser()
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
argparser.add_argument('-w', '--writer', dest='w', action='append', type=str, help='Writer to add')
argparser.add_argument('-o', '--owner', dest='o', type=str, help='Accounts index owner')
argparser.add_argument('-a', '--account', dest='a', action='append', type=str, help='Account to add')
argparser.add_argument('-k', '--keep-sender', dest='k', action='store_true', help='If set, sender will be kept as writer')
-argparser.add_argument('--contracts-dir', dest='contracts_dir', default='.', help='Directory containing bytecode and abi')
+argparser.add_argument('--abi-dir', dest='abi_dir', type=str, default=data_dir, help='Directory containing bytecode and abi (default: {})'.format(data_dir))
argparser.add_argument('-v', action='store_true', help='Be verbose')
args = argparser.parse_args()
@@ -37,11 +40,11 @@ if args.v:
def main():
w3 = web3.Web3(web3.Web3.HTTPProvider(args.p))
- f = open(os.path.join(args.contracts_dir, 'AccountsIndex.abi.json'), 'r')
+ f = open(os.path.join(args.abi_dir, 'AccountsIndex.abi.json'), 'r')
abi = json.load(f)
f.close()
- f = open(os.path.join(args.contracts_dir, 'AccountsIndex.bin'), 'r')
+ f = open(os.path.join(args.abi_dir, 'AccountsIndex.bin'), 'r')
bytecode = f.read()
f.close()
diff --git a/python/setup.cfg b/python/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = eth-accounts-index
-version = 0.0.6
+version = 0.0.7
description = Accounts index evm contract tooling with permissioned writes
author = Louis Holbrook
author_email = dev@holbrook.no