Skip to content

Commit

Permalink
The scheduleAs parameter should be pass into schedule task function
Browse files Browse the repository at this point in the history
  • Loading branch information
imstar15 committed Dec 7, 2023
1 parent 6f4d4ed commit a49df01
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ export function Sdk() {
xcmOptions,
scheduleAs,
} = params;
if (_.isEmpty(scheduleAs)) {
throw new Error("The scheduleAs parameter should not be empty");
}

const createTaskFunc = (funcParams: CreateTaskFuncParams): SubmittableExtrinsic<"promise"> => {
const { oakApi, destination, executionFee, encodedCall, encodedCallWeight, overallWeight } = funcParams;
const taskExtrinsic = oakApi.tx.automationPrice.scheduleXcmpTaskThroughProxy(
Expand All @@ -156,7 +160,7 @@ export function Sdk() {
encodedCall,
encodedCallWeight,
overallWeight,
scheduleAs || u8aToHex(keyringPair.addressRaw),
scheduleAs,
);
return taskExtrinsic;
};
Expand Down Expand Up @@ -236,9 +240,12 @@ export function Sdk() {
xcmOptions,
scheduleAs,
} = scheduleXcmpTaskParams;
if (_.isEmpty(scheduleAs)) {
throw new Error("The scheduleAs parameter should not be empty");
}

const createTaskFunc = (funcParams: CreateTaskFuncParams): SubmittableExtrinsic<"promise"> => {
const { oakApi, destination, executionFee, encodedCall, encodedCallWeight, overallWeight } = funcParams;
console.log("scheduleFeeLocation: ", scheduleFeeLocation);
const taskExtrinsic = oakApi.tx.automationTime.scheduleXcmpTaskThroughProxy(
schedule,
destination,
Expand All @@ -247,7 +254,7 @@ export function Sdk() {
encodedCall,
encodedCallWeight,
overallWeight,
scheduleAs || u8aToHex(keyringPair.addressRaw),
scheduleAs,
);
return taskExtrinsic;
};
Expand Down

0 comments on commit a49df01

Please sign in to comment.