Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Chore/update simple nft events (#88)
Browse files Browse the repository at this point in the history
* Update dependency mock-jwks to v2

* Switch events to ProcessRan

* Update refered to docker image

* 5.0.5

* Fix tests after upgrading mock-jwks

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
mattdean-digicatapult and renovate[bot] authored Mar 31, 2023
1 parent cc0b054 commit d048b79
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
5 changes: 2 additions & 3 deletions app/util/appUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,8 @@ export async function runProcess(process, inputs, outputs) {
reject(ProcessExtrinsicError(errors[0]))
}

const tokens = result.events
.filter(({ event: { method } }) => method === 'Minted')
.map(({ event: { data } }) => data[0].toNumber())
const processRanEvent = result.events.find(({ event: { method } }) => method === 'ProcessRan')
const tokens = processRanEvent?.event?.data?.outputs?.map((x) => x.toNumber())

unsub()
resolve(tokens)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
- 8081:8080
- 5002:5001
dscp-node:
image: digicatapult/dscp-node:v5.0.2
image: digicatapult/dscp-node:v5.0.3
command:
--base-path /data/
--dev
Expand Down
15 changes: 9 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dscp-api",
"version": "5.0.4",
"version": "5.0.5",
"description": "DSCP API",
"type": "module",
"repository": {
Expand Down Expand Up @@ -61,7 +61,7 @@
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"mocha": "^10.2.0",
"mock-jwks": "^1.0.9",
"mock-jwks": "^2.0.0",
"moment": "^2.29.4",
"nock": "^13.3.0",
"nodemon": "^2.0.20",
Expand Down
6 changes: 1 addition & 5 deletions test/integration/regressions.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mockJwks from 'mock-jwks'
import createJWKSMock from 'mock-jwks'
import { describe, test, before, after } from 'mocha'
import { expect } from 'chai'
import nock from 'nock'
Expand All @@ -17,10 +17,6 @@ import { withNewTestProcess } from '../helper/substrateHelper.js'
const { API_MAJOR_VERSION, AUTH_ISSUER, AUTH_AUDIENCE, AUTH_TYPE } = env
const describeAuthOnly = AUTH_TYPE === 'JWT' ? describe : describe.skip

// it's super weird that we have to do this. createJWKSMock is declared as the default
// export of mock-jwks but module resolution isn't working. Issue in mocha?
const createJWKSMock = mockJwks.default

describeAuthOnly('Bug regression tests', function () {
describe('API run-process is broken with file uploads (https://github.com/digicatapult/dscp-api/issues/17)', function () {
let app
Expand Down
6 changes: 1 addition & 5 deletions test/integration/routes.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mockJwks from 'mock-jwks'
import createJWKSMock from 'mock-jwks'
import { describe, test, before, after, afterEach } from 'mocha'
import { expect } from 'chai'
import nock from 'nock'
Expand Down Expand Up @@ -45,10 +45,6 @@ const {
AUTH_TYPE,
} = env

// it's super weird that we have to do this. createJWKSMock is declared as the default
// export of mock-jwks but module resolution isn't working. Issue in mocha?
const createJWKSMock = mockJwks.default

const describeAuthOnly = AUTH_TYPE === 'JWT' ? describe : describe.skip
const describeNoAuthOnly = AUTH_TYPE === 'NONE' ? describe : describe.skip

Expand Down

0 comments on commit d048b79

Please sign in to comment.