diff --git a/smart-contract/assembly/__tests__/tests.spec.ts b/smart-contract/assembly/__tests__/tests.spec.ts index 31df389..e151964 100644 --- a/smart-contract/assembly/__tests__/tests.spec.ts +++ b/smart-contract/assembly/__tests__/tests.spec.ts @@ -18,14 +18,19 @@ describe('Scheduler app test', () => { // mock allowance mockScCall(u256ToBytes(amount)); - const params = new Args() - .add(tokenAddress) - .add(spender) - .add(recipient) - .add(amount) - .add(interval) - .add(occurrences) - .add(tolerance); + const schedule = new Schedule( + 0, + tokenAddress, + spender, + recipient, + amount, + interval, + occurrences, + occurrences, + tolerance, + ); + + const params = new Args().add(schedule); startScheduleSendFT(params.serialize()); diff --git a/smart-contract/assembly/contracts/main.ts b/smart-contract/assembly/contracts/main.ts index e8dd14e..2490bce 100644 --- a/smart-contract/assembly/contracts/main.ts +++ b/smart-contract/assembly/contracts/main.ts @@ -49,7 +49,7 @@ export function startScheduleSendFT(binaryArgs: StaticArray): void { checkAllowance( schedule.tokenAddress, schedule.spender, - amount * u256.fromU64(occurrences), // TODO: use SafeMathU256 + schedule.amount * u256.fromU64(schedule.occurrences), // TODO: use SafeMathU256 ); scheduleAllSendFT(schedule); pushSchedule(schedule);