Rename contracts-dir flag to abi-dir, use package-data as abi dir

This commit is contained in:
nolash 2020-12-11 16:48:38 +01:00
parent 05234aa73c
commit f8a6a67c26
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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()

View File

@ -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