diff --git a/package.json b/package.json index 9232a6d9..da619f2c 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "test:unit": "NODE_ENV=test ./node_modules/.bin/mocha --config ./test/mocharc.json -r ts-node/register ./src/**/*.test.ts", "db:migrate": "npx knex migrate:latest --knexfile src/lib/db/knexfile.ts", "db:rollback": "npx knex migrate:rollback --knexfile src/lib/db/knexfile.ts", - "flows": "npx @digicatapult/dscp-process-management@latest create -h localhost -p 9944 -u //Alice -f ./processFlows.json" + "flows": "npx @digicatapult/dscp-process-management@latest create -h 127.0.0.1 -p 9944 -u //Alice -f ./processFlows.json" }, "repository": { "type": "git", diff --git a/src/lib/db/index.ts b/src/lib/db/index.ts index 3ffb579d..4a69d1ab 100644 --- a/src/lib/db/index.ts +++ b/src/lib/db/index.ts @@ -75,7 +75,7 @@ export default class Database { // generics methods insert = async ( model: keyof Models<() => QueryBuilder>, - record: Record + record: Record ): Promise => { const query = this.db()[model] diff --git a/test/integration/onchain/chain.test.ts b/test/integration/onchain/chain.test.ts index 840cf44e..7027be86 100644 --- a/test/integration/onchain/chain.test.ts +++ b/test/integration/onchain/chain.test.ts @@ -10,6 +10,7 @@ import ChainNode from '../../../src/lib/chainNode' import { logger } from '../../../src/lib/logger' import env from '../../../src/env' import { pollTransactionState } from '../../helpers/poll' +import type { UUID } from '../../../src/models/strings' describe('on-chain', function () { this.timeout(120000) @@ -43,11 +44,11 @@ describe('on-chain', function () { const extrinsic = await node.prepareRunProcess({ process: invalidProcess, inputs: [], outputs: [] }) const [transaction] = await db.insert('transaction', { api_type: 'certificate', - transaction_type: 'initialise', + transaction_type: 'creation', local_id: '0f5af074-7d4d-40b4-86a5-17a2391303cb', state: 'submitted', hash: extrinsic.hash.toHex().slice(2), - }) + }) as UUID node.submitRunProcess(extrinsic, (state) => db.update('transaction', { id: transaction }, { state }))