difftreelog
draft: scheduler tx fees test
in: master
4 files changed
runtime/common/scheduler.rsdiffbeforeafterboth--- a/runtime/common/scheduler.rs
+++ b/runtime/common/scheduler.rs
@@ -24,11 +24,14 @@
transaction_validity::TransactionValidityError,
DispatchErrorWithPostInfo, DispatchError,
};
-use crate::{Runtime, Call, Origin, Balances, ChargeTransactionPayment};
+use crate::{Runtime, Call, Origin, Balances};
use up_common::types::{AccountId, Balance};
use fp_self_contained::SelfContainedCall;
use pallet_unique_scheduler::DispatchCall;
+use pallet_transaction_payment::ChargeTransactionPayment;
+type SponsorshipChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment<Runtime>;
+
/// The SignedExtension to the basic transaction logic.
pub type SignedExtraScheduler = (
frame_system::CheckSpecVersion<Runtime>,
@@ -36,6 +39,7 @@
frame_system::CheckEra<Runtime>,
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
+ ChargeTransactionPayment::<Runtime>,
);
fn get_signed_extras(from: <Runtime as frame_system::Config>::AccountId) -> SignedExtraScheduler {
@@ -47,8 +51,7 @@
from,
)),
frame_system::CheckWeight::<Runtime>::new(),
- // sponsoring transaction logic
- // pallet_charge_transaction::ChargeTransactionPayment::<Runtime>::new(0),
+ ChargeTransactionPayment::<Runtime>::from(0),
)
}
@@ -100,7 +103,7 @@
count: u32,
) -> Result<(), DispatchError> {
let dispatch_info = call.get_dispatch_info();
- let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)
+ let weight: Balance = SponsorshipChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)
.saturating_mul(count.into());
<Balances as NamedReservableCurrency<AccountId>>::reserve_named(
@@ -116,7 +119,7 @@
call: <T as pallet_unique_scheduler::Config>::Call,
) -> Result<u128, DispatchError> {
let dispatch_info = call.get_dispatch_info();
- let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
+ let weight: Balance = SponsorshipChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
Ok(
<Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
&id,
tests/src/.outdated/eth/scheduling.test.tsdiffbeforeafterboth--- a/tests/src/.outdated/eth/scheduling.test.ts
+++ b/tests/src/.outdated/eth/scheduling.test.ts
@@ -16,7 +16,7 @@
import {expect} from 'chai';
import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from '../../deprecated-helpers/eth/helpers';
-import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../../deprecated-helpers/helpers';
+import {makeScheduledId, scheduleAfter, waitNewBlocks, requirePallets, Pallets} from '../../deprecated-helpers/helpers';
// TODO mrshiposha update this test in #581
describe.skip('Scheduing EVM smart contracts', () => {
@@ -25,6 +25,7 @@
});
itWeb3('Successfully schedules and periodically executes an EVM contract', async ({api, web3, privateKeyWrapper}) => {
+ const scheduledId = await makeScheduledId();
const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, deployer);
const initialValue = await flipper.methods.getValue().call();
@@ -45,8 +46,17 @@
);
const waitForBlocks = 4;
const periodBlocks = 2;
+ const repetitions = 2;
- await scheduleExpectSuccess(tx, alice, waitForBlocks, '0x' + '0'.repeat(32), periodBlocks, 2);
+ await expect(scheduleAfter(
+ api,
+ tx,
+ alice,
+ waitForBlocks,
+ scheduledId,
+ periodBlocks,
+ repetitions,
+ )).to.not.be.rejected;
expect(await flipper.methods.getValue().call()).to.be.equal(initialValue);
await waitNewBlocks(waitForBlocks - 1);
tests/src/.outdated/scheduler.test.tsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import chai, {expect} from 'chai';18import chaiAsPromised from 'chai-as-promised';19import {20 default as usingApi,21 submitTransactionAsync,22 submitTransactionExpectFailAsync,23} from '../substrate/substrate-api';24import {25 createItemExpectSuccess,26 createCollectionExpectSuccess,27 scheduleTransferExpectSuccess,28 scheduleTransferAndWaitExpectSuccess,29 setCollectionSponsorExpectSuccess,30 confirmSponsorshipExpectSuccess,31 findUnusedAddress,32 UNIQUE,33 enablePublicMintingExpectSuccess,34 addToAllowListExpectSuccess,35 waitNewBlocks,36 makeScheduledId,37 normalizeAccountId,38 getTokenOwner,39 getGenericResult,40 scheduleTransferFundsExpectSuccess,41 getFreeBalance,42 confirmSponsorshipByKeyExpectSuccess,43 scheduleExpectFailure,44 scheduleAfter,45 cancelScheduled,46 requirePallets,47 Pallets,48} from '../deprecated-helpers/helpers';49import {IKeyringPair, SignatureOptions} from '@polkadot/types/types';50import {ApiPromise} from '@polkadot/api';51import {objectSpread} from '@polkadot/util';5253chai.use(chaiAsPromised);5455// Check that there are no failing Dispatched events in the block56function checkForFailedSchedulerEvents(api: ApiPromise, events: any[]) {57 return new Promise((res, rej) => {58 let schedulerEventPresent = false;59 60 for (const {event} of events) {61 if (api.events.scheduler.Dispatched.is(event)) {62 schedulerEventPresent = true;63 const result = event.data.result;64 if (result.isErr) {65 const decoded = api.registry.findMetaError(result.asErr.asModule);66 const {method, section} = decoded;67 rej(new Error(`${section}.${method}`));68 }69 }70 }71 res(schedulerEventPresent);72 });73}7475function makeSignOptions(api: ApiPromise): SignatureOptions {76 return objectSpread(77 {blockHash: api.genesisHash, genesisHash: api.genesisHash},78 {runtimeVersion: api.runtimeVersion, signedExtensions: api.registry.signedExtensions},79 );80}8182describe('Scheduling token and balance transfers', () => {83 let alice: IKeyringPair;84 let bob: IKeyringPair;8586 before(async function() {87 await requirePallets(this, [Pallets.Scheduler]);8889 await usingApi(async (_, privateKeyWrapper) => {90 alice = privateKeyWrapper('//Alice');91 bob = privateKeyWrapper('//Bob');92 });93 });949596 it('Can delay a transfer of an owned token', async () => {97 await usingApi(async api => {98 const collectionId = await createCollectionExpectSuccess();99 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');100 const scheduledId = await makeScheduledId();101102 await scheduleTransferAndWaitExpectSuccess(api, collectionId, tokenId, alice, bob, 1, 4, scheduledId);103 });104 });105106 it('Can transfer funds periodically', async () => {107 await usingApi(async api => {108 const scheduledId = await makeScheduledId();109 const waitForBlocks = 1;110 const period = 2;111 const repetitions = 2;112113 const amount = 1n * UNIQUE;114115 await scheduleTransferFundsExpectSuccess(api, amount, alice, bob, waitForBlocks, scheduledId, period, repetitions);116 const bobsBalanceBefore = await getFreeBalance(bob);117118 await waitNewBlocks(waitForBlocks + 1);119 const bobsBalanceAfterFirst = await getFreeBalance(bob);120 expect(bobsBalanceAfterFirst)121 .to.be.equal(122 bobsBalanceBefore + 1n * amount,123 '#1 Balance of the recipient should be increased by 1 * amount',124 );125126 await waitNewBlocks(period);127 const bobsBalanceAfterSecond = await getFreeBalance(bob);128 expect(bobsBalanceAfterSecond)129 .to.be.equal(130 bobsBalanceBefore + 2n * amount,131 '#2 Balance of the recipient should be increased by 2 * amount',132 );133 });134 });135136 it('Can cancel a scheduled operation which has not yet taken effect', async () => {137 await usingApi(async api => {138 const collectionId = await createCollectionExpectSuccess();139 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');140 const scheduledId = await makeScheduledId();141 const waitForBlocks = 4;142143 const amount = 1;144145 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, bob, amount, waitForBlocks, scheduledId);146 await expect(cancelScheduled(api, alice, scheduledId)).to.not.be.rejected;147148 await waitNewBlocks(waitForBlocks);149150 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(alice.address));151 });152 });153154 it('Can cancel a periodic operation (transfer of funds)', async () => {155 await usingApi(async api => {156 const waitForBlocks = 1;157 const period = 3;158 const repetitions = 2;159160 const scheduledId = await makeScheduledId();161 const amount = 1n * UNIQUE;162163 const bobsBalanceBefore = await getFreeBalance(bob);164 await scheduleTransferFundsExpectSuccess(api, amount, alice, bob, waitForBlocks, scheduledId, period, repetitions);165166 await waitNewBlocks(waitForBlocks + 1);167 const bobsBalanceAfterFirst = await getFreeBalance(bob);168 expect(bobsBalanceAfterFirst)169 .to.be.equal(170 bobsBalanceBefore + 1n * amount,171 '#1 Balance of the recipient should be increased by 1 * amount',172 );173174 await expect(cancelScheduled(api, alice, scheduledId)).to.not.be.rejected;175176 await waitNewBlocks(period);177 const bobsBalanceAfterSecond = await getFreeBalance(bob);178 expect(bobsBalanceAfterSecond)179 .to.be.equal(180 bobsBalanceAfterFirst,181 '#2 Balance of the recipient should not be changed',182 );183 });184 });185186 it('Scheduled tasks are transactional', async function() {187 await requirePallets(this, [Pallets.TestUtils]);188189 await usingApi(async api => {190 const scheduledId = await makeScheduledId();191 const waitForBlocks = 4;192193 const initTestVal = 42;194 const changedTestVal = 111;195196 const initTx = api.tx.testUtils.setTestValue(initTestVal);197 await submitTransactionAsync(alice, initTx);198199 const changeErrTx = api.tx.testUtils.setTestValueAndRollback(changedTestVal);200201 await expect(scheduleAfter(202 api,203 changeErrTx,204 alice,205 waitForBlocks,206 scheduledId,207 )).to.not.be.rejected;208209 await waitNewBlocks(waitForBlocks + 1);210211 const testVal = (await api.query.testUtils.testValue()).toNumber();212 expect(testVal, 'The test value should NOT be commited')213 .not.to.be.equal(changedTestVal)214 .and.to.be.equal(initTx);215 });216 });217218 it.only('Scheduled tasks should take some fees', async function() {219 await requirePallets(this, [Pallets.TestUtils]);220221 await usingApi(async api => {222 const scheduledId = await makeScheduledId();223 const waitForBlocks = 8;224 const period = 2;225 const repetitions = 2;226227 const dummyTx = api.tx.testUtils.justTakeFee();228 const expectedFee = (await dummyTx.paymentInfo(alice)).partialFee.toBigInt();229 const expFee = (await api.rpc.payment.queryFeeDetails(dummyTx.toHex())).inclusionFee.unwrap().toHuman();230231 console.log('>>>>>> expFee = ' + JSON.stringify(expFee));232233 // const collectionCreate = api.tx.unique.createCollectionEx({234 // name: 0,235 // tokenPrefix: 0xfaf,236 // });237238 // const options = makeSignOptions(api);239 // const signed = collectionCreate.sign(alice, options);240 // const expFee2 = (await api.rpc.payment.queryFeeDetails(signed.toHex())).inclusionFee.unwrap().toHuman();241 // console.log('!!!!!!!!!!!! expFee2 = ' + JSON.stringify(expFee2));242243 await expect(scheduleAfter(244 api,245 dummyTx,246 alice,247 waitForBlocks,248 scheduledId,249 period,250 repetitions,251 )).to.not.be.rejected;252253 await waitNewBlocks(1);254255 const aliceInitBalance = await getFreeBalance(alice);256 let diff;257258 await waitNewBlocks(waitForBlocks);259260 const aliceBalanceAfterFirst = await getFreeBalance(alice);261 expect(262 aliceBalanceAfterFirst < aliceInitBalance,263 '[after execution #1] Scheduled task should take a fee',264 ).to.be.true;265266 diff = aliceInitBalance - aliceBalanceAfterFirst;267 expect(diff).to.be.equal(expectedFee, 'Scheduled task should take the right amount of fees');268269 await waitNewBlocks(period);270271 const aliceBalanceAfterSecond = await getFreeBalance(alice);272 expect(273 aliceBalanceAfterSecond < aliceBalanceAfterFirst,274 '[after execution #2] Scheduled task should take a fee',275 ).to.be.true;276277 diff = aliceBalanceAfterFirst - aliceBalanceAfterSecond;278 expect(diff).to.be.equal(expectedFee, 'Scheduled task should take the right amount of fees');279 });280 });281282 // FIXME What purpose of this test?283 it.skip('Can schedule a scheduled operation of canceling the scheduled operation', async () => {284 await usingApi(async api => {285 const scheduledId = await makeScheduledId();286287 const waitForBlocks = 2;288 const period = 3;289 const repetitions = 2;290291 await expect(scheduleAfter(292 api, 293 api.tx.scheduler.cancelNamed(scheduledId), 294 alice, 295 waitForBlocks, 296 scheduledId, 297 period, 298 repetitions,299 )).to.not.be.rejected;300301 await waitNewBlocks(waitForBlocks);302303 // todo:scheduler debug line; doesn't work (and doesn't appear in events) when executed in the same block as the scheduled transaction304 await expect(submitTransactionAsync(alice, api.tx.scheduler.cancelNamed(scheduledId))).to.not.be.rejected;305306 let schedulerEvents = 0;307 for (let i = 0; i < period * repetitions; i++) {308 const events = await api.query.system.events();309 schedulerEvents += await expect(checkForFailedSchedulerEvents(api, events)).to.not.be.rejected;310 await waitNewBlocks(1);311 }312 expect(schedulerEvents).to.be.equal(repetitions);313 });314 });315316 after(async () => {317 // todo:scheduler to avoid the failed results of the previous test interfering with the next, delete after the problem is fixed318 await waitNewBlocks(6);319 });320});321322describe('Negative Test: Scheduling', () => {323 let alice: IKeyringPair;324 let bob: IKeyringPair;325326 before(async function() {327 await requirePallets(this, [Pallets.Scheduler]);328329 await usingApi(async (_, privateKeyWrapper) => {330 alice = privateKeyWrapper('//Alice');331 bob = privateKeyWrapper('//Bob');332 });333 });334335 it("Can't overwrite a scheduled ID", async () => {336 await usingApi(async api => {337 const collectionId = await createCollectionExpectSuccess();338 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');339 const scheduledId = await makeScheduledId();340 const waitForBlocks = 4;341 const amount = 1;342343 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, bob, amount, waitForBlocks, scheduledId);344 await expect(scheduleAfter(345 api, 346 api.tx.balances.transfer(alice.address, 1n * UNIQUE), 347 bob, 348 /* period = */ 2, 349 scheduledId,350 )).to.be.rejectedWith(/scheduler\.FailedToSchedule/);351352 const bobsBalanceBefore = await getFreeBalance(bob);353354 await waitNewBlocks(waitForBlocks + 1);355356 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(bob.address));357 expect(bobsBalanceBefore).to.be.equal(await getFreeBalance(bob));358 });359 });360361 it("Can't cancel an operation which is not scheduled", async () => {362 await usingApi(async api => {363 const scheduledId = await makeScheduledId();364 await expect(cancelScheduled(api, alice, scheduledId)).to.be.rejectedWith(/scheduler\.NotFound/);365 });366 });367368 it("Can't cancel a non-owned scheduled operation", async () => {369 await usingApi(async api => {370 const collectionId = await createCollectionExpectSuccess();371 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');372 const scheduledId = await makeScheduledId();373 const waitForBlocks = 8;374375 const amount = 1;376377 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, bob, amount, waitForBlocks, scheduledId);378 await expect(cancelScheduled(api, bob, scheduledId)).to.be.rejectedWith(/BadOrigin/);379380 await waitNewBlocks(waitForBlocks + 1);381382 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(bob.address));383 });384 });385});386387// Implementation of the functionality tested here was postponed/shelved388describe.skip('Sponsoring scheduling', () => {389 let alice: IKeyringPair;390 let bob: IKeyringPair;391392 before(async() => {393 await usingApi(async (_, privateKeyWrapper) => {394 alice = privateKeyWrapper('//Alice');395 bob = privateKeyWrapper('//Bob');396 });397 });398399 it('Can sponsor scheduling a transaction', async () => {400 const collectionId = await createCollectionExpectSuccess();401 await setCollectionSponsorExpectSuccess(collectionId, bob.address);402 await confirmSponsorshipExpectSuccess(collectionId, '//Bob');403404 await usingApi(async api => {405 const scheduledId = await makeScheduledId();406 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address);407408 const bobBalanceBefore = await getFreeBalance(bob);409 const waitForBlocks = 4;410 // no need to wait to check, fees must be deducted on scheduling, immediately411 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, bob, 0, waitForBlocks, scheduledId);412 const bobBalanceAfter = await getFreeBalance(bob);413 // expect(aliceBalanceAfter == aliceBalanceBefore).to.be.true;414 expect(bobBalanceAfter < bobBalanceBefore).to.be.true;415 // wait for sequentiality matters416 await waitNewBlocks(waitForBlocks - 1);417 });418 });419420 it('Schedules and dispatches a transaction even if the caller has no funds at the time of the dispatch', async () => {421 await usingApi(async (api, privateKeyWrapper) => {422 // Find an empty, unused account423 const zeroBalance = await findUnusedAddress(api, privateKeyWrapper);424425 const collectionId = await createCollectionExpectSuccess();426427 // Add zeroBalance address to allow list428 await enablePublicMintingExpectSuccess(alice, collectionId);429 await addToAllowListExpectSuccess(alice, collectionId, zeroBalance.address);430431 // Grace zeroBalance with money, enough to cover future transactions432 const balanceTx = api.tx.balances.transfer(zeroBalance.address, 1n * UNIQUE);433 await submitTransactionAsync(alice, balanceTx);434435 // Mint a fresh NFT436 const tokenId = await createItemExpectSuccess(zeroBalance, collectionId, 'NFT');437 const scheduledId = await makeScheduledId();438439 // Schedule transfer of the NFT a few blocks ahead440 const waitForBlocks = 5;441 await scheduleTransferExpectSuccess(api, collectionId, tokenId, zeroBalance, alice, 1, waitForBlocks, scheduledId);442443 // Get rid of the account's funds before the scheduled transaction takes place444 const balanceTx2 = api.tx.balances.transfer(alice.address, UNIQUE * 68n / 100n);445 const events = await submitTransactionAsync(zeroBalance, balanceTx2);446 expect(getGenericResult(events).success).to.be.true;447 /*const emptyBalanceTx = api.tx.balances.setBalance(zeroBalance.address, 0, 0); // do not null reserved?448 const sudoTx = api.tx.sudo.sudo(emptyBalanceTx as any);449 const events = await submitTransactionAsync(alice, sudoTx);450 expect(getGenericResult(events).success).to.be.true;*/451452 // Wait for a certain number of blocks, discarding the ones that already happened while accepting the late transactions453 await waitNewBlocks(waitForBlocks - 3);454455 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(alice.address));456 });457 });458459 it('Sponsor going bankrupt does not impact a scheduled transaction', async () => {460 const collectionId = await createCollectionExpectSuccess();461462 await usingApi(async (api, privateKeyWrapper) => {463 const zeroBalance = await findUnusedAddress(api, privateKeyWrapper);464 const balanceTx = api.tx.balances.transfer(zeroBalance.address, 1n * UNIQUE);465 await submitTransactionAsync(alice, balanceTx);466467 await setCollectionSponsorExpectSuccess(collectionId, zeroBalance.address);468 await confirmSponsorshipByKeyExpectSuccess(collectionId, zeroBalance);469470 const scheduledId = await makeScheduledId();471 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address);472473 const waitForBlocks = 5;474 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, zeroBalance, 1, waitForBlocks, scheduledId);475476 const emptyBalanceSponsorTx = api.tx.balances.setBalance(zeroBalance.address, 0, 0);477 const sudoTx = api.tx.sudo.sudo(emptyBalanceSponsorTx as any);478 const events = await submitTransactionAsync(alice, sudoTx);479 expect(getGenericResult(events).success).to.be.true;480481 // Wait for a certain number of blocks, save for the ones that already happened while accepting the late transactions482 await waitNewBlocks(waitForBlocks - 3);483484 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(zeroBalance.address));485 });486 });487488 it('Exceeding sponsor rate limit without having enough funds prevents scheduling a periodic transaction', async () => {489 const collectionId = await createCollectionExpectSuccess();490 await setCollectionSponsorExpectSuccess(collectionId, bob.address);491 await confirmSponsorshipExpectSuccess(collectionId, '//Bob');492493 await usingApi(async (api, privateKeyWrapper) => {494 const zeroBalance = await findUnusedAddress(api, privateKeyWrapper);495496 await enablePublicMintingExpectSuccess(alice, collectionId);497 await addToAllowListExpectSuccess(alice, collectionId, zeroBalance.address);498499 const bobBalanceBefore = await getFreeBalance(bob);500501 const createData = {nft: {const_data: [], variable_data: []}};502 const creationTx = api.tx.unique.createItem(collectionId, normalizeAccountId(zeroBalance), createData as any);503 const scheduledId = await makeScheduledId();504505 /*const badTransaction = async function () {506 await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);507 };508 await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');*/509510 await expect(scheduleAfter(api, creationTx, zeroBalance, 3, scheduledId, 1, 3)).to.be.rejectedWith(/Inability to pay some fees/);511512 expect(await getFreeBalance(bob)).to.be.equal(bobBalanceBefore);513 });514 });515});tests/src/deprecated-helpers/helpers.tsdiffbeforeafterboth--- a/tests/src/deprecated-helpers/helpers.ts
+++ b/tests/src/deprecated-helpers/helpers.ts
@@ -1260,15 +1260,9 @@
) {
const transferTx = api.tx.balances.transfer(recipient.address, amount);
-<<<<<<< HEAD
- const balanceBefore = await getFreeBalance(recipient);
-
- await scheduleExpectSuccess(transferTx, sender, blockSchedule, scheduledId, period, repetitions);
-=======
const balanceBefore = await getFreeBalance(recipient);
await expect(scheduleAfter(api, transferTx, sender, blocksBeforeExecution, scheduledId, period, repetitions)).to.not.be.rejected;
->>>>>>> test(scheduler): enable and add more coverage, leave sponsorship disabled
expect(await getFreeBalance(recipient)).to.be.equal(balanceBefore);
}