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

Commit d048b79

Browse files
Chore/update simple nft events (#88)
* 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>
1 parent cc0b054 commit d048b79

6 files changed

Lines changed: 16 additions & 22 deletions

File tree

app/util/appUtil.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,8 @@ export async function runProcess(process, inputs, outputs) {
255255
reject(ProcessExtrinsicError(errors[0]))
256256
}
257257

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

262261
unsub()
263262
resolve(tokens)

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
- 8081:8080
2424
- 5002:5001
2525
dscp-node:
26-
image: digicatapult/dscp-node:v5.0.2
26+
image: digicatapult/dscp-node:v5.0.3
2727
command:
2828
--base-path /data/
2929
--dev

package-lock.json

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dscp-api",
3-
"version": "5.0.4",
3+
"version": "5.0.5",
44
"description": "DSCP API",
55
"type": "module",
66
"repository": {
@@ -61,7 +61,7 @@
6161
"eslint-config-prettier": "^8.6.0",
6262
"eslint-plugin-prettier": "^4.2.1",
6363
"mocha": "^10.2.0",
64-
"mock-jwks": "^1.0.9",
64+
"mock-jwks": "^2.0.0",
6565
"moment": "^2.29.4",
6666
"nock": "^13.3.0",
6767
"nodemon": "^2.0.20",

test/integration/regressions.test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import mockJwks from 'mock-jwks'
1+
import createJWKSMock from 'mock-jwks'
22
import { describe, test, before, after } from 'mocha'
33
import { expect } from 'chai'
44
import nock from 'nock'
@@ -17,10 +17,6 @@ import { withNewTestProcess } from '../helper/substrateHelper.js'
1717
const { API_MAJOR_VERSION, AUTH_ISSUER, AUTH_AUDIENCE, AUTH_TYPE } = env
1818
const describeAuthOnly = AUTH_TYPE === 'JWT' ? describe : describe.skip
1919

20-
// it's super weird that we have to do this. createJWKSMock is declared as the default
21-
// export of mock-jwks but module resolution isn't working. Issue in mocha?
22-
const createJWKSMock = mockJwks.default
23-
2420
describeAuthOnly('Bug regression tests', function () {
2521
describe('API run-process is broken with file uploads (https://github.com/digicatapult/dscp-api/issues/17)', function () {
2622
let app

test/integration/routes.test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import mockJwks from 'mock-jwks'
1+
import createJWKSMock from 'mock-jwks'
22
import { describe, test, before, after, afterEach } from 'mocha'
33
import { expect } from 'chai'
44
import nock from 'nock'
@@ -45,10 +45,6 @@ const {
4545
AUTH_TYPE,
4646
} = env
4747

48-
// it's super weird that we have to do this. createJWKSMock is declared as the default
49-
// export of mock-jwks but module resolution isn't working. Issue in mocha?
50-
const createJWKSMock = mockJwks.default
51-
5248
const describeAuthOnly = AUTH_TYPE === 'JWT' ? describe : describe.skip
5349
const describeNoAuthOnly = AUTH_TYPE === 'NONE' ? describe : describe.skip
5450

0 commit comments

Comments
 (0)