diff --git a/examples/CHANGELOG.md b/examples/CHANGELOG.md index 89e7a0717..958c81c91 100644 --- a/examples/CHANGELOG.md +++ b/examples/CHANGELOG.md @@ -1,5 +1,18 @@ # @docknetwork/sdk-examples +## 0.5.0 + +### Minor Changes + +- Tweaks for `lastPublicKeyId` and `nextPublicKeyId` + +### Patch Changes + +- Updated dependencies + - @docknetwork/dock-blockchain-modules@0.7.0 + - @docknetwork/dock-blockchain-api@0.6.0 + - @docknetwork/credential-sdk@0.11.0 + ## 0.4.5 ### Patch Changes diff --git a/examples/package.json b/examples/package.json index cae1e5419..ae8fa71d2 100644 --- a/examples/package.json +++ b/examples/package.json @@ -2,7 +2,7 @@ "name": "@docknetwork/sdk-examples", "private": true, "type": "module", - "version": "0.4.5", + "version": "0.5.0", "scripts": { "bbs-dock-example": "babel-node ./bbs-dock.js", "claim-deduction-example": "babel-node ./claim-deduction.js", @@ -19,9 +19,9 @@ "lint": "eslint \"*.js\"" }, "dependencies": { - "@docknetwork/credential-sdk": "0.10.0", - "@docknetwork/dock-blockchain-api": "0.5.1", - "@docknetwork/dock-blockchain-modules": "0.6.1" + "@docknetwork/credential-sdk": "0.11.0", + "@docknetwork/dock-blockchain-api": "0.6.0", + "@docknetwork/dock-blockchain-modules": "0.7.0" }, "devDependencies": { "babel-eslint": "^10.1.0", diff --git a/package.json b/package.json index 1ed89e9e4..095efb4ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "root", - "version": "0.11.0", + "version": "0.14.0", "private": true, "workspaces": [ "packages/*", diff --git a/packages/cheqd-blockchain-api/CHANGELOG.md b/packages/cheqd-blockchain-api/CHANGELOG.md index bcb0ee3bd..4ca17dc1d 100644 --- a/packages/cheqd-blockchain-api/CHANGELOG.md +++ b/packages/cheqd-blockchain-api/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/cheqd-blockchain-api +## 0.10.0 + +### Minor Changes + +- Tweaks for `lastPublicKeyId` and `nextPublicKeyId` + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.11.0 + ## 0.9.0 - Allow to use `MultiApiCoreModules` with `CheqdCoreModules` diff --git a/packages/cheqd-blockchain-api/package.json b/packages/cheqd-blockchain-api/package.json index a03f52be8..71ba37058 100644 --- a/packages/cheqd-blockchain-api/package.json +++ b/packages/cheqd-blockchain-api/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/cheqd-blockchain-api", - "version": "0.9.0", + "version": "0.10.0", "license": "MIT", "main": "./dist/esm/index.js", "type": "module", @@ -34,7 +34,7 @@ }, "dependencies": { "@cheqd/sdk": "cjs", - "@docknetwork/credential-sdk": "0.10.0" + "@docknetwork/credential-sdk": "0.11.0" }, "devDependencies": { "@babel/cli": "^7.24.1", diff --git a/packages/cheqd-blockchain-modules/CHANGELOG.md b/packages/cheqd-blockchain-modules/CHANGELOG.md index a48f60e58..e8c520b60 100644 --- a/packages/cheqd-blockchain-modules/CHANGELOG.md +++ b/packages/cheqd-blockchain-modules/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/cheqd-blockchain-modules +## 0.9.0 + +### Minor Changes + +- Tweaks for `lastPublicKeyId` and `nextPublicKeyId` + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.11.0 + ## 0.8.0 ### Minor Changes diff --git a/packages/cheqd-blockchain-modules/package.json b/packages/cheqd-blockchain-modules/package.json index a0a083abe..32add19f9 100644 --- a/packages/cheqd-blockchain-modules/package.json +++ b/packages/cheqd-blockchain-modules/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/cheqd-blockchain-modules", - "version": "0.8.0", + "version": "0.9.0", "type": "module", "license": "MIT", "main": "./dist/esm/index.js", @@ -33,7 +33,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@docknetwork/credential-sdk": "0.10.0" + "@docknetwork/credential-sdk": "0.11.0" }, "devDependencies": { "@babel/cli": "^7.24.1", @@ -42,7 +42,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/plugin-transform-modules-commonjs": "^7.24.1", "@babel/preset-env": "^7.24.3", - "@docknetwork/cheqd-blockchain-api": "0.9.0", + "@docknetwork/cheqd-blockchain-api": "0.10.0", "@rollup/plugin-alias": "^4.0.2", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^24.0.0", diff --git a/packages/cheqd-blockchain-modules/tests/attest-module.test.js b/packages/cheqd-blockchain-modules/tests/attest-module.test.js index bb1a67ed2..8fd7fd671 100644 --- a/packages/cheqd-blockchain-modules/tests/attest-module.test.js +++ b/packages/cheqd-blockchain-modules/tests/attest-module.test.js @@ -3,7 +3,7 @@ import { CheqdTestnetDid } from "@docknetwork/credential-sdk/types"; import { MultiApiDIDModule, MultiApiAttestModule } from "@docknetwork/credential-sdk/modules"; import generateAttestModuleTests from "@docknetwork/credential-sdk/modules/tests/attest-module"; import CheqdDIDModule from "../src/did/module"; -import { faucet } from "./constants"; +import { faucet, url } from "./constants"; import CheqdAttestModule from "../src/attest/module"; describe("AttestModule", () => { @@ -11,7 +11,7 @@ describe("AttestModule", () => { beforeAll(async () => { await cheqd.init({ - url: process.env.ENDPOINT_URL || "http://localhost:26657", + url: url, mnemonic: faucet.mnemonic, network: "testnet", }); diff --git a/packages/cheqd-blockchain-modules/tests/blob-module.test.js b/packages/cheqd-blockchain-modules/tests/blob-module.test.js index 604eee30e..992b882cc 100644 --- a/packages/cheqd-blockchain-modules/tests/blob-module.test.js +++ b/packages/cheqd-blockchain-modules/tests/blob-module.test.js @@ -6,7 +6,7 @@ import { import { MultiApiBlobModule } from "@docknetwork/credential-sdk/modules"; import generateBlobModuleTests from "@docknetwork/credential-sdk/modules/tests/blob-module"; import CheqdDIDModule from "../src/did/module"; -import { faucet } from "./constants"; +import { faucet, url } from "./constants"; import CheqdBlobModule from "../src/blob/module"; import { MultiApiDIDModule } from "@docknetwork/credential-sdk/modules"; @@ -15,7 +15,7 @@ describe("BlobModule", () => { beforeAll(async () => { await cheqd.init({ - url: process.env.ENDPOINT_URL || "http://localhost:26657", + url, mnemonic: faucet.mnemonic, network: "testnet", }); diff --git a/packages/cheqd-blockchain-modules/tests/constants.js b/packages/cheqd-blockchain-modules/tests/constants.js index 396b65b55..6608fe20e 100644 --- a/packages/cheqd-blockchain-modules/tests/constants.js +++ b/packages/cheqd-blockchain-modules/tests/constants.js @@ -1,7 +1,9 @@ export const faucet = { prefix: "cheqd", minimalDenom: "ncheq", - mnemonic: + mnemonic: process.env.CHEQD_MNEMONIC || "steak come surprise obvious remain black trouble measure design volume retreat float coach amused match album moment radio stuff crack orphan ranch dose endorse", - address: "cheqd1fgl67nvjdkrnaemjzg5sqvck9fcst4vt99gmma", + address: process.env.CHEQD_SENDER_ADDRESS || "cheqd1fgl67nvjdkrnaemjzg5sqvck9fcst4vt99gmma", }; + +export const url = process.env.CHEQD_RPC_URL || "http://localhost:26657"; diff --git a/packages/cheqd-blockchain-modules/tests/did-module.test.js b/packages/cheqd-blockchain-modules/tests/did-module.test.js index d364caa97..a8c2b73f3 100644 --- a/packages/cheqd-blockchain-modules/tests/did-module.test.js +++ b/packages/cheqd-blockchain-modules/tests/did-module.test.js @@ -2,7 +2,7 @@ import { CheqdAPI } from "@docknetwork/cheqd-blockchain-api"; import { CheqdTestnetDid } from "@docknetwork/credential-sdk/types"; import didModuleTests from "@docknetwork/credential-sdk/modules/tests/did-module"; import CheqdDIDModule from "../src/did/module"; -import { faucet } from "./constants"; +import { faucet, url } from "./constants"; import { MultiApiDIDModule } from "@docknetwork/credential-sdk/modules"; describe("DIDModule", () => { @@ -10,7 +10,7 @@ describe("DIDModule", () => { beforeAll(async () => { await cheqd.init({ - url: process.env.ENDPOINT_URL || "http://localhost:26657", + url, mnemonic: faucet.mnemonic, network: "testnet", }); diff --git a/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js b/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js index 9cc24b2a6..6f1c7d5b8 100644 --- a/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js +++ b/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js @@ -5,7 +5,7 @@ import { } from "@docknetwork/credential-sdk/types"; import { MultiApiOffchainSignaturesModule } from "@docknetwork/credential-sdk/modules"; import generateOffchainSignaturesModuleTests from "@docknetwork/credential-sdk/modules/tests/offchain-signatures-module"; -import { faucet } from "./constants"; +import { faucet, url } from "./constants"; import { CheqdOffchainSignaturesModule, CheqdDIDModule, @@ -21,7 +21,7 @@ describe("OffchainSignaturesModule", () => { beforeAll(async () => { await cheqd.init({ - url: process.env.ENDPOINT_URL || "http://localhost:26657", + url, mnemonic: faucet.mnemonic, network: "testnet", }); diff --git a/packages/credential-sdk/CHANGELOG.md b/packages/credential-sdk/CHANGELOG.md index 83bc25475..b7e5fe0bb 100644 --- a/packages/credential-sdk/CHANGELOG.md +++ b/packages/credential-sdk/CHANGELOG.md @@ -1,5 +1,11 @@ # @docknetwork/credential-sdk +## 0.11.0 + +### Minor Changes + +- Tweaks for `lastPublicKeyId` and `nextPublicKeyId` + ## 0.10.0 ### Minor Changes diff --git a/packages/credential-sdk/package.json b/packages/credential-sdk/package.json index 222ccd536..13bfea74a 100644 --- a/packages/credential-sdk/package.json +++ b/packages/credential-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/credential-sdk", - "version": "0.10.0", + "version": "0.11.0", "license": "MIT", "type": "module", "files": [ diff --git a/packages/dock-blockchain-api/CHANGELOG.md b/packages/dock-blockchain-api/CHANGELOG.md index ebbcf1aa1..f06974950 100644 --- a/packages/dock-blockchain-api/CHANGELOG.md +++ b/packages/dock-blockchain-api/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/dock-blockchain-api +## 0.6.0 + +### Minor Changes + +- Tweaks for `lastPublicKeyId` and `nextPublicKeyId` + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.11.0 + ## 0.5.1 ### Patch Changes diff --git a/packages/dock-blockchain-api/package.json b/packages/dock-blockchain-api/package.json index 296bfb398..d5d65978b 100644 --- a/packages/dock-blockchain-api/package.json +++ b/packages/dock-blockchain-api/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/dock-blockchain-api", - "version": "0.5.1", + "version": "0.6.0", "license": "MIT", "main": "./dist/esm/index.js", "type": "module", @@ -89,7 +89,7 @@ "@polkadot/api": "10.12.4" }, "dependencies": { - "@docknetwork/credential-sdk": "0.10.0", + "@docknetwork/credential-sdk": "0.11.0", "@docknetwork/node-types": "^0.17.0", "@juanelas/base64": "^1.0.5", "@polkadot/api": "10.12.4", diff --git a/packages/dock-blockchain-modules/CHANGELOG.md b/packages/dock-blockchain-modules/CHANGELOG.md index 5e51cb8f1..f8aa878aa 100644 --- a/packages/dock-blockchain-modules/CHANGELOG.md +++ b/packages/dock-blockchain-modules/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/dock-blockchain-modules +## 0.7.0 + +### Minor Changes + +- Tweaks for `lastPublicKeyId` and `nextPublicKeyId` + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.11.0 + ## 0.6.1 ### Patch Changes diff --git a/packages/dock-blockchain-modules/package.json b/packages/dock-blockchain-modules/package.json index 0856de622..43ecef6c8 100644 --- a/packages/dock-blockchain-modules/package.json +++ b/packages/dock-blockchain-modules/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/dock-blockchain-modules", - "version": "0.6.1", + "version": "0.7.0", "license": "MIT", "type": "module", "main": "./dist/esm/index.js", @@ -33,7 +33,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@docknetwork/credential-sdk": "0.10.0" + "@docknetwork/credential-sdk": "0.11.0" }, "devDependencies": { "@babel/cli": "^7.24.1", @@ -42,7 +42,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/plugin-transform-modules-commonjs": "^7.24.1", "@babel/preset-env": "^7.24.3", - "@docknetwork/dock-blockchain-api": "0.5.1", + "@docknetwork/dock-blockchain-api": "0.6.0", "@rollup/plugin-alias": "^4.0.2", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^24.0.0", diff --git a/packages/dock-blockchain-modules/src/accumulator/internal.js b/packages/dock-blockchain-modules/src/accumulator/internal.js index 3517bf3e8..e9fba7811 100644 --- a/packages/dock-blockchain-modules/src/accumulator/internal.js +++ b/packages/dock-blockchain-modules/src/accumulator/internal.js @@ -87,6 +87,14 @@ export default class DockInternalAccumulatorModule extends injectParams( return (await this.counters(did)).keyCounter; } + async lastParamsId(did) { + return await this.paramsCounter(did); + } + + async lastPublicKeyId(did) { + return await this.keysCounter(did); + } + /** * Update given witness by downloading necessary blocks and applying the updates if found. Both start and end are inclusive * @param accumulatorId diff --git a/packages/dock-blockchain-modules/src/common/inject-params.js b/packages/dock-blockchain-modules/src/common/inject-params.js index 8ecef563e..ae0820bbc 100644 --- a/packages/dock-blockchain-modules/src/common/inject-params.js +++ b/packages/dock-blockchain-modules/src/common/inject-params.js @@ -62,7 +62,7 @@ export default function injectParams(klass) { const hexDid = DockDidOrDidMethodKey.from(did); const paramsMap = new this.constructor.ParamsMap(); - const paramsCounter = await this.paramsCounter(hexDid); + const paramsCounter = await this.lastParamsId(hexDid); for (let idx = 1; idx <= paramsCounter; idx++) { // eslint-disable-next-line no-await-in-loop const params = await this.getParams(hexDid, idx); @@ -74,6 +74,10 @@ export default function injectParams(klass) { return paramsMap; } + + async lastParamsId(_did) { + throw new Error('Unimplemented'); + } }, }; diff --git a/packages/dock-blockchain-modules/src/common/inject-public-keys.js b/packages/dock-blockchain-modules/src/common/inject-public-keys.js index d66d94bfc..e92d628ce 100644 --- a/packages/dock-blockchain-modules/src/common/inject-public-keys.js +++ b/packages/dock-blockchain-modules/src/common/inject-public-keys.js @@ -6,7 +6,7 @@ import { TypedMap, withNullIfNotAVariant, } from '@docknetwork/credential-sdk/types/generic'; -import { isEqualToOrPrototypeOf, withExtendedStaticProperties } from '@docknetwork/credential-sdk/utils'; +import { isEqualToOrPrototypeOf, withExtendedStaticProperties, withExtendedPrototypeProperties } from '@docknetwork/credential-sdk/utils'; import { DockDidOrDidMethodKey } from '@docknetwork/credential-sdk/types'; import { createInternalDockModule } from './builders'; @@ -85,7 +85,7 @@ export default function injectPublicKeys(klass) { const hexDid = DockDidOrDidMethodKey.from(did); const publicKeysMap = new this.constructor.PublicKeysMap(); - const keysCounter = await this.keysCounter(hexDid); + const keysCounter = await this.lastPublicKeyId(hexDid); for (let idx = 1; idx <= keysCounter; idx++) { // eslint-disable-next-line no-await-in-loop const publicKey = await this.getPublicKey(hexDid, idx, includeParams); @@ -97,14 +97,18 @@ export default function injectPublicKeys(klass) { return publicKeysMap; } + + async lastPublicKeyId(_did) { + throw new Error('Unimplemented'); + } }, }; return createInternalDockModule( { didMethods }, - withExtendedStaticProperties( + withExtendedPrototypeProperties(['lastPublicKeyId'], withExtendedStaticProperties( ['PublicKey', 'ParamsRef', 'PublicKeyOwner', 'PublicKeyQuery'], obj[name], - ), + )), ); } diff --git a/packages/dock-blockchain-modules/src/offchain-signatures/internal.js b/packages/dock-blockchain-modules/src/offchain-signatures/internal.js index 35ca2ab9d..46fefe7a5 100644 --- a/packages/dock-blockchain-modules/src/offchain-signatures/internal.js +++ b/packages/dock-blockchain-modules/src/offchain-signatures/internal.js @@ -1,10 +1,10 @@ -import { TypedNumber } from '@docknetwork/credential-sdk/types/generic'; import { DockDidOrDidMethodKey, OffchainSignatureParams, DockOffchainSignaturePublicKey, DockDidValue, DockOffchainSignatureParamsRef, + DockParamsId, } from '@docknetwork/credential-sdk/types'; import { AddOffchainSignatureParams, @@ -53,21 +53,27 @@ export default class DockInternalOffchainSignaturesModule extends injectParams( * @returns Promise<*> */ async paramsCounter(did) { - return TypedNumber.from( + return DockParamsId.from( await this.query.paramsCounter(DockDidOrDidMethodKey.from(did)), ); } + async lastParamsId(did) { + return await this.paramsCounter(did); + } + /** * Returns keys counter corresponding to the supplied DID. * @param {*} did * @returns Promise<*> */ async keysCounter(did) { - return ( - await new DockDIDModuleInternal(this.apiProvider).getOnchainDidDetail( - DockDidOrDidMethodKey.from(did), - ) - ).lastKeyId; + return (await new DockDIDModuleInternal(this.apiProvider).getOnchainDidDetail( + DockDidOrDidMethodKey.from(did), + )).data.lastKeyId; + } + + async lastPublicKeyId(did) { + return await this.keysCounter(did); } } diff --git a/packages/dock-blockchain-modules/tests/integration/anoncreds/accumulator.test.js b/packages/dock-blockchain-modules/tests/integration/anoncreds/accumulator.test.js index 45f0da0d7..8ed2e9a83 100644 --- a/packages/dock-blockchain-modules/tests/integration/anoncreds/accumulator.test.js +++ b/packages/dock-blockchain-modules/tests/integration/anoncreds/accumulator.test.js @@ -73,7 +73,7 @@ describe("Accumulator Module", () => { let params = Accumulator.generateParams(hexToU8a(label)); const bytes1 = u8aToHex(params.bytes); const params1 = chainModuleClass.prepareAddParameters(bytes1, label); - await chainModule.addParams(null, params1, did1, pair1); + await chainModule.addParams(await chainModule.nextParamsId(did1), params1, did1, pair1); const paramsWritten1 = await chainModule.getParams( did1, await chainModule.dockOnly.paramsCounter(did1) @@ -88,7 +88,7 @@ describe("Accumulator Module", () => { params = Accumulator.generateParams(hexToU8a(label)); const bytes2 = u8aToHex(params.bytes); const params2 = chainModuleClass.prepareAddParameters(bytes2); - await chainModule.addParams(null, params2, did2, pair2); + await chainModule.addParams(await chainModule.nextParamsId(did2), params2, did2, pair2); const paramsWritten2 = await chainModule.getParams( did2, await chainModule.dockOnly.paramsCounter(did2) @@ -103,7 +103,7 @@ describe("Accumulator Module", () => { params = Accumulator.generateParams(hexToU8a(label)); const bytes3 = u8aToHex(params.bytes); const params3 = chainModuleClass.prepareAddParameters(bytes3); - await chainModule.addParams(null, params3, did1, pair1); + await chainModule.addParams(await chainModule.nextParamsId(did1), params3, did1, pair1); const paramsWritten3 = await chainModule.getParams( did1, await chainModule.dockOnly.paramsCounter(did1) @@ -131,7 +131,7 @@ describe("Accumulator Module", () => { let keypair = Accumulator.generateKeypair(params); const bytes1 = u8aToHex(keypair.publicKey.bytes); const pk1 = chainModuleClass.prepareAddPublicKey(bytes1); - await chainModule.addPublicKey(null, pk1, did1, pair1); + await chainModule.addPublicKey(await chainModule.nextPublicKeyId(did2), pk1, did1, pair1); const queriedPk1 = await chainModule.getPublicKey(did1, 1); expect(queriedPk1.bytes).toEqual(pk1.bytes); @@ -142,7 +142,7 @@ describe("Accumulator Module", () => { keypair = Accumulator.generateKeypair(aparams1, hexToU8a(seedAccum)); const bytes2 = u8aToHex(keypair.publicKey.bytes); const pk2 = chainModuleClass.prepareAddPublicKey(bytes2, [did1, 1]); - await chainModule.addPublicKey(null, pk2, did2, pair2); + await chainModule.addPublicKey(await chainModule.nextPublicKeyId(did2), pk2, did2, pair2); const queriedPk2 = await chainModule.getPublicKey(did2, 1); expect(queriedPk2.bytes).toEqual(pk2.bytes); @@ -158,7 +158,7 @@ describe("Accumulator Module", () => { keypair = Accumulator.generateKeypair(aparams2); const bytes3 = u8aToHex(keypair.publicKey.bytes); const pk3 = chainModuleClass.prepareAddPublicKey(bytes3, [did1, 2]); - await chainModule.addPublicKey(null, pk3, did2, pair2); + await chainModule.addPublicKey(await chainModule.nextPublicKeyId(did2), pk3, did2, pair2); const queriedPk3 = await chainModule.getPublicKey(did2, 2); expect(queriedPk3.bytes).toEqual(pk3.bytes); diff --git a/packages/dock-blockchain-modules/tests/integration/anoncreds/scheme.test.js b/packages/dock-blockchain-modules/tests/integration/anoncreds/scheme.test.js index 92971af1d..bb42714f7 100644 --- a/packages/dock-blockchain-modules/tests/integration/anoncreds/scheme.test.js +++ b/packages/dock-blockchain-modules/tests/integration/anoncreds/scheme.test.js @@ -80,7 +80,7 @@ for (const { let params = SignatureParams.generate(10, hexToU8a(label)); const bytes1 = u8aToHex(params.toBytes()); const params1 = chainModuleClass.prepareAddParameters(bytes1, label); - await chainModule.addParams(null, params1, did1, pair1); + await chainModule.addParams(await chainModule.nextParamsId(did1), params1, did1, pair1); const paramsWritten1 = await chainModule.getParams( did1, await chainModule.lastParamsId(did1) @@ -99,7 +99,7 @@ for (const { params = SignatureParams.generate(20); const bytes2 = u8aToHex(params.toBytes()); const params2 = chainModuleClass.prepareAddParameters(bytes2); - await chainModule.addParams(null, params2, did2, pair2); + await chainModule.addParams(await chainModule.nextParamsId(did2), params2, did2, pair2); const paramsWritten2 = await chainModule.getParams( did2, await chainModule.lastParamsId(did2) @@ -114,7 +114,7 @@ for (const { params = SignatureParams.generate(23, hexToU8a(label)); const bytes3 = u8aToHex(params.toBytes()); const params3 = chainModuleClass.prepareAddParameters(bytes3, label); - await chainModule.addParams(null, params3, did1, pair1); + await chainModule.addParams(await chainModule.nextParamsId(did1), params3, did1, pair1); const paramsWritten3 = await chainModule.getParams( did1, await chainModule.lastParamsId(did1) diff --git a/scripts/with_dock_docker_test_node b/scripts/with_dock_docker_test_node index cec212f8f..a01681185 100755 --- a/scripts/with_dock_docker_test_node +++ b/scripts/with_dock_docker_test_node @@ -24,6 +24,9 @@ cleanup() { try_with_node() { # Wait for nodes to start listening for RPC "$root_dir"/scripts/wait_for_node_rpc_http + + sleep 5 + # Execute the commands, potentially against the nodes $@ }