From 76e5005c7eb89a379a27f97587847c0c061fcc99 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 12:41:25 +0100 Subject: [PATCH 01/13] Test service provider schemas --- .../source/service-provider.test.ts | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/crypto-validation/source/service-provider.test.ts b/packages/crypto-validation/source/service-provider.test.ts index 630aac8c66..4f5defce24 100644 --- a/packages/crypto-validation/source/service-provider.test.ts +++ b/packages/crypto-validation/source/service-provider.test.ts @@ -1,25 +1,22 @@ import { Identifiers } from "@mainsail/constants"; import { Configuration } from "@mainsail/crypto-config"; -import { Validator } from "@mainsail/validation/source/validator"; import cryptoJson from "../../core/bin/config/devnet/core/crypto.json"; import { Application } from "@mainsail/kernel"; +import { Validator } from "@mainsail/validation"; import { describe } from "@mainsail/test-runner"; +import { schemas } from "./schemas"; import { ServiceProvider } from "./service-provider"; describe<{ app: Application; - validator: Partial; + validator: Validator; serviceProvider: ServiceProvider; -}>("ServiceProvider", ({ it, beforeEach, assert, spy }) => { +}>("ServiceProvider", ({ it, beforeEach, assert }) => { beforeEach((context) => { - context.validator = { - addKeyword: () => {}, - addSchema: () => {}, - }; - context.app = new Application(); - context.app.bind(Identifiers.Cryptography.Validator).toConstantValue(context.validator); + context.app.bind(Identifiers.Cryptography.Validator).to(Validator).inSingletonScope(); + context.validator = context.app.get(Identifiers.Cryptography.Validator); context.app.bind(Identifiers.Cryptography.Configuration).to(Configuration).inSingletonScope(); context.app.get(Identifiers.Cryptography.Configuration).setConfig(cryptoJson); @@ -27,12 +24,11 @@ describe<{ }); it("should register", async ({ validator, serviceProvider }) => { - const spyOnExtend = spy(validator, "addKeyword"); - const spyOnAddSchema = spy(validator, "addSchema"); - await assert.resolves(() => serviceProvider.register()); - spyOnExtend.called(); - spyOnAddSchema.called(); + assert.true(validator.hasSchema("alphanumeric")); + assert.true(validator.hasSchema("hex")); + assert.true(validator.hasSchema("prefixedDataHex")); + assert.true(validator.hasSchema("prefixedQuantityHex")); }); }); From 1f7e70fab2f88ffb3e3713b27264f6b8b39061e8 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 15:31:46 +0100 Subject: [PATCH 02/13] Test schemas --- .../crypto-validation/source/schemas.test.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/packages/crypto-validation/source/schemas.test.ts b/packages/crypto-validation/source/schemas.test.ts index 1b1765d71c..b38c5fc198 100644 --- a/packages/crypto-validation/source/schemas.test.ts +++ b/packages/crypto-validation/source/schemas.test.ts @@ -75,4 +75,46 @@ describe<{ assert.defined(validator.validate("hex", char.repeat(20)).error); } }); + + it("prefixedDataHex - should be ok", ({ validator }) => { + const validValues = ["0x", "0x00", "0x0123", "0x0123456789abcdef"]; + + for (const value of validValues) { + assert.undefined(validator.validate("prefixedDataHex", value).error); + } + }); + + it("prefixedDataHex - should not be ok", ({ validator }) => { + const invalidValues = ["0x0", "0x000", "deadbeef", "0xGG", "0X00"]; + + for (const value of invalidValues) { + assert.defined(validator.validate("prefixedDataHex", value).error); + } + + assert.defined(validator.validate("prefixedDataHex", 123).error); + assert.defined(validator.validate("prefixedDataHex", null).error); + assert.defined(validator.validate("prefixedDataHex").error); + assert.defined(validator.validate("prefixedDataHex", {}).error); + }); + + it("prefixedQuantityHex - should be ok", ({ validator }) => { + const validValues = ["0x0", "0x1", "0x01", "0x123456789abcdef"]; + + for (const value of validValues) { + assert.undefined(validator.validate("prefixedQuantityHex", value).error); + } + }); + + it("prefixedQuantityHex - should not be ok", ({ validator }) => { + const invalidValues = ["0x", "deadbeef", "0xGG", "0X01"]; + + for (const value of invalidValues) { + assert.defined(validator.validate("prefixedQuantityHex", value).error); + } + + assert.defined(validator.validate("prefixedQuantityHex", 123).error); + assert.defined(validator.validate("prefixedQuantityHex", null).error); + assert.defined(validator.validate("prefixedQuantityHex").error); + assert.defined(validator.validate("prefixedQuantityHex", {}).error); + }); }); From e7b495b0c3646ace5558a2ff581c698e40fc2df4 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 15:33:26 +0100 Subject: [PATCH 03/13] Add comment --- packages/crypto-validation/source/schemas.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/crypto-validation/source/schemas.ts b/packages/crypto-validation/source/schemas.ts index 9f5aacf0a6..b3e53dd9db 100644 --- a/packages/crypto-validation/source/schemas.ts +++ b/packages/crypto-validation/source/schemas.ts @@ -16,6 +16,7 @@ export const schemas: Record<"alphanumeric" | "hex" | "prefixedQuantityHex" | "p pattern: "^0x([0-9a-f]{2})*$", type: "string", }, + // requires at least one hex character after the "0x" prefix prefixedQuantityHex: { $id: "prefixedQuantityHex", pattern: "^0x[0-9a-f]+$", From 233fc7906dc040620e3fc093c473266050d7d196 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 15:41:37 +0100 Subject: [PATCH 04/13] Improve isValidatorIndex --- packages/crypto-validation/source/keywords.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/crypto-validation/source/keywords.ts b/packages/crypto-validation/source/keywords.ts index 61cb5d3098..85405cdb64 100644 --- a/packages/crypto-validation/source/keywords.ts +++ b/packages/crypto-validation/source/keywords.ts @@ -95,9 +95,6 @@ export const makeKeywords = ( }, errors: false, keyword: "buffer", - metaSchema: { - type: "object", - }, }; const limitToRoundValidators: FuncKeywordDefinition = { @@ -131,25 +128,25 @@ export const makeKeywords = ( }; const isValidatorIndex: FuncKeywordDefinition = { - // TODO: Check type (same as bignum) // @ts-ignore compile() { return (data, parentSchema: AnySchemaObject) => { - const blockNumber = parseBlockNumber(parentSchema); - const { roundValidators } = configuration.getMilestone(blockNumber); - if (!Number.isInteger(data)) { return false; } - return data >= 0 && data < roundValidators; + if (data < 0) { + return false; + } + + const blockNumber = parseBlockNumber(parentSchema); + const { roundValidators } = configuration.getMilestone(blockNumber); + + return data < roundValidators; }; }, errors: false, keyword: "isValidatorIndex", - metaSchema: { - type: "object", - }, }; return { bignumber, buffer, isValidatorIndex, limitToRoundValidators, maxBytes }; From fdd0dcd68331e3dee1f9ccded48d13c30f667ac9 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 15:58:35 +0100 Subject: [PATCH 05/13] Add comments --- packages/crypto-validation/source/keywords.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/crypto-validation/source/keywords.ts b/packages/crypto-validation/source/keywords.ts index 85405cdb64..feb6d292fe 100644 --- a/packages/crypto-validation/source/keywords.ts +++ b/packages/crypto-validation/source/keywords.ts @@ -7,8 +7,8 @@ const parseBlockNumber = (parentSchema): number | undefined => { return undefined; } - if (parentSchema.parentData.blockNumber) { - // prevotes / precommits + // prevotes / precommits + if (parentSchema.parentData.blockNumber !== undefined) { return parentSchema.parentData.blockNumber; } @@ -20,7 +20,6 @@ const parseBlockNumber = (parentSchema): number | undefined => { // We can extract the block number at a fixed offset here, without needing to deserialize the whole block. // See packages/crypto-messages/source/serializer.ts#serializeProposed for reference. - const serialized = parentSchema.parentData.data.serialized; if (!serialized) { return undefined; @@ -97,6 +96,8 @@ export const makeKeywords = ( keyword: "buffer", }; + + // Use by: crypto-proposal const limitToRoundValidators: FuncKeywordDefinition = { // TODO: Check type (same as bignum) // @ts-ignore @@ -127,6 +128,7 @@ export const makeKeywords = ( }, }; + // Used by: crypto-messages (prevotes / precommits) and crypto-proposal const isValidatorIndex: FuncKeywordDefinition = { // @ts-ignore compile() { From 68a746e6d0a4988f6c3fa5f5514f1c323a3d73da Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 16:03:29 +0100 Subject: [PATCH 06/13] Remove parseBlockNumber --- .../crypto-validation/source/keywords.test.ts | 85 ------------------- packages/crypto-validation/source/keywords.ts | 42 +-------- 2 files changed, 2 insertions(+), 125 deletions(-) diff --git a/packages/crypto-validation/source/keywords.test.ts b/packages/crypto-validation/source/keywords.test.ts index 04db356dce..5d52de069c 100644 --- a/packages/crypto-validation/source/keywords.test.ts +++ b/packages/crypto-validation/source/keywords.test.ts @@ -264,89 +264,4 @@ describe<{ assert.defined(context.validator.validate("test", "a").error); assert.defined(context.validator.validate("test", undefined).error); }); - - it("keyword isValidatorIndex - should be ok for parent height", (context) => { - const schema = { - $id: "test", - type: "object", - properties: { - height: { - type: "integer", - }, - validatorIndex: { isValidatorIndex: {} }, - }, - }; - context.validator.addSchema(schema); - - const { roundValidators } = context.app - .get(Identifiers.Cryptography.Configuration) - .getMilestone(1); - - for (let index = 0; index < roundValidators; index++) { - assert.undefined(context.validator.validate("test", { height: 1, validatorIndex: index }).error); - } - - assert.defined(context.validator.validate("test", { height: 1, validatorIndex: roundValidators }).error); - }); - - it("keyword isValidatorIndex - should be ok for parent block", (context) => { - const schema = { - $id: "test", - type: "object", - properties: { - data: { - type: "object", - properties: { - serialized: { - type: "string", - }, - }, - }, - validatorIndex: { isValidatorIndex: {} }, - }, - }; - context.validator.addSchema(schema); - - let { roundValidators } = context.app - .get(Identifiers.Cryptography.Configuration) - .getMilestone(1); - - const block1 = { - // height=2 - serialized: "000173452bb48901020000000000000000000000000000000", - }; - - for (let index = 0; index < roundValidators; index++) { - assert.undefined(context.validator.validate("test", { data: block1, validatorIndex: index }).error); - } - - assert.defined(context.validator.validate("test", { data: block1, validatorIndex: roundValidators }).error); - - // change milestone to 15 validators at height 15 - context.app - .get(Identifiers.Cryptography.Configuration) - .getMilestones()[2].height = 15; - - context.app - .get(Identifiers.Cryptography.Configuration) - .getMilestones()[2].roundValidators = 15; - - const block2 = { - // height=15 - serialized: "000173452bb489010f0000000000000000000000000000000", - }; - - for (let index = 0; index < 15; index++) { - assert.undefined(context.validator.validate("test", { data: block2, validatorIndex: index }).error); - } - - assert.defined(context.validator.validate("test", { data: block2, validatorIndex: 15 }).error); - - // block 1 still accepted - for (let index = 0; index < roundValidators; index++) { - assert.undefined(context.validator.validate("test", { data: block1, validatorIndex: index }).error); - } - - assert.defined(context.validator.validate("test", { data: block1, validatorIndex: 53 }).error); - }); }); diff --git a/packages/crypto-validation/source/keywords.ts b/packages/crypto-validation/source/keywords.ts index feb6d292fe..d7580f1622 100644 --- a/packages/crypto-validation/source/keywords.ts +++ b/packages/crypto-validation/source/keywords.ts @@ -2,41 +2,6 @@ import type { Contracts } from "@mainsail/contracts"; import { BigNumber } from "@mainsail/utils"; import type { AnySchemaObject, FuncKeywordDefinition } from "ajv"; -const parseBlockNumber = (parentSchema): number | undefined => { - if (!parentSchema || !parentSchema.parentData) { - return undefined; - } - - // prevotes / precommits - if (parentSchema.parentData.blockNumber !== undefined) { - return parentSchema.parentData.blockNumber; - } - - if (!parentSchema.parentData.data) { - return undefined; - } - - // Proposals contain the block only in serialized form (hex). - // We can extract the block number at a fixed offset here, without needing to deserialize the whole block. - - // See packages/crypto-messages/source/serializer.ts#serializeProposed for reference. - const serialized = parentSchema.parentData.data.serialized; - if (!serialized) { - return undefined; - } - - if (serialized.length < 30) { - return undefined; - } - - const lockProofSize = 2 + Number.parseInt(serialized.slice(0, 2), 16) * 2; - // version: 1 byte (2 hex) - // timestamp: 6 bytes (12 hex) - // blockNumber: 4 byte (8 hex) - const offset = lockProofSize + 2 + 12; - return Buffer.from(serialized.slice(offset, offset + 8), "hex").readUInt32LE(); -}; - export const makeKeywords = ( configuration: Contracts.Crypto.Configuration, ): { @@ -99,7 +64,6 @@ export const makeKeywords = ( // Use by: crypto-proposal const limitToRoundValidators: FuncKeywordDefinition = { - // TODO: Check type (same as bignum) // @ts-ignore compile(schema: { minimum?: number }) { return (data, parentSchema: AnySchemaObject) => { @@ -107,8 +71,7 @@ export const makeKeywords = ( return false; } - const blockNumber = parseBlockNumber(parentSchema); - const { roundValidators } = configuration.getMilestone(blockNumber); + const { roundValidators } = configuration.getMilestone(); const minimum = schema.minimum !== undefined ? schema.minimum : roundValidators; if (data.length < minimum || data.length > roundValidators) { @@ -141,8 +104,7 @@ export const makeKeywords = ( return false; } - const blockNumber = parseBlockNumber(parentSchema); - const { roundValidators } = configuration.getMilestone(blockNumber); + const { roundValidators } = configuration.getMilestone(); return data < roundValidators; }; From 649c5dbf33add0745fe56662db95f9c4dd4d8260 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 16:10:52 +0100 Subject: [PATCH 07/13] Check minimum --- packages/crypto-validation/source/keywords.test.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/crypto-validation/source/keywords.test.ts b/packages/crypto-validation/source/keywords.test.ts index 5d52de069c..10d76ccc08 100644 --- a/packages/crypto-validation/source/keywords.test.ts +++ b/packages/crypto-validation/source/keywords.test.ts @@ -232,15 +232,13 @@ describe<{ .get(Identifiers.Cryptography.Configuration) .getMilestone(1); - let matrix = new Array(roundValidators).fill(true); - assert.undefined(context.validator.validate("test", matrix).error); + for(const minimum of [0, 1, roundValidators - 1, roundValidators]) { + let matrix = new Array(minimum).fill(true); + assert.undefined(context.validator.validate("test", matrix).error); + }; - matrix = new Array(roundValidators + 1).fill(true); + let matrix = new Array(roundValidators + 1).fill(true); assert.defined(context.validator.validate("test", matrix).error); - - assert.undefined(context.validator.validate("test", []).error); - assert.undefined(context.validator.validate("test", [false]).error); - assert.undefined(context.validator.validate("test", [true]).error); }); it("keyword isValidatorIndex - should be ok", (context) => { From 76d1dbd17eaf15e32da3df066ccdb670742f657d Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 16:11:05 +0100 Subject: [PATCH 08/13] Add comment --- packages/crypto-validation/source/keywords.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/crypto-validation/source/keywords.ts b/packages/crypto-validation/source/keywords.ts index d7580f1622..7b562b064f 100644 --- a/packages/crypto-validation/source/keywords.ts +++ b/packages/crypto-validation/source/keywords.ts @@ -62,7 +62,7 @@ export const makeKeywords = ( }; - // Use by: crypto-proposal + // Use by: crypto-proposal, p2p const limitToRoundValidators: FuncKeywordDefinition = { // @ts-ignore compile(schema: { minimum?: number }) { From 1325241d75bc62fb8939edb04863eb88ee58690a Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 16:14:27 +0100 Subject: [PATCH 09/13] Add limitToRoundValidators tests --- packages/crypto-validation/source/keywords.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/crypto-validation/source/keywords.test.ts b/packages/crypto-validation/source/keywords.test.ts index 10d76ccc08..c8adb0fc84 100644 --- a/packages/crypto-validation/source/keywords.test.ts +++ b/packages/crypto-validation/source/keywords.test.ts @@ -199,15 +199,21 @@ describe<{ .get(Identifiers.Cryptography.Configuration) .getMilestone(1); + // Valid cases let matrix = new Array(roundValidators).fill(true); assert.undefined(context.validator.validate("test", matrix).error); matrix = new Array(roundValidators).fill(false); assert.undefined(context.validator.validate("test", matrix).error); + // We don't check for boolean values, that should be defined at schema level matrix = new Array(roundValidators).fill(1); assert.undefined(context.validator.validate("test", matrix).error); + matrix = new Array(roundValidators).fill("a"); + assert.undefined(context.validator.validate("test", matrix).error); + + // Invalid cases matrix = new Array(roundValidators - 1).fill(false); assert.defined(context.validator.validate("test", matrix).error); From 50b72c30c40d51f820e08fd0a448fc90e67481dc Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 16:19:28 +0100 Subject: [PATCH 10/13] Cleanup keywords --- packages/crypto-validation/source/keywords.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/crypto-validation/source/keywords.ts b/packages/crypto-validation/source/keywords.ts index 7b562b064f..479ca14a79 100644 --- a/packages/crypto-validation/source/keywords.ts +++ b/packages/crypto-validation/source/keywords.ts @@ -1,6 +1,6 @@ import type { Contracts } from "@mainsail/contracts"; import { BigNumber } from "@mainsail/utils"; -import type { AnySchemaObject, FuncKeywordDefinition } from "ajv"; +import type { FuncKeywordDefinition } from "ajv"; export const makeKeywords = ( configuration: Contracts.Crypto.Configuration, @@ -23,8 +23,7 @@ export const makeKeywords = ( }; const bignumber: FuncKeywordDefinition = { - // @ts-ignore - compile: (schema) => (data, parentSchema: AnySchemaObject) => { + compile: (schema) => (data) => { const minimum = schema.minimum !== undefined ? schema.minimum : 0; const maximum = schema.maximum !== undefined ? schema.maximum : BigNumber.UINT256_MAX; @@ -64,9 +63,8 @@ export const makeKeywords = ( // Use by: crypto-proposal, p2p const limitToRoundValidators: FuncKeywordDefinition = { - // @ts-ignore compile(schema: { minimum?: number }) { - return (data, parentSchema: AnySchemaObject) => { + return (data) => { if (!Array.isArray(data)) { return false; } @@ -93,9 +91,8 @@ export const makeKeywords = ( // Used by: crypto-messages (prevotes / precommits) and crypto-proposal const isValidatorIndex: FuncKeywordDefinition = { - // @ts-ignore compile() { - return (data, parentSchema: AnySchemaObject) => { + return (data) => { if (!Number.isInteger(data)) { return false; } From 2a183962df26a69630eba10e27328ef983432d22 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 16:20:13 +0100 Subject: [PATCH 11/13] Test negative values --- packages/crypto-validation/source/keywords.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/crypto-validation/source/keywords.test.ts b/packages/crypto-validation/source/keywords.test.ts index c8adb0fc84..ae0fc3ae98 100644 --- a/packages/crypto-validation/source/keywords.test.ts +++ b/packages/crypto-validation/source/keywords.test.ts @@ -262,6 +262,7 @@ describe<{ assert.undefined(context.validator.validate("test", index).error); } + assert.defined(context.validator.validate("test", -1).error); assert.defined(context.validator.validate("test", 50.000_01).error); assert.defined(context.validator.validate("test", roundValidators).error); assert.defined(context.validator.validate("test", roundValidators + 1).error); From 0745fd23de13d256b29e03d9e0b061afa1dfe683 Mon Sep 17 00:00:00 2001 From: sebastijankuzner <58827427+sebastijankuzner@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:25:46 +0000 Subject: [PATCH 12/13] style: resolve style guide violations [ci-lint-fix] --- packages/crypto-validation/source/keywords.test.ts | 4 ++-- packages/crypto-validation/source/keywords.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/crypto-validation/source/keywords.test.ts b/packages/crypto-validation/source/keywords.test.ts index ae0fc3ae98..5732d8ea7e 100644 --- a/packages/crypto-validation/source/keywords.test.ts +++ b/packages/crypto-validation/source/keywords.test.ts @@ -238,10 +238,10 @@ describe<{ .get(Identifiers.Cryptography.Configuration) .getMilestone(1); - for(const minimum of [0, 1, roundValidators - 1, roundValidators]) { + for (const minimum of [0, 1, roundValidators - 1, roundValidators]) { let matrix = new Array(minimum).fill(true); assert.undefined(context.validator.validate("test", matrix).error); - }; + } let matrix = new Array(roundValidators + 1).fill(true); assert.defined(context.validator.validate("test", matrix).error); diff --git a/packages/crypto-validation/source/keywords.ts b/packages/crypto-validation/source/keywords.ts index 479ca14a79..00091f3660 100644 --- a/packages/crypto-validation/source/keywords.ts +++ b/packages/crypto-validation/source/keywords.ts @@ -60,7 +60,6 @@ export const makeKeywords = ( keyword: "buffer", }; - // Use by: crypto-proposal, p2p const limitToRoundValidators: FuncKeywordDefinition = { compile(schema: { minimum?: number }) { From 1a9aa4df1f4ec79e727eda716123701a1751ccca Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Fri, 20 Mar 2026 16:46:58 +0100 Subject: [PATCH 13/13] Fix crypto messages --- packages/crypto-messages/source/factory.test.ts | 1 + packages/crypto-messages/source/schemas.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/crypto-messages/source/factory.test.ts b/packages/crypto-messages/source/factory.test.ts index 58e2926ec3..104d666ba5 100644 --- a/packages/crypto-messages/source/factory.test.ts +++ b/packages/crypto-messages/source/factory.test.ts @@ -30,6 +30,7 @@ describe<{ }>("Factory", ({ it, assert, beforeEach }) => { beforeEach(async (context) => { await prepareSandbox(context); + context.app.get(Identifiers.Cryptography.Configuration).setHeight(1); // Required by schema to set number for validators const wallet = {}; const validatorSet = { diff --git a/packages/crypto-messages/source/schemas.test.ts b/packages/crypto-messages/source/schemas.test.ts index 1a347370fb..b0f3456a3e 100644 --- a/packages/crypto-messages/source/schemas.test.ts +++ b/packages/crypto-messages/source/schemas.test.ts @@ -21,6 +21,7 @@ describe<{ context.app.bind(Identifiers.Cryptography.Configuration).to(Configuration).inSingletonScope(); context.app.get(Identifiers.Cryptography.Configuration).setConfig(cryptoJson); + context.app.get(Identifiers.Cryptography.Configuration).setHeight(1); // Required by schema to set number for validators context.validator = context.app.resolve(Validator);