From 6dfe53ac8c0abca684f43bd539c82b423d88e213 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Thu, 2 Feb 2023 11:25:48 +0000 Subject: [PATCH] Fix typescript error Error: builtins2.spec.ts(38,36): error TS2345: Argument of type 'AnyJson' is not assignable to parameter of type 'string | number | bigint | boolean'. Error: builtins2.spec.ts(47,31): error TS2345: Argument of type 'AnyJson' is not assignable to parameter of type 'string | number | bigint | boolean'. Signed-off-by: Sean Young --- integration/substrate/builtins2.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/substrate/builtins2.spec.ts b/integration/substrate/builtins2.spec.ts index b35dc59112..f0e7768a5f 100644 --- a/integration/substrate/builtins2.spec.ts +++ b/integration/substrate/builtins2.spec.ts @@ -34,17 +34,17 @@ describe('Deploy builtins2 contract and test', () => { let { output: gas_left } = await query(conn, alice, contract, "burnGas", [0], undefined, convertWeight(gasLimit).v2Weight); let gas = BigInt(gas_left!.toString()); - expect(gasLimit.toJSON().refTime).toBeGreaterThan(gas); - let previous_diff = BigInt(gasLimit.toJSON().refTime) - gas; + expect(gasLimit.refTime.toBigInt()).toBeGreaterThan(gas); + let previous_diff = gasLimit.refTime.toBigInt() - gas; // Gas metering is based on execution time: // Expect each call to burn between 10000..1000000 more gas than the previous iteration. for (let i = 1; i < 100; i++) { let { output: gas_left } = await query(conn, alice, contract, "burnGas", [i], undefined, convertWeight(gasLimit).v2Weight); let gas = BigInt(gas_left!.toString()); - expect(gasLimit.toJSON().refTime).toBeGreaterThan(gas); + expect(gasLimit.refTime.toBigInt()).toBeGreaterThan(gas); - let diff = BigInt(gasLimit.toJSON().refTime) - gas; + let diff = gasLimit.refTime.toBigInt() - gas; expect(diff).toBeGreaterThan(previous_diff); expect(diff - previous_diff).toBeLessThan(1e6); expect(diff - previous_diff).toBeGreaterThan(1e4);