From 70f1d63867f82dd9443610ba9de8732b16453c52 Mon Sep 17 00:00:00 2001 From: nolash Date: Mon, 22 Feb 2021 12:14:00 +0100 Subject: [PATCH] Add session to create role eth task --- apps/cic-eth/cic_eth/eth/account.py | 4 +++- apps/cic-meta/docker/Dockerfile | 1 - apps/cic-meta/package-lock.json | 2 +- apps/cic-meta/package.json | 2 +- apps/contract-migration/scripts/README | 2 +- apps/contract-migration/scripts/import_balance.py | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/cic-eth/cic_eth/eth/account.py b/apps/cic-eth/cic_eth/eth/account.py index a3b2322c..6729ca45 100644 --- a/apps/cic-eth/cic_eth/eth/account.py +++ b/apps/cic-eth/cic_eth/eth/account.py @@ -178,8 +178,10 @@ def register(self, account_address, chain_str, writer_address=None): """ chain_spec = ChainSpec.from_chain_str(chain_str) + session = SessionBase.create_session() if writer_address == None: - writer_address = AccountRole.get_address('ACCOUNTS_INDEX_WRITER') + writer_address = AccountRole.get_address('ACCOUNTS_INDEX_WRITER', session) + session.close() if writer_address == zero_address: raise RoleMissingError(account_address) diff --git a/apps/cic-meta/docker/Dockerfile b/apps/cic-meta/docker/Dockerfile index d3440175..76804a19 100644 --- a/apps/cic-meta/docker/Dockerfile +++ b/apps/cic-meta/docker/Dockerfile @@ -3,7 +3,6 @@ FROM node:15.3.0-alpine3.10 WORKDIR /tmp/src/cic-meta COPY cic-meta/package.json \ - cic-meta/package-lock.json \ ./ RUN npm install diff --git a/apps/cic-meta/package-lock.json b/apps/cic-meta/package-lock.json index 414c1138..c0c67d0d 100644 --- a/apps/cic-meta/package-lock.json +++ b/apps/cic-meta/package-lock.json @@ -1,6 +1,6 @@ { "name": "cic-client-meta", - "version": "0.0.6", + "version": "0.0.7-alpha.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/apps/cic-meta/package.json b/apps/cic-meta/package.json index 28475bdb..5bcf3e3b 100644 --- a/apps/cic-meta/package.json +++ b/apps/cic-meta/package.json @@ -6,7 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "test": "mocha -r node_modules/node-localstorage/register -r ts-node/register tests/*.ts", - "build": "node_modules/typescript/bin/tsc -d --outDir dist && npm run build-server", + "build": "node_modules/typescript/bin/tsc -d --outDir dist", "build-server": "tsc -d --outDir dist-server scripts/server/*.ts", "pack": "node_modules/typescript/bin/tsc -d --outDir dist && webpack", "clean": "rm -rf dist", diff --git a/apps/contract-migration/scripts/README b/apps/contract-migration/scripts/README index 00dbac22..048a1f6f 100644 --- a/apps/contract-migration/scripts/README +++ b/apps/contract-migration/scripts/README @@ -49,7 +49,7 @@ This will monitor new mined blocks and send balances to the newly created accoun Without any modifications to the cluster and config files: -`python -c config --redis-host-callback redis ` +`python import_users.py -c config --redis-host-callback redis ` ** A note on the The callback**: The script uses a redis callback to retrieve the newly generated custodial address. This is the redis server _from the perspective of the cic-eth component_. diff --git a/apps/contract-migration/scripts/import_balance.py b/apps/contract-migration/scripts/import_balance.py index 427fc9f9..305d6da9 100644 --- a/apps/contract-migration/scripts/import_balance.py +++ b/apps/contract-migration/scripts/import_balance.py @@ -191,7 +191,7 @@ class BlockGetter: def progress_callback(block_number, tx_index, s): - sys.stdout.write(s.ljust(200) + "\n") + sys.stdout.write(str(s).ljust(200) + "\n")