diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 085dae9..0000000 --- a/.eslintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@typescript-eslint/no-explicit-any": "off" - } -} \ No newline at end of file diff --git a/demo/src/utils.js b/demo/src/utils.js index 10277d5..a1204cd 100644 --- a/demo/src/utils.js +++ b/demo/src/utils.js @@ -28,34 +28,48 @@ export const getKeyringPair = async (ss58Format) => { return keyringPair; }; -export const sendExtrinsic = (extrinsic, api, keyringPair) => +export const sendExtrinsic = (api, extrinsic, keyPair) => new Promise((resolve, reject) => { const signAndSend = async () => { - const unsub = await extrinsic.signAndSend(keyringPair, (result) => { - const { status, events, dispatchError } = result; - console.log("status.type: ", status.type); - - if (status?.isFinalized) { - unsub(); - if (!_.isNil(dispatchError)) { - reject(dispatchError); - } + try { + const unsub = await extrinsic.signAndSend(keyPair, (result) => { + const { status, events, dispatchError } = result; + console.log("status.type: ", status.type); + + if (status?.isFinalized) { + unsub(); + + if (dispatchError) { + if (dispatchError.isModule) { + const metaError = api.registry.findMetaError( + dispatchError.asModule, + ); + const { name, section } = metaError; + reject(new Error(`${section}.${name}`)); + } + + reject(new Error(dispatchError.toString())); + } - const event = _.find(events, ({ event: eventData }) => - api.events.system.ExtrinsicSuccess.is(eventData), - ); - if (event) { - resolve({ - blockHash: status?.asFinalized?.toString(), - events, - extrinsicHash: extrinsic.hash, - }); - } else { - reject(new Error("The event.ExtrinsicSuccess is not found")); + const event = _.find(events, ({ event: eventData }) => + api.events.system.ExtrinsicSuccess.is(eventData), + ); + if (event) { + resolve({ + blockHash: status?.asFinalized?.toString(), + events, + extrinsicHash: extrinsic?.hash?.toString(), + }); + } + reject(new Error(events.toString())); } - } - }); + }); + } catch (ex) { + // Handle signing error such as user manually cancel the transaction + reject(ex); + } }; + signAndSend(); }); diff --git a/test/functional/dynamicDispatchTask.test.ts b/test/functional/dynamicDispatchTask.test.ts index 073e5d0..5642f17 100644 --- a/test/functional/dynamicDispatchTask.test.ts +++ b/test/functional/dynamicDispatchTask.test.ts @@ -9,6 +9,7 @@ import { getDynamicDispatchExtrinsicParams, SECTION_NAME, sendExtrinsic, + getPastTime, } from "../utils/helpFn"; import { AutomationTimeApi } from "../utils"; import { @@ -27,1055 +28,1100 @@ const initialize = async () => { keyringPair = context.keyringPair; }; -beforeAll(() => initialize(), DEFAULT_TIMEOUT_INITIALIZE); -afterAll(() => polkadotApi?.disconnect()); - -/** - * dynamicDispatchTask.fixed schedule and cancel succeed - */ -test( - "dynamicDispatchTask.fixed schedule and cancel succeed", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - - const { - schedule: { - fixed: { executionTimes }, - }, - } = extrinsicParams; - - const taskID = await scheduleDynamicDispatchTaskAndVerify( - automationTimeApi, - keyringPair, - extrinsicParams, - ); - - // Cancel task and verify - await cancelTaskAndVerify( - automationTimeApi, - keyringPair, - taskID, - executionTimes[0], - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring schedule and cancel succeed - */ -test( - "dynamicDispatchTask.recurring schedule and cancel succeed", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { - schedule: { - recurring: { nextExecutionTime }, - }, - } = extrinsicParams; - - const taskID = await scheduleDynamicDispatchTaskAndVerify( - automationTimeApi, - keyringPair, - extrinsicParams, - ); - - // Cancel task and verify - await cancelTaskAndVerify( - automationTimeApi, - keyringPair, - taskID, - nextExecutionTime, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600-1) fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600-1) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency -= 1; - - // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, +describe("test-dynamic-dispatch-task", () => { + beforeAll(() => initialize(), DEFAULT_TIMEOUT_INITIALIZE); + afterAll(() => polkadotApi?.disconnect()); + + /** + * dynamicDispatchTask.fixed schedule and cancel succeed + */ + it( + "dynamicDispatchTask.fixed schedule and cancel succeed", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency - */ -test( - "dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600*0.5) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency *= 0.5; - schedule.recurring.frequency = Math.ceil(schedule.recurring.frequency); - - // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( + + const { + schedule: { + fixed: { executionTimes }, + }, + } = extrinsicParams; + + const taskID = await scheduleDynamicDispatchTaskAndVerify( + automationTimeApi, keyringPair, - schedule, - call, + extrinsicParams, ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600*3.3) fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600*3.3) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency *= 1.3; - schedule.recurring.frequency = Math.ceil(schedule.recurring.frequency); - - // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( + + expect(typeof taskID).toBe("string"); + + // Cancel task and verify + await cancelTaskAndVerify( + automationTimeApi, keyringPair, - schedule, - call, + taskID, + executionTimes[0], ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is 0 fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is 0 fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency = 0; - - // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency - // const extrinsicHex = await scheduler.buildScheduleDynamicDispatchTask(keyringPair, schedule, call); - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is negtive integer fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is negtive integer fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency = -1; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is larger than Number.MAX_SAFE_INTEGER fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is larger than Number.MAX_SAFE_INTEGER fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency = Number.MAX_SAFE_INTEGER + 1; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is string fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is string fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency = "123123"; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is object fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is object fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency = {}; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is null fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is null fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency = null; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is undefined fails - */ -test( - "dynamicDispatchTask.recurring with frequency that is undefined fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.frequency = undefined; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring nextExecutionTime on non-o’clock(+5min) fails. - */ -test( - "dynamicDispatchTask.recurring nextExecutionTime on non-o’clock(+5min) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime += 5 * 60; - - // automationTimeApi.buildScheduleDynamicDispatchTask will fail with invalid frequency - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * dynamicDispatchTask.recurring schedule and cancel succeed + */ + it( + "dynamicDispatchTask.recurring schedule and cancel succeed", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring nextExecutionTime on non-o’clock(+30min) fails. - */ -test( - "dynamicDispatchTask.recurring nextExecutionTime on non-o’clock(+30min) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime += 30 * 60; - - // automationTimeApi.buildScheduleDynamicDispatchTask will fail with invalid frequency - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( + const { + schedule: { + recurring: { nextExecutionTime }, + }, + } = extrinsicParams; + + const taskID = await scheduleDynamicDispatchTaskAndVerify( + automationTimeApi, keyringPair, - schedule, - call, + extrinsicParams, ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring nextExecutionTime on non-o’clock(+45min) fails. - */ -test( - "dynamicDispatchTask.recurring nextExecutionTime on non-o’clock(+45min) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime += 30 * 60; - - // automationTimeApi.buildScheduleDynamicDispatchTask will fail with invalid frequency - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( + + expect(typeof taskID).toBe("string"); + + // Cancel task and verify + await cancelTaskAndVerify( + automationTimeApi, keyringPair, - schedule, - call, + taskID, + nextExecutionTime, ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with nextExecutionTime that is 0 fails - */ -test( - "dynamicDispatchTask.recurring with nextExecutionTime that is 0 fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime = 0; - - // automationTimeApi.buildScheduleDynamicDispatchTask will fail with invalid frequency - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with nextExecutionTime that is negtive integer fails - */ -test( - "dynamicDispatchTask.recurring with nextExecutionTime that is negtive integer fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime = -1; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with nextExecutionTime that is larger than Number.MAX_SAFE_INTEGER fails - */ -test( - "dynamicDispatchTask.recurring with nextExecutionTime that is larger than Number.MAX_SAFE_INTEGER fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime = Number.MAX_SAFE_INTEGER + 1; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with nextExecutionTime that is string fails - */ -test( - "dynamicDispatchTask.recurring with nextExecutionTime that is string fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime = "123123"; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with frequency that is object fails - */ -test( - "dynamicDispatchTask.recurring with nextExecutionTime that is object fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime = {}; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with nextExecutionTime that is null fails - */ -test( - "dynamicDispatchTask.recurring with nextExecutionTime that is null fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime = null; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with nextExecutionTime that is undefined fails - */ -test( - "dynamicDispatchTask.recurring with nextExecutionTime that is undefined fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule, call } = extrinsicParams; - schedule.recurring.nextExecutionTime = undefined; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution time on non-o’clock(+5min) fails - */ -test( - "dynamicDispatchTask.fixed schedule with execution time on non-o’clock(+5min) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes[0] += 60 * 5; - - // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Call dynamicDispatchTask.recurring task with nextExecutionTime that is is a past time will throw automationTime.PastTime error + */ + it( + "call dynamicDispatchTask.recurring task with nextExecutionTime that is a past time will throw automationTime.PastTime error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution time on non-o’clock(+30min) fails - */ -test( - "dynamicDispatchTask.fixed schedule with execution time on non-o’clock(+30min) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes[0] += 60 * 30; - - // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime = getPastTime(); + + // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.PastTime`, ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution time on non-o’clock(+45min) fails - */ -test( - "dynamicDispatchTask.fixed schedule with execution time on non-o’clock(+45min) fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes[0] += 60 * 30; - - const extrinsicHex = - await automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600-1) fails + */ + it( + "dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600-1) fails", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", ); - await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( - `${SECTION_NAME}.InvalidTime`, - ); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution time that is string fails - */ -test( - "dynamicDispatchTask.fixed schedule with filling execution time string fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = "abc"; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution time that is object fails - */ -test( - "dynamicDispatchTask.fixed schedule with filling execution time object fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = {}; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution time that is null fails - */ -test( - "dynamicDispatchTask.fixed schedule with filling execution time null fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = null; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution time that is undefined fails - */ -test( - "dynamicDispatchTask.fixed schedule with filling execution time undefined fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = undefined; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with empty execution times array fails - */ -test( - "dynamicDispatchTask.fixed schedule with empty execution times array fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = []; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution times array that is string fails - */ -test( - "dynamicDispatchTask.fixed schedule with execution times array that is string fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = "abc"; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution times array that is object fails - */ -test( - "dynamicDispatchTask.fixed schedule with execution times array that is object fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = {}; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution times array that is null fails - */ -test( - "dynamicDispatchTask.fixed schedule with execution times array that is null fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = null; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed schedule with execution times array that is undefined fails - */ -test( - "dynamicDispatchTask.fixed schedule with execution times array that is undefined fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule, call } = extrinsicParams; - schedule.fixed.executionTimes = undefined; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed with null call fails - */ -test( - "dynamicDispatchTask.fixed with null call fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule } = extrinsicParams; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - null, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed with undefined call fails - */ -test( - "dynamicDispatchTask.fixed with undefined call fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { schedule } = extrinsicParams; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - undefined, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with null call fails - */ -test( - "dynamicDispatchTask.recurring with null call fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule } = extrinsicParams; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - null, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with undefined call fails - */ -test( - "dynamicDispatchTask.recurring with undefined call fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { schedule } = extrinsicParams; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - schedule, - undefined, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed with null schedule fails - */ -test( - "dynamicDispatchTask.fixed with null schedule fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { call } = extrinsicParams; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - null, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.fixed with undefined schedule fails - */ -test( - "dynamicDispatchTask.fixed with undefined schedule fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "fixed", - ); - const { call } = extrinsicParams; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - undefined, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with null schedule fails - */ -test( - "dynamicDispatchTask.recurring with null schedule fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { call } = extrinsicParams; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - null, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); - -/** - * dynamicDispatchTask.recurring with undefined schedule fails - */ -test( - "dynamicDispatchTask.recurring with undefined schedule fails", - async () => { - const extrinsicParams = await getDynamicDispatchExtrinsicParams( - polkadotApi, - "recurring", - ); - const { call } = extrinsicParams; - - await expect( - automationTimeApi.buildScheduleDynamicDispatchTask( - keyringPair, - undefined, - call, - ), - ).rejects.toThrow(); - }, - DEFAULT_TIMEOUT_PER_TEST, -); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency -= 1; + + // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency + */ + it( + "dynamicDispatchTask.recurring with frequency that is not a multiply of a timeslot fails", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency *= 0.5; + schedule.recurring.frequency = Math.ceil(schedule.recurring.frequency); + + // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600*3.3) fails + */ + it( + "dynamicDispatchTask.recurring with frequency that is not a multiply of 3600(3600*3.3) fails", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency *= 1.3; + schedule.recurring.frequency = Math.ceil(schedule.recurring.frequency); + + // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with frequency that is 0 fails will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with frequency that is 0 fails will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency = 0; + + // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency + // const extrinsicHex = await scheduler.buildScheduleDynamicDispatchTask(keyringPair, schedule, call); + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("frequency must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with frequency that is negtive integer will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with frequency that is negtive integer will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency = -1; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("frequency must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with frequency that is larger than Number.MAX_SAFE_INTEGER will throw too large error + */ + it( + "build dynamicDispatchTask.recurring task with frequency that is larger than Number.MAX_SAFE_INTEGER will throw too large error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency = Number.MAX_SAFE_INTEGER + 1; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow( + 'createType(Call):: Call: failed decoding automationTime.scheduleDynamicDispatchTask:: Struct: failed on args: {"schedule":"{\\"_enum\\":{\\"Fixed\\":\\"{\\\\\\"executionTimes\\\\\\":\\\\\\"Vec\\\\\\"}\\",\\"Recurring\\":\\"{\\\\\\"nextExecutionTime\\\\\\":\\\\\\"u64\\\\\\",\\\\\\"frequency\\\\\\":\\\\\\"u64\\\\\\"}\\"}}","call":"Call"}:: Struct: failed on schedule: {"_enum":{"Fixed":"{\\"executionTimes\\":\\"Vec\\"}","Recurring":"{\\"nextExecutionTime\\":\\"u64\\",\\"frequency\\":\\"u64\\"}"}}:: Enum(recurring):: Struct: failed on frequency: u64:: Number needs to be an integer <= Number.MAX_SAFE_INTEGER, i.e. 2 ^ 53 - 1', + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * dynamicDispatchTask.recurring with frequency that is string will throw not a positive integer error + */ + it( + "dynamicDispatchTask.recurring with frequency that is string will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency = "123123"; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("frequency must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with frequency that is object will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with frequency that is object will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency = {}; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("frequency must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring with frequency that is null will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring with frequency that is null will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency = null; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("frequency must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with frequency that is undefined will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with frequency that is undefined will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.frequency = undefined; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("frequency must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * build dynamicDispatchTask.recurring task with nextExecutionTime not on 10 minutes time slot(+5min) will throw automationTime.InvalidTime error. + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime not on 10 minutes time slot(+1min) will throw automationTime.InvalidTime error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime += 60 * 1; + + // automationTimeApi.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with nextExecutionTime not on non-o’clock(+7) will throw automationTime.InvalidTime error. + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime not on 10 minutes time slot(+5min) will throw automationTime.InvalidTime error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime += 30 * 5; + + // automationTimeApi.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * build dynamicDispatchTask.recurring task nextExecutionTime not on 10 minutes time slot(+5min) will throw automationTime.InvalidTime error. + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime not on 10 minutes time slot(+7min) will throw automationTime.InvalidTime error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime += 30 * 7; + + // automationTimeApi.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with nextExecutionTime that is 0 will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime that is 0 will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime = 0; + + // automationTimeApi.buildScheduleDynamicDispatchTask will fail with invalid frequency + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("nextExecutionTime must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with nextExecutionTime that is negtive integer fails + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime that is negtive integer will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime = -1; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("nextExecutionTime must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * dynamicDispatchTask.recurring with nextExecutionTime that is larger than Number.MAX_SAFE_INTEGER fails + */ + it( + "dynamicDispatchTask.recurring with nextExecutionTime that is larger than Number.MAX_SAFE_INTEGER will throw too large error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime = Number.MAX_SAFE_INTEGER + 1; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow( + 'createType(Call):: Call: failed decoding automationTime.scheduleDynamicDispatchTask:: Struct: failed on args: {"schedule":"{\\"_enum\\":{\\"Fixed\\":\\"{\\\\\\"executionTimes\\\\\\":\\\\\\"Vec\\\\\\"}\\",\\"Recurring\\":\\"{\\\\\\"nextExecutionTime\\\\\\":\\\\\\"u64\\\\\\",\\\\\\"frequency\\\\\\":\\\\\\"u64\\\\\\"}\\"}}","call":"Call"}:: Struct: failed on schedule: {"_enum":{"Fixed":"{\\"executionTimes\\":\\"Vec\\"}","Recurring":"{\\"nextExecutionTime\\":\\"u64\\",\\"frequency\\":\\"u64\\"}"}}:: Enum(recurring):: Struct: failed on nextExecutionTime: u64:: Number needs to be an integer <= Number.MAX_SAFE_INTEGER, i.e. 2 ^ 53 - 1', + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with nextExecutionTime that is string will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime that is string will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime = "123123"; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("nextExecutionTime must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with nextExecutionTime that is object will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime that is object will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime = {}; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("nextExecutionTime must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with nextExecutionTime that is null will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime that is null will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime = null; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("nextExecutionTime must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with nextExecutionTime that is undefined will throw not a positive integer error + */ + it( + "build dynamicDispatchTask.recurring task with nextExecutionTime that is undefined will throw not a positive integer error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule, call } = extrinsicParams; + schedule.recurring.nextExecutionTime = undefined; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("nextExecutionTime must be a positive integer"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Send dynamicDispatchTask.fixed task with execution time not on 10 minutes time slot(+5min) will throw automationTime.InvalidTime error + */ + it( + "send dynamicDispatchTask.fixed task with execution time not on 10 minutes time slot(+1min) will throw automationTime.InvalidTime error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes[0] += 60 * 1; + + // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Send dynamicDispatchTask.fixed task with execution time not on 10 minutes time slot(+5min) will throw automationTime.InvalidTime error + */ + it( + "send dynamicDispatchTask.fixed task with execution time not on 10 minutes time slot(+5min) will throw automationTime.InvalidTime error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes[0] += 60 * 5; + + // scheduler.buildScheduleDynamicDispatchTask will fail with invalid frequency + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Send dynamicDispatchTask.fixed task with execution time not on 10 minutes time slot(+7min) will throw automationTime.InvalidTime error + */ + it( + "send dynamicDispatchTask.fixed task with execution time not on 10 minutes time slot(+7min) will throw automationTime.InvalidTime error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes[0] += 60 * 7; + + const extrinsicHex = + await automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ); + await expect(sendExtrinsic(polkadotApi, extrinsicHex)).rejects.toThrow( + `${SECTION_NAME}.InvalidTime`, + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with execution time that is string will throw not an array error + */ + it( + "build dynamicDispatchTask.fixed task with filling execution time string will throw not an array error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = "abc"; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is not an array"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task schedule with execution time that is object will throw not an array error + */ + it( + "build dynamicDispatchTask.fixed task with filling execution time object will throw not an array error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = {}; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is not an array"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with execution time that is null will throw not an array error + */ + it( + "build dynamicDispatchTask.fixed task with filling execution time null will throw not an array error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = null; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is not an array"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with execution time that is undefined will throw not an array error + */ + it( + "build dynamicDispatchTask.fixed task with filling execution time undefined will throw not an array error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = undefined; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is not an array"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with empty execution times array will throw empty array error + */ + it( + "build dynamicDispatchTask.fixed task schedule with empty execution times array will throw empty array error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = []; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is empty"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with execution times array that is string will throw not an array error + */ + it( + "build dynamicDispatchTask.fixed task schedule with execution times array that is string will throw not an array error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = "abc"; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is not an array"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task schedule with execution times array that is object fails + */ + it( + "build dynamicDispatchTask.fixed task schedule with execution times array that is object will throw not an array", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = {}; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is not an array"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with execution times array that is null will throw not an array task error + */ + it( + "build dynamicDispatchTask.fixed task with execution times array that is null will throw not an array task error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = null; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is not an array"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with execution times array that is undefined will throw not an array error + */ + it( + "build dynamicDispatchTask.fixed task with execution times array that is undefined will throw not an array error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule, call } = extrinsicParams; + schedule.fixed.executionTimes = undefined; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + call, + ), + ).rejects.toThrow("executionTimes is not an array"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with null call will throw null call error + */ + it( + "build dynamicDispatchTask.fixed task with null call will throw null call error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule } = extrinsicParams; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + null, + ), + ).rejects.toThrow( + 'createType(Call):: Call: failed decoding automationTime.scheduleDynamicDispatchTask:: Struct: failed on args: {"schedule":"{\\"_enum\\":{\\"Fixed\\":\\"{\\\\\\"executionTimes\\\\\\":\\\\\\"Vec\\\\\\"}\\",\\"Recurring\\":\\"{\\\\\\"nextExecutionTime\\\\\\":\\\\\\"u64\\\\\\",\\\\\\"frequency\\\\\\":\\\\\\"u64\\\\\\"}\\"}}","call":"Call"}:: Struct: failed on call: Call:: Call: Cannot decode value \'null\' of type object', + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with undefined call will throw undefined call error + */ + it( + "build dynamicDispatchTask.fixed task with undefined call will throw undefined call error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { schedule } = extrinsicParams; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + undefined, + ), + ).rejects.toThrow("call is null or undefined"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with null call will throw null call error + */ + it( + "build dynamicDispatchTask.recurring task with null call will throw null call error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule } = extrinsicParams; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + null, + ), + ).rejects.toThrow( + 'createType(Call):: Call: failed decoding automationTime.scheduleDynamicDispatchTask:: Struct: failed on args: {"schedule":"{\\"_enum\\":{\\"Fixed\\":\\"{\\\\\\"executionTimes\\\\\\":\\\\\\"Vec\\\\\\"}\\",\\"Recurring\\":\\"{\\\\\\"nextExecutionTime\\\\\\":\\\\\\"u64\\\\\\",\\\\\\"frequency\\\\\\":\\\\\\"u64\\\\\\"}\\"}}","call":"Call"}:: Struct: failed on call: Call:: Call: Cannot decode value \'null\' of type object', + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with undefined call fails + */ + it( + "build dynamicDispatchTask.recurrin task with undefined call will throw undefined call error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { schedule } = extrinsicParams; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + schedule, + undefined, + ), + ).rejects.toThrow("call is null or undefined"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with null schedule will throw null object error + */ + it( + "build dynamicDispatchTask.fixed with null schedule will throw null object error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { call } = extrinsicParams; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + null, + call, + ), + ).rejects.toThrow("Cannot read properties of null (reading 'recurring')"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.fixed task with undefined schedule will throw undefined object error + */ + it( + "build dynamicDispatchTask.fixed task with undefined schedule will throw undefined object error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "fixed", + ); + const { call } = extrinsicParams; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + undefined, + call, + ), + ).rejects.toThrow( + "Cannot read properties of undefined (reading 'recurring')", + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with null schedule fails will throw null object error + */ + it( + "build dynamicDispatchTask.recurring task with null schedule fails will throw null object error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { call } = extrinsicParams; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + null, + call, + ), + ).rejects.toThrow("Cannot read properties of null (reading 'recurring')"); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); + + /** + * Build dynamicDispatchTask.recurring task with undefined schedule will throw undefind object error + */ + it( + "build dynamicDispatchTask.recurring task with undefined schedule will throw undefind object error", + async () => { + const extrinsicParams = await getDynamicDispatchExtrinsicParams( + polkadotApi, + "recurring", + ); + const { call } = extrinsicParams; + + await expect( + automationTimeApi.buildScheduleDynamicDispatchTask( + keyringPair, + undefined, + call, + ), + ).rejects.toThrow( + "Cannot read properties of undefined (reading 'recurring')", + ); + }, + DEFAULT_TIMEOUT_PER_TEST, + ); +}); diff --git a/test/package.json b/test/package.json new file mode 100644 index 0000000..afcfc3b --- /dev/null +++ b/test/package.json @@ -0,0 +1,18 @@ +{ + "name": "demo", + "version": "1.0.0", + "description": "", + "main": "index.js", + "author": "", + "license": "ISC", + "dependencies": { + "@oak-network/api-augment": "file:../packages/api-augment/build", + "@oak-network/types": "file:../packages/types/build", + "@polkadot/api": "^10.11.1", + "@polkadot/types": "^10.11.1", + "@polkadot/util": "^12.6.1", + "@polkadot/wasm-crypto": "^7.3.1", + "bn.js": "^5.2.1", + "lodash": "^4.17.21" + } +} diff --git a/test/utils/helpFn.ts b/test/utils/helpFn.ts index 66d1c77..74d02cf 100644 --- a/test/utils/helpFn.ts +++ b/test/utils/helpFn.ts @@ -21,7 +21,8 @@ export const MIN_RUNNING_TEST_BALANCE = 20000000000; export const TRANSFER_AMOUNT = 1000000000; export const RECEIVER_ADDRESS = "66fhJwYLiK87UDXYDQP9TfYdHpeEyMvQ3MK8Z6GgWAdyyCL3"; -const RECURRING_FREQUENCY = 3600; +export const TIME_SLOT_IN_SECONDS = 600; +const RECURRING_FREQUENCY = TIME_SLOT_IN_SECONDS; // This is a Moonbeam test account private key. Please do not use it for any other purpose. // https://github.com/moonbeam-foundation/moonbeam/blob/2ea0db7c18d907ddeda1a5f4d3f68262e10560e7/README.md?plain=1#L65 const ALITH_PRIVATE_KEY = @@ -371,13 +372,12 @@ export const scheduleDynamicDispatchTaskAndVerify = async ( const taskID = Buffer.from(taskScheduledEvent.event.data.taskId).toString(); const tasks = await automationTimeApi.getAutomationTimeScheduledTasks(firstExecutionTime); - // eslint-disable-next-line @typescript-eslint/no-unused-vars expect( _.find( tasks, (task) => !_.isUndefined( - _.find(task, ([scheduledTaskId]) => scheduledTaskId === taskID), + _.find(task, ([, scheduledTaskId]) => scheduledTaskId === taskID), ), ), ).toBeUndefined(); @@ -420,6 +420,28 @@ export const getDynamicDispatchExtrinsicParams = async ( }; }; +/** + * Get a past time and ensure it's a multiple of the timeslot. + * @returns past time + */ +export const getPastTime = () => { + // Get the current timestamp + const currentTimeStampInSeconds = Math.floor(Date.now() / 1000); + // Adjust the current timestamp to be a multiple of the timeslot + const adjustedTime = + currentTimeStampInSeconds - + (currentTimeStampInSeconds % TIME_SLOT_IN_SECONDS); + // Adjust the time to a past moment + return adjustedTime - TIME_SLOT_IN_SECONDS; +}; + +/** + * Find event in events + * @param events + * @param section + * @param method + * @returns + */ export const findEvent = ( events: any[], section: string, diff --git a/test/yarn.lock b/test/yarn.lock new file mode 100644 index 0000000..153f2d3 --- /dev/null +++ b/test/yarn.lock @@ -0,0 +1,518 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@noble/curves@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/hashes@1.3.2", "@noble/hashes@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + +"@oak-network/api-augment@file:../packages/api-augment/build": + version "2.0.7" + dependencies: + "@polkadot/types" "^10.9.1" + +"@oak-network/types@file:../packages/types/build": + version "2.0.7" + dependencies: + "@open-web3/orml-type-definitions" "^2.0.1" + +"@open-web3/orml-type-definitions@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@open-web3/orml-type-definitions/-/orml-type-definitions-2.0.1.tgz#b3db4fb5777dc05c55fa5184c34f4ec91030f012" + integrity sha512-wqeSBOKk8UU9CBqYhK2yQh9YqwaS7vai71WuOGFNJnzRT+6WnzY0leaLTionuzfE3M4Y/jTrc8BTL6+PVFCr6Q== + dependencies: + lodash.merge "^4.6.2" + +"@polkadot/api-augment@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-10.11.1.tgz#63a5ccc3b33c18fa71263d5e58e0a4c6041a8504" + integrity sha512-9Sk7fi6wzvxAoxvGJPcMt0hU4WzuIAlBy4Rng6WPiS6Ed0HJLr1dkZaqFFmV5my2pb3tu//1JGYkt+MUVB0Kqw== + dependencies: + "@polkadot/api-base" "10.11.1" + "@polkadot/rpc-augment" "10.11.1" + "@polkadot/types" "10.11.1" + "@polkadot/types-augment" "10.11.1" + "@polkadot/types-codec" "10.11.1" + "@polkadot/util" "^12.6.1" + tslib "^2.6.2" + +"@polkadot/api-base@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-10.11.1.tgz#843fec74989b466278c42516a86fba65778b69bf" + integrity sha512-A645Hj9bGtq0EOEWcwTaGoD40vp8/ih1suwinl5il8Psg+bdDmzodnVH5Jhuwe1dNKOuXuvxZvOmbYUPWyIqyg== + dependencies: + "@polkadot/rpc-core" "10.11.1" + "@polkadot/types" "10.11.1" + "@polkadot/util" "^12.6.1" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api-derive@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-10.11.1.tgz#528f90e33577258997cb998c0b597ba54bc9c683" + integrity sha512-i48okJr0l1IrFTPa9KVkoJnDL2EHKExR6XC0Z7I9+kW9noxYWqo0tIoi5s1bNVD475xWK/rUjT7qHxiDbPaCUQ== + dependencies: + "@polkadot/api" "10.11.1" + "@polkadot/api-augment" "10.11.1" + "@polkadot/api-base" "10.11.1" + "@polkadot/rpc-core" "10.11.1" + "@polkadot/types" "10.11.1" + "@polkadot/types-codec" "10.11.1" + "@polkadot/util" "^12.6.1" + "@polkadot/util-crypto" "^12.6.1" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api@10.11.1", "@polkadot/api@^10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-10.11.1.tgz#3667ae1cf2f9c1955e138438c313efdba081314d" + integrity sha512-WEgUYvY90AHX9drmsvWQ4DDuqlE7h4x3f28K5eOoJF4dQ5AkWsFogxwJ4TH57POWLfyi8AIn6/f1vsqPtReDhA== + dependencies: + "@polkadot/api-augment" "10.11.1" + "@polkadot/api-base" "10.11.1" + "@polkadot/api-derive" "10.11.1" + "@polkadot/keyring" "^12.6.1" + "@polkadot/rpc-augment" "10.11.1" + "@polkadot/rpc-core" "10.11.1" + "@polkadot/rpc-provider" "10.11.1" + "@polkadot/types" "10.11.1" + "@polkadot/types-augment" "10.11.1" + "@polkadot/types-codec" "10.11.1" + "@polkadot/types-create" "10.11.1" + "@polkadot/types-known" "10.11.1" + "@polkadot/util" "^12.6.1" + "@polkadot/util-crypto" "^12.6.1" + eventemitter3 "^5.0.1" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/keyring@^12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-12.6.1.tgz#0984dd625edd582750d8975f1898a4acb14bda8b" + integrity sha512-cicTctZr5Jy5vgNT2FsNiKoTZnz6zQkgDoIYv79NI+p1Fhwc9C+DN/iMCnk3Cm9vR2gSAd2fSV+Y5iKVDhAmUw== + dependencies: + "@polkadot/util" "12.6.1" + "@polkadot/util-crypto" "12.6.1" + tslib "^2.6.2" + +"@polkadot/networks@12.6.1", "@polkadot/networks@^12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-12.6.1.tgz#eb0b1fb9e04fbaba066d44df4ff18b0567ca5fcc" + integrity sha512-pzyirxTYAnsx+6kyLYcUk26e4TLz3cX6p2KhTgAVW77YnpGX5VTKTbYykyXC8fXFd/migeQsLaa2raFN47mwoA== + dependencies: + "@polkadot/util" "12.6.1" + "@substrate/ss58-registry" "^1.44.0" + tslib "^2.6.2" + +"@polkadot/rpc-augment@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-10.11.1.tgz#f100165e60777a58583ea97cb672692a31a185f2" + integrity sha512-wrtxHnEwqS3b1GuZ3sA1pzLuUjjLnW4FPawOklONRcIuKbGmFuvu7QvEIHmxBV1FAS/fs8gbvp8ImKWUPnT93Q== + dependencies: + "@polkadot/rpc-core" "10.11.1" + "@polkadot/types" "10.11.1" + "@polkadot/types-codec" "10.11.1" + "@polkadot/util" "^12.6.1" + tslib "^2.6.2" + +"@polkadot/rpc-core@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-10.11.1.tgz#557958e57514d93fd3270a99910bf0d9f066df82" + integrity sha512-3l4l+zL7MDWzQx3WnaieXXUKsbeA1Miu4wsje5trYJEE+hm+nMW8h7fiFKfYzXBi7ty/wMS+S7BfQPTrDkYHxA== + dependencies: + "@polkadot/rpc-augment" "10.11.1" + "@polkadot/rpc-provider" "10.11.1" + "@polkadot/types" "10.11.1" + "@polkadot/util" "^12.6.1" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/rpc-provider@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-10.11.1.tgz#8d94e96bba71ee8bbce9baf407b411c523fc2f28" + integrity sha512-86aDUOnaG42si0jSOAgn6Fs3F3rz57x+iNBK1JpM0PLL2XvmPuoMZL5dZwzqSIey3nVdGJqRYfnFquWuyQpnOQ== + dependencies: + "@polkadot/keyring" "^12.6.1" + "@polkadot/types" "10.11.1" + "@polkadot/types-support" "10.11.1" + "@polkadot/util" "^12.6.1" + "@polkadot/util-crypto" "^12.6.1" + "@polkadot/x-fetch" "^12.6.1" + "@polkadot/x-global" "^12.6.1" + "@polkadot/x-ws" "^12.6.1" + eventemitter3 "^5.0.1" + mock-socket "^9.3.1" + nock "^13.3.8" + tslib "^2.6.2" + optionalDependencies: + "@substrate/connect" "0.7.35" + +"@polkadot/types-augment@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-10.11.1.tgz#273762db2e0dd932378860555e0d24672c583c7f" + integrity sha512-Exd5mMCuSOXXz73iWqy8ocScWTrwAPqHz0Kxpz5OWlAu+5usipMuhjoeaZA803FHQntZh9lHUN31fuc50Exhew== + dependencies: + "@polkadot/types" "10.11.1" + "@polkadot/types-codec" "10.11.1" + "@polkadot/util" "^12.6.1" + tslib "^2.6.2" + +"@polkadot/types-codec@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-10.11.1.tgz#063afd17c1648279de2f9add42b23792026a402f" + integrity sha512-B9Fu2hq3cRpJpGPcgfZ8Qi1OSX9u82J46adlbIG95ktoA+70eZ83VS3Zvtt9ACsdLVGETCJfDjSO25XptjhZKQ== + dependencies: + "@polkadot/util" "^12.6.1" + "@polkadot/x-bigint" "^12.6.1" + tslib "^2.6.2" + +"@polkadot/types-create@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-10.11.1.tgz#3f850e9f5e5b4f04da3ea4def5240d9d4e2789d3" + integrity sha512-oeaI185F3XeWSz9/fe//qZ0KsQyE6C6c13WuOa+5cX/Yuz7cSAXawrhl58HRaU+fueaE/ijEHLcuK1sdM6e1JQ== + dependencies: + "@polkadot/types-codec" "10.11.1" + "@polkadot/util" "^12.6.1" + tslib "^2.6.2" + +"@polkadot/types-known@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-10.11.1.tgz#6159b13c81660fd2db1c797e28356aee4691b0c0" + integrity sha512-BPHI7EbdRaznZR4RVVrQC5epyxL6caJ5dkluZP6rRwx7VmQK0FTGIwgh3UP724mzQhM8rT77MD3h2ftnq1cteg== + dependencies: + "@polkadot/networks" "^12.6.1" + "@polkadot/types" "10.11.1" + "@polkadot/types-codec" "10.11.1" + "@polkadot/types-create" "10.11.1" + "@polkadot/util" "^12.6.1" + tslib "^2.6.2" + +"@polkadot/types-support@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-10.11.1.tgz#227c702526f9702a5b6882ecf55bc264f9d3beaf" + integrity sha512-eCvWjdpELsHvXiTq201DdbIeOIaEr53zTD7HqC2wR/Z1bkQuw79Z+CyIU4sp79GL1vZ1PxS7vUH9M3FKNaTl1Q== + dependencies: + "@polkadot/util" "^12.6.1" + tslib "^2.6.2" + +"@polkadot/types@10.11.1", "@polkadot/types@^10.11.1", "@polkadot/types@^10.9.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-10.11.1.tgz#d2b8c747c103b0a5f725090980d4be10037ddef0" + integrity sha512-4uKnzW2GZqNA5qRZpTPJ7z+G/ARTvXI89etv9xXXVttUdfTaYZsMf4rMuMThOAE/mAUn70LoH0JKthZLwzVgNQ== + dependencies: + "@polkadot/keyring" "^12.6.1" + "@polkadot/types-augment" "10.11.1" + "@polkadot/types-codec" "10.11.1" + "@polkadot/types-create" "10.11.1" + "@polkadot/util" "^12.6.1" + "@polkadot/util-crypto" "^12.6.1" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/util-crypto@12.6.1", "@polkadot/util-crypto@^12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-12.6.1.tgz#f1e354569fb039822db5e57297296e22af575af8" + integrity sha512-2ezWFLmdgeDXqB9NAUdgpp3s2rQztNrZLY+y0SJYNOG4ch+PyodTW/qSksnOrVGVdRhZ5OESRE9xvo9LYV5UAw== + dependencies: + "@noble/curves" "^1.2.0" + "@noble/hashes" "^1.3.2" + "@polkadot/networks" "12.6.1" + "@polkadot/util" "12.6.1" + "@polkadot/wasm-crypto" "^7.3.1" + "@polkadot/wasm-util" "^7.3.1" + "@polkadot/x-bigint" "12.6.1" + "@polkadot/x-randomvalues" "12.6.1" + "@scure/base" "^1.1.3" + tslib "^2.6.2" + +"@polkadot/util@12.6.1", "@polkadot/util@^12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-12.6.1.tgz#477b8e2c601e8aae0662670ed33da46f1b335e5a" + integrity sha512-10ra3VfXtK8ZSnWI7zjhvRrhupg3rd4iFC3zCaXmRpOU+AmfIoCFVEmuUuC66gyXiz2/g6k5E6j0lWQCOProSQ== + dependencies: + "@polkadot/x-bigint" "12.6.1" + "@polkadot/x-global" "12.6.1" + "@polkadot/x-textdecoder" "12.6.1" + "@polkadot/x-textencoder" "12.6.1" + "@types/bn.js" "^5.1.5" + bn.js "^5.2.1" + tslib "^2.6.2" + +"@polkadot/wasm-bridge@7.3.1": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-7.3.1.tgz#8438363aa98296f8be949321ca1d3a4cbcc4fc49" + integrity sha512-wPtDkGaOQx5BUIYP+kJv5aV3BnCQ+HXr36khGKYrRQAMBrG+ybCNPOTVXDQnSbraPQRSw7fSIJmiQpEmFsIz0w== + dependencies: + "@polkadot/wasm-util" "7.3.1" + tslib "^2.6.2" + +"@polkadot/wasm-crypto-asmjs@7.3.1": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.3.1.tgz#8322a554635bcc689eb3a944c87ea64061b6ba81" + integrity sha512-pTUOCIP0nUc4tjzdG1vtEBztKEWde4DBEZm7NaxBLvwNUxsbYhLKYvuhASEyEIz0ZyE4rOBWEmRF4Buic8oO+g== + dependencies: + tslib "^2.6.2" + +"@polkadot/wasm-crypto-init@7.3.1": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.3.1.tgz#5a140f9e2746ce3009dbcc4d05827e0703fd344d" + integrity sha512-Fx15ItLcxCe7uJCWZVXhFbsrXqHUKAp9KGYQFKBRK7r1C2va4Y7qnirjwkxoMHQcunusLe2KdbrD+YJuzh4wlA== + dependencies: + "@polkadot/wasm-bridge" "7.3.1" + "@polkadot/wasm-crypto-asmjs" "7.3.1" + "@polkadot/wasm-crypto-wasm" "7.3.1" + "@polkadot/wasm-util" "7.3.1" + tslib "^2.6.2" + +"@polkadot/wasm-crypto-wasm@7.3.1": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.3.1.tgz#8f0906ab5dd11fa706db4c3547304b0e1d99f671" + integrity sha512-hBMRwrBLCfVsFHSdnwwIxEPshoZdW/dHehYRxMSpUdmqOxtD1gnjocXGE1KZUYGX675+EFuR+Ch6OoTKFJxwTA== + dependencies: + "@polkadot/wasm-util" "7.3.1" + tslib "^2.6.2" + +"@polkadot/wasm-crypto@^7.3.1": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-7.3.1.tgz#178e43ab68385c90d40f53590d3fdb59ee1aa5f4" + integrity sha512-BSK0YyCN4ohjtwbiHG71fgf+7ufgfLrHxjn7pKsvXhyeiEVuDhbDreNcpUf3eGOJ5tNk75aSbKGF4a3EJGIiNA== + dependencies: + "@polkadot/wasm-bridge" "7.3.1" + "@polkadot/wasm-crypto-asmjs" "7.3.1" + "@polkadot/wasm-crypto-init" "7.3.1" + "@polkadot/wasm-crypto-wasm" "7.3.1" + "@polkadot/wasm-util" "7.3.1" + tslib "^2.6.2" + +"@polkadot/wasm-util@7.3.1", "@polkadot/wasm-util@^7.3.1": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-7.3.1.tgz#047fbce91e9bdd944d46bea8f636d2fdc268fba2" + integrity sha512-0m6ozYwBrJgnGl6QvS37ZiGRu4FFPPEtMYEVssfo1Tz4skHJlByWaHWhRNoNCVFAKiGEBu+rfx5HAQMAhoPkvg== + dependencies: + tslib "^2.6.2" + +"@polkadot/x-bigint@12.6.1", "@polkadot/x-bigint@^12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-12.6.1.tgz#82b6a3639e1bc1195b2858482f0421b403641b80" + integrity sha512-YlABeVIlgYQZJ4ZpW/+akFGGxw5jMGt4g5vaP7EumlORGneJHzzWJYDmI5v2y7j1zvC9ofOle7z4tRmtN/QDew== + dependencies: + "@polkadot/x-global" "12.6.1" + tslib "^2.6.2" + +"@polkadot/x-fetch@^12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-12.6.1.tgz#6cd3023177f842ef51f05324c971671cbe010eca" + integrity sha512-iyBv0ecfCsqGSv26CPJk9vSoKtry/Fn7x549ysA4hlc9KboraMHxOHTpcNZYC/OdgvbFZl40zIXCY0SA1ai8aw== + dependencies: + "@polkadot/x-global" "12.6.1" + node-fetch "^3.3.2" + tslib "^2.6.2" + +"@polkadot/x-global@12.6.1", "@polkadot/x-global@^12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-12.6.1.tgz#1a00ae466e344539bdee57eb7b1dd4e4d5b1dc95" + integrity sha512-w5t19HIdBPuyu7X/AiCyH2DsKqxBF0KpF4Ymolnx8PfcSIgnq9ZOmgs74McPR6FgEmeEkr9uNKujZrsfURi1ug== + dependencies: + tslib "^2.6.2" + +"@polkadot/x-randomvalues@12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-12.6.1.tgz#f0ad7afa5b0bac123b634ac19d6625cd301a9307" + integrity sha512-1uVKlfYYbgIgGV5v1Dgn960cGovenWm5pmg+aTMeUGXVYiJwRD2zOpLyC1i/tP454iA74j74pmWb8Nkn0tJZUQ== + dependencies: + "@polkadot/x-global" "12.6.1" + tslib "^2.6.2" + +"@polkadot/x-textdecoder@12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-12.6.1.tgz#ee6e9a0f1819204aa60e0ef5a576e8b222501123" + integrity sha512-IasodJeV1f2Nr/VtA207+LXCQEqYcG8y9qB/EQcRsrEP58NbwwxM5Z2obV0lSjJOxRTJ4/OlhUwnLHwcbIp6+g== + dependencies: + "@polkadot/x-global" "12.6.1" + tslib "^2.6.2" + +"@polkadot/x-textencoder@12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-12.6.1.tgz#b39d4afb50c8bc2ff6add9f20cfc2338abff90d4" + integrity sha512-sTq/+tXqBhGe01a1rjieSHFh3y935vuRgtahVgVJZnfqh5SmLPgSN5tTPxZWzyx7gHIfotle8laTJbJarv7V1A== + dependencies: + "@polkadot/x-global" "12.6.1" + tslib "^2.6.2" + +"@polkadot/x-ws@^12.6.1": + version "12.6.1" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-12.6.1.tgz#340830d4500bbb301c63a9c5b289da85a5cc898c" + integrity sha512-fs9V+XekjJLpVLLwxnqq3llqSZu2T/b9brvld8anvzS/htDLPbi7+c5W3VGJ9Po8fS67IsU3HCt0Gu6F6mGrMA== + dependencies: + "@polkadot/x-global" "12.6.1" + tslib "^2.6.2" + ws "^8.14.2" + +"@scure/base@^1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + +"@substrate/connect-extension-protocol@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-1.0.1.tgz#fa5738039586c648013caa6a0c95c43265dbe77d" + integrity sha512-161JhCC1csjH3GE5mPLEd7HbWtwNSPJBg3p1Ksz9SFlTzj/bgEwudiRN2y5i0MoLGCIJRYKyKGMxVnd29PzNjg== + +"@substrate/connect@0.7.35": + version "0.7.35" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.7.35.tgz#853d8ff50717a8c9ee8f219d11a86e61a54b88b8" + integrity sha512-Io8vkalbwaye+7yXfG1Nj52tOOoJln2bMlc7Q9Yy3vEWqZEVkgKmcPVzbwV0CWL3QD+KMPDA2Dnw/X7EdwgoLw== + dependencies: + "@substrate/connect-extension-protocol" "^1.0.1" + smoldot "2.0.7" + +"@substrate/ss58-registry@^1.44.0": + version "1.44.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.44.0.tgz#54f214e2a44f450b7bbc9252891c1879a54e0606" + integrity sha512-7lQ/7mMCzVNSEfDS4BCqnRnKCFKpcOaPrxMeGTXHX1YQzM/m2BBHjbK2C3dJvjv7GYxMiaTq/HdWQj1xS6ss+A== + +"@types/bn.js@^5.1.5": + version "5.1.5" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" + integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "20.10.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.0.tgz#16ddf9c0a72b832ec4fcce35b8249cf149214617" + integrity sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ== + dependencies: + undici-types "~5.26.4" + +bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +data-uri-to-buffer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" + integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== + +debug@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== + +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + +json-stringify-safe@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +mock-socket@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/mock-socket/-/mock-socket-9.3.1.tgz#24fb00c2f573c84812aa4a24181bb025de80cc8e" + integrity sha512-qxBgB7Qa2sEQgHFjj0dSigq7fX4k6Saisd5Nelwp2q8mlbAFh5dHV9JTTlF8viYJLSSWgMCZFUom8PJcMNBoJw== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nock@^13.3.8: + version "13.3.8" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.3.8.tgz#7adf3c66f678b02ef0a78d5697ae8bc2ebde0142" + integrity sha512-96yVFal0c/W1lG7mmfRe7eO+hovrhJYd2obzzOZ90f6fjpeU/XNvd9cYHZKZAQJumDfhXgoTpkpJ9pvMj+hqHw== + dependencies: + debug "^4.1.0" + json-stringify-safe "^5.0.1" + propagate "^2.0.0" + +node-domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== + +node-fetch@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" + integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== + dependencies: + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" + +propagate@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" + integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== + +rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + +smoldot@2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/smoldot/-/smoldot-2.0.7.tgz#407efd6bbb82a074612db4d056d631d8d615f442" + integrity sha512-VAOBqEen6vises36/zgrmAT1GWk2qE3X8AGnO7lmQFdskbKx8EovnwS22rtPAG+Y1Rk23/S22kDJUdPANyPkBA== + dependencies: + ws "^8.8.1" + +tslib@^2.1.0, tslib@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + +web-streams-polyfill@^3.0.3: + version "3.2.1" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" + integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== + +ws@^8.14.2, ws@^8.8.1: + version "8.14.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" + integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==