diff --git a/e2e-tests/historical/endpoints/kusama/runtime/spec/10000.json b/e2e-tests/historical/endpoints/kusama/runtime/spec/10000.json index 734874ad4..09f46300f 100644 --- a/e2e-tests/historical/endpoints/kusama/runtime/spec/10000.json +++ b/e2e-tests/historical/endpoints/kusama/runtime/spec/10000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "2", "tokenDecimals": [ "12" diff --git a/e2e-tests/historical/endpoints/kusama/runtime/spec/100000.json b/e2e-tests/historical/endpoints/kusama/runtime/spec/100000.json index 6ef40674b..60c9f807d 100644 --- a/e2e-tests/historical/endpoints/kusama/runtime/spec/100000.json +++ b/e2e-tests/historical/endpoints/kusama/runtime/spec/100000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "2", "tokenDecimals": [ "12" diff --git a/e2e-tests/historical/endpoints/kusama/runtime/spec/2000000.json b/e2e-tests/historical/endpoints/kusama/runtime/spec/2000000.json index 3dc9c2b56..f7394828e 100644 --- a/e2e-tests/historical/endpoints/kusama/runtime/spec/2000000.json +++ b/e2e-tests/historical/endpoints/kusama/runtime/spec/2000000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "2", "tokenDecimals": [ "12" diff --git a/e2e-tests/historical/endpoints/kusama/runtime/spec/4000000.json b/e2e-tests/historical/endpoints/kusama/runtime/spec/4000000.json index 9ad04a885..72b953572 100644 --- a/e2e-tests/historical/endpoints/kusama/runtime/spec/4000000.json +++ b/e2e-tests/historical/endpoints/kusama/runtime/spec/4000000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "2", "tokenDecimals": [ "12" diff --git a/e2e-tests/historical/endpoints/kusama/runtime/spec/8000000.json b/e2e-tests/historical/endpoints/kusama/runtime/spec/8000000.json index 6b167d69c..83b183503 100644 --- a/e2e-tests/historical/endpoints/kusama/runtime/spec/8000000.json +++ b/e2e-tests/historical/endpoints/kusama/runtime/spec/8000000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "2", "tokenDecimals": [ "12" diff --git a/e2e-tests/historical/endpoints/polkadot/runtime/spec/1000.json b/e2e-tests/historical/endpoints/polkadot/runtime/spec/1000.json index e46056c60..517e9c95e 100644 --- a/e2e-tests/historical/endpoints/polkadot/runtime/spec/1000.json +++ b/e2e-tests/historical/endpoints/polkadot/runtime/spec/1000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "0", "tokenDecimals": [ "10" diff --git a/e2e-tests/historical/endpoints/polkadot/runtime/spec/200000.json b/e2e-tests/historical/endpoints/polkadot/runtime/spec/200000.json index 5c9eb041a..0bbe560d1 100644 --- a/e2e-tests/historical/endpoints/polkadot/runtime/spec/200000.json +++ b/e2e-tests/historical/endpoints/polkadot/runtime/spec/200000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "0", "tokenDecimals": [ "10" diff --git a/e2e-tests/historical/endpoints/polkadot/runtime/spec/3000000.json b/e2e-tests/historical/endpoints/polkadot/runtime/spec/3000000.json index 613b9fc97..0d63aeb96 100644 --- a/e2e-tests/historical/endpoints/polkadot/runtime/spec/3000000.json +++ b/e2e-tests/historical/endpoints/polkadot/runtime/spec/3000000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "0", "tokenDecimals": [ "10" diff --git a/e2e-tests/historical/endpoints/polkadot/runtime/spec/6877002.json b/e2e-tests/historical/endpoints/polkadot/runtime/spec/6877002.json index fc7c1a4d8..518927abd 100644 --- a/e2e-tests/historical/endpoints/polkadot/runtime/spec/6877002.json +++ b/e2e-tests/historical/endpoints/polkadot/runtime/spec/6877002.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "0", "tokenDecimals": [ "10" diff --git a/e2e-tests/historical/endpoints/westend/runtime/spec/10000.json b/e2e-tests/historical/endpoints/westend/runtime/spec/10000.json index 5a5114119..cc9d9e435 100644 --- a/e2e-tests/historical/endpoints/westend/runtime/spec/10000.json +++ b/e2e-tests/historical/endpoints/westend/runtime/spec/10000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "42", "tokenDecimals": [ "12" diff --git a/e2e-tests/historical/endpoints/westend/runtime/spec/2000000.json b/e2e-tests/historical/endpoints/westend/runtime/spec/2000000.json index f69e29b48..b0bbdc86a 100644 --- a/e2e-tests/historical/endpoints/westend/runtime/spec/2000000.json +++ b/e2e-tests/historical/endpoints/westend/runtime/spec/2000000.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "42", "tokenDecimals": [ "12" diff --git a/e2e-tests/historical/endpoints/westend/runtime/spec/7417678.json b/e2e-tests/historical/endpoints/westend/runtime/spec/7417678.json index 4bbb2987f..b8ec43e2a 100644 --- a/e2e-tests/historical/endpoints/westend/runtime/spec/7417678.json +++ b/e2e-tests/historical/endpoints/westend/runtime/spec/7417678.json @@ -12,6 +12,7 @@ "live": null }, "properties": { + "isEthereum": false, "ss58Format": "42", "tokenDecimals": [ "12" diff --git a/e2e-tests/jest.config.js b/e2e-tests/jest.config.js index c295b03d7..c729b162a 100644 --- a/e2e-tests/jest.config.js +++ b/e2e-tests/jest.config.js @@ -6,9 +6,14 @@ module.exports = { testEnvironment: 'node', maxConcurrency: 3, maxWorkers: '50%', - globals: { - 'ts-jest': { - isloatedModules: true - } - } + transform: { + // '^.+\\.[tj]sx?$' to process js/ts with `ts-jest` + // '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest` + '^.+\\.tsx?$': [ + 'ts-jest', + { + isolatedModules: true + }, + ], + }, }; diff --git a/src/sanitize/sanitizeNumbers.ts b/src/sanitize/sanitizeNumbers.ts index c7f4f33cd..9677fb3d1 100644 --- a/src/sanitize/sanitizeNumbers.ts +++ b/src/sanitize/sanitizeNumbers.ts @@ -236,7 +236,10 @@ function mapTypeSanitizeKeyValue( const jsonMap: AnyJson = {}; map.forEach((value: unknown, key: unknown) => { - const nonCodecKey = sanitizeNumbers(key, options); + let nonCodecKey = sanitizeNumbers(key, options); + if (typeof nonCodecKey === 'object') { + nonCodecKey = JSON.stringify(nonCodecKey); + } if (!(typeof nonCodecKey === 'string' || typeof nonCodecKey === 'number')) { throw new InternalServerError( 'Unexpected non-string and non-number key while sanitizing a Map-like type'