Add session to create role eth task

This commit is contained in:
nolash 2021-02-22 12:14:00 +01:00
parent 42ae8e5ed3
commit 70f1d63867
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 7 additions and 6 deletions

View File

@ -178,8 +178,10 @@ def register(self, account_address, chain_str, writer_address=None):
""" """
chain_spec = ChainSpec.from_chain_str(chain_str) chain_spec = ChainSpec.from_chain_str(chain_str)
session = SessionBase.create_session()
if writer_address == None: 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: if writer_address == zero_address:
raise RoleMissingError(account_address) raise RoleMissingError(account_address)

View File

@ -3,7 +3,6 @@ FROM node:15.3.0-alpine3.10
WORKDIR /tmp/src/cic-meta WORKDIR /tmp/src/cic-meta
COPY cic-meta/package.json \ COPY cic-meta/package.json \
cic-meta/package-lock.json \
./ ./
RUN npm install RUN npm install

View File

@ -1,6 +1,6 @@
{ {
"name": "cic-client-meta", "name": "cic-client-meta",
"version": "0.0.6", "version": "0.0.7-alpha.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -6,7 +6,7 @@
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"scripts": { "scripts": {
"test": "mocha -r node_modules/node-localstorage/register -r ts-node/register tests/*.ts", "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", "build-server": "tsc -d --outDir dist-server scripts/server/*.ts",
"pack": "node_modules/typescript/bin/tsc -d --outDir dist && webpack", "pack": "node_modules/typescript/bin/tsc -d --outDir dist && webpack",
"clean": "rm -rf dist", "clean": "rm -rf dist",

View File

@ -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: Without any modifications to the cluster and config files:
`python -c config --redis-host-callback redis <datadir>` `python import_users.py -c config --redis-host-callback redis <datadir>`
** 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_. ** 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_.

View File

@ -191,7 +191,7 @@ class BlockGetter:
def progress_callback(block_number, tx_index, s): def progress_callback(block_number, tx_index, s):
sys.stdout.write(s.ljust(200) + "\n") sys.stdout.write(str(s).ljust(200) + "\n")