git.delta.rocks / unique-network / refs/commits / 0cb5e99ca2ae

difftreelog

draft: scheduler tx fees test

Daniel Shiposha2022-09-07parent: #d979915.patch.diff
in: master

4 files changed

modifiedruntime/common/scheduler.rsdiffbeforeafterboth
24 transaction_validity::TransactionValidityError,24 transaction_validity::TransactionValidityError,
25 DispatchErrorWithPostInfo, DispatchError,25 DispatchErrorWithPostInfo, DispatchError,
26};26};
27use crate::{Runtime, Call, Origin, Balances, ChargeTransactionPayment};27use crate::{Runtime, Call, Origin, Balances};
28use up_common::types::{AccountId, Balance};28use up_common::types::{AccountId, Balance};
29use fp_self_contained::SelfContainedCall;29use fp_self_contained::SelfContainedCall;
30use pallet_unique_scheduler::DispatchCall;30use pallet_unique_scheduler::DispatchCall;
31use pallet_transaction_payment::ChargeTransactionPayment;
32
33type SponsorshipChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment<Runtime>;
3134
32/// The SignedExtension to the basic transaction logic.35/// The SignedExtension to the basic transaction logic.
33pub type SignedExtraScheduler = (36pub type SignedExtraScheduler = (
36 frame_system::CheckEra<Runtime>,39 frame_system::CheckEra<Runtime>,
37 frame_system::CheckNonce<Runtime>,40 frame_system::CheckNonce<Runtime>,
38 frame_system::CheckWeight<Runtime>,41 frame_system::CheckWeight<Runtime>,
42 ChargeTransactionPayment::<Runtime>,
39);43);
4044
41fn get_signed_extras(from: <Runtime as frame_system::Config>::AccountId) -> SignedExtraScheduler {45fn get_signed_extras(from: <Runtime as frame_system::Config>::AccountId) -> SignedExtraScheduler {
47 from,51 from,
48 )),52 )),
49 frame_system::CheckWeight::<Runtime>::new(),53 frame_system::CheckWeight::<Runtime>::new(),
50 // sponsoring transaction logic54 ChargeTransactionPayment::<Runtime>::from(0),
51 // pallet_charge_transaction::ChargeTransactionPayment::<Runtime>::new(0),
52 )55 )
53}56}
5457
100 count: u32,103 count: u32,
101 ) -> Result<(), DispatchError> {104 ) -> Result<(), DispatchError> {
102 let dispatch_info = call.get_dispatch_info();105 let dispatch_info = call.get_dispatch_info();
103 let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)106 let weight: Balance = SponsorshipChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)
104 .saturating_mul(count.into());107 .saturating_mul(count.into());
105108
106 <Balances as NamedReservableCurrency<AccountId>>::reserve_named(109 <Balances as NamedReservableCurrency<AccountId>>::reserve_named(
116 call: <T as pallet_unique_scheduler::Config>::Call,119 call: <T as pallet_unique_scheduler::Config>::Call,
117 ) -> Result<u128, DispatchError> {120 ) -> Result<u128, DispatchError> {
118 let dispatch_info = call.get_dispatch_info();121 let dispatch_info = call.get_dispatch_info();
119 let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);122 let weight: Balance = SponsorshipChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
120 Ok(123 Ok(
121 <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(124 <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
122 &id,125 &id,
modifiedtests/src/.outdated/eth/scheduling.test.tsdiffbeforeafterboth
1616
17import {expect} from 'chai';17import {expect} from 'chai';
18import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from '../../deprecated-helpers/eth/helpers';18import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from '../../deprecated-helpers/eth/helpers';
19import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../../deprecated-helpers/helpers';19import {makeScheduledId, scheduleAfter, waitNewBlocks, requirePallets, Pallets} from '../../deprecated-helpers/helpers';
2020
21// TODO mrshiposha update this test in #58121// TODO mrshiposha update this test in #581
22describe.skip('Scheduing EVM smart contracts', () => {22describe.skip('Scheduing EVM smart contracts', () => {
25 });25 });
2626
27 itWeb3('Successfully schedules and periodically executes an EVM contract', async ({api, web3, privateKeyWrapper}) => {27 itWeb3('Successfully schedules and periodically executes an EVM contract', async ({api, web3, privateKeyWrapper}) => {
28 const scheduledId = await makeScheduledId();
28 const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);29 const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
29 const flipper = await deployFlipper(web3, deployer);30 const flipper = await deployFlipper(web3, deployer);
30 const initialValue = await flipper.methods.getValue().call();31 const initialValue = await flipper.methods.getValue().call();
45 );46 );
46 const waitForBlocks = 4;47 const waitForBlocks = 4;
47 const periodBlocks = 2;48 const periodBlocks = 2;
49 const repetitions = 2;
4850
49 await scheduleExpectSuccess(tx, alice, waitForBlocks, '0x' + '0'.repeat(32), periodBlocks, 2);51 await expect(scheduleAfter(
52 api,
53 tx,
54 alice,
55 waitForBlocks,
56 scheduledId,
57 periodBlocks,
58 repetitions,
59 )).to.not.be.rejected;
50 expect(await flipper.methods.getValue().call()).to.be.equal(initialValue);60 expect(await flipper.methods.getValue().call()).to.be.equal(initialValue);
51 61
52 await waitNewBlocks(waitForBlocks - 1);62 await waitNewBlocks(waitForBlocks - 1);
modifiedtests/src/.outdated/scheduler.test.tsdiffbeforeafterboth
33 enablePublicMintingExpectSuccess,33 enablePublicMintingExpectSuccess,
34 addToAllowListExpectSuccess,34 addToAllowListExpectSuccess,
35 waitNewBlocks,35 waitNewBlocks,
36 makeScheduledId,
36 normalizeAccountId,37 normalizeAccountId,
37 getTokenOwner,38 getTokenOwner,
38 getGenericResult,39 getGenericResult,
45 requirePallets,46 requirePallets,
46 Pallets,47 Pallets,
47} from '../deprecated-helpers/helpers';48} from '../deprecated-helpers/helpers';
48import {IKeyringPair} from '@polkadot/types/types';49import {IKeyringPair, SignatureOptions} from '@polkadot/types/types';
49import {ApiPromise} from '@polkadot/api';50import {ApiPromise} from '@polkadot/api';
51import {objectSpread} from '@polkadot/util';
5052
51chai.use(chaiAsPromised);53chai.use(chaiAsPromised);
52
53const scheduledIdBase: string = '0x' + '0'.repeat(31);
54let scheduledIdSlider = 0;
55
56// Loop scheduledId around 10. Unless there are concurrent tasks with long periods/repetitions, tests' tasks' ids shouldn't ovelap.
57function makeScheduledId(): string {
58 return scheduledIdBase + ((scheduledIdSlider++) % 10);
59}
6054
61// Check that there are no failing Dispatched events in the block55// Check that there are no failing Dispatched events in the block
62function checkForFailedSchedulerEvents(api: ApiPromise, events: any[]) {56function checkForFailedSchedulerEvents(api: ApiPromise, events: any[]) {
78 });72 });
79}73}
74
75function makeSignOptions(api: ApiPromise): SignatureOptions {
76 return objectSpread(
77 {blockHash: api.genesisHash, genesisHash: api.genesisHash},
78 {runtimeVersion: api.runtimeVersion, signedExtensions: api.registry.signedExtensions},
79 );
80}
8081
81describe('Scheduling token and balance transfers', () => {82describe('Scheduling token and balance transfers', () => {
82 let alice: IKeyringPair;83 let alice: IKeyringPair;
96 await usingApi(async api => {97 await usingApi(async api => {
97 const collectionId = await createCollectionExpectSuccess();98 const collectionId = await createCollectionExpectSuccess();
98 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');99 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');
100 const scheduledId = await makeScheduledId();
99101
100 await scheduleTransferAndWaitExpectSuccess(api, collectionId, tokenId, alice, bob, 1, 4, makeScheduledId());102 await scheduleTransferAndWaitExpectSuccess(api, collectionId, tokenId, alice, bob, 1, 4, scheduledId);
101 });103 });
102 });104 });
103105
104 it('Can transfer funds periodically', async () => {106 it('Can transfer funds periodically', async () => {
105 await usingApi(async api => {107 await usingApi(async api => {
108 const scheduledId = await makeScheduledId();
106 const waitForBlocks = 1;109 const waitForBlocks = 1;
107 const period = 2;110 const period = 2;
108 const repetitions = 2;111 const repetitions = 2;
109112
110 const amount = 1n * UNIQUE;113 const amount = 1n * UNIQUE;
111114
112 await scheduleTransferFundsExpectSuccess(api, amount, alice, bob, waitForBlocks, makeScheduledId(), period, repetitions);115 await scheduleTransferFundsExpectSuccess(api, amount, alice, bob, waitForBlocks, scheduledId, period, repetitions);
113 const bobsBalanceBefore = await getFreeBalance(bob);116 const bobsBalanceBefore = await getFreeBalance(bob);
114117
115 await waitNewBlocks(waitForBlocks + 1);118 await waitNewBlocks(waitForBlocks + 1);
134 await usingApi(async api => {137 await usingApi(async api => {
135 const collectionId = await createCollectionExpectSuccess();138 const collectionId = await createCollectionExpectSuccess();
136 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');139 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');
137 const scheduledId = makeScheduledId();140 const scheduledId = await makeScheduledId();
138 const waitForBlocks = 4;141 const waitForBlocks = 4;
139142
140 const amount = 1;143 const amount = 1;
154 const period = 3;157 const period = 3;
155 const repetitions = 2;158 const repetitions = 2;
156159
157 const scheduledId = makeScheduledId();160 const scheduledId = await makeScheduledId();
158 const amount = 1n * UNIQUE;161 const amount = 1n * UNIQUE;
159162
160 const bobsBalanceBefore = await getFreeBalance(bob);163 const bobsBalanceBefore = await getFreeBalance(bob);
184 await requirePallets(this, [Pallets.TestUtils]);187 await requirePallets(this, [Pallets.TestUtils]);
185188
186 await usingApi(async api => {189 await usingApi(async api => {
187 const scheduledId = makeScheduledId();190 const scheduledId = await makeScheduledId();
188 const waitForBlocks = 4;191 const waitForBlocks = 4;
189 const period = null;
190 const priority = 0;
191192
192 const initTestVal = 42;193 const initTestVal = 42;
193 const changedTestVal = 111;194 const changedTestVal = 111;
197198
198 const changeErrTx = api.tx.testUtils.setTestValueAndRollback(changedTestVal);199 const changeErrTx = api.tx.testUtils.setTestValueAndRollback(changedTestVal);
199200
201 await expect(scheduleAfter(
200 const scheduleTx = api.tx.scheduler.scheduleNamedAfter(202 api,
201 scheduledId,203 changeErrTx,
202 waitForBlocks, 204 alice,
203 period,205 waitForBlocks,
204 priority, 206 scheduledId,
205 {Value: changeErrTx as any},
206 );207 )).to.not.be.rejected;
207
208 await submitTransactionAsync(alice, scheduleTx);
209208
210 await waitNewBlocks(waitForBlocks);209 await waitNewBlocks(waitForBlocks + 1);
211210
212 const testVal = (await api.query.testUtils.testValue()).toNumber();211 const testVal = (await api.query.testUtils.testValue()).toNumber();
213 expect(testVal, 'The test value should NOT be commited')212 expect(testVal, 'The test value should NOT be commited')
216 });215 });
217 });216 });
218217
219 it('Scheduled tasks should take some fees', async function() {218 it.only('Scheduled tasks should take some fees', async function() {
220 await requirePallets(this, [Pallets.TestUtils]);219 await requirePallets(this, [Pallets.TestUtils]);
221220
222 await usingApi(async api => {221 await usingApi(async api => {
223 const scheduledId = makeScheduledId();222 const scheduledId = await makeScheduledId();
224 const waitForBlocks = 10;223 const waitForBlocks = 8;
225 const period = 2;224 const period = 2;
226 const repetitions = 1;225 const repetitions = 2;
227
228 const dummyTxFeeAmount = 100_000_000;
229226
230 const dummyTx = api.tx.testUtils.justTakeFee();227 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();
230
231 console.log('>>>>>> expFee = ' + JSON.stringify(expFee));
232
233 // const collectionCreate = api.tx.unique.createCollectionEx({
234 // name: 0,
235 // tokenPrefix: 0xfaf,
236 // });
237
238 // 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));
231242
232 await expect(scheduleAfter(243 await expect(scheduleAfter(
233 api,244 api,
239 repetitions,250 repetitions,
240 )).to.not.be.rejected;251 )).to.not.be.rejected;
252
253 await waitNewBlocks(1);
241254
242 const aliceInitBalance = await getFreeBalance(alice);255 const aliceInitBalance = await getFreeBalance(alice);
243 let diff;256 let diff;
244257
245 await waitNewBlocks(waitForBlocks + 1);258 await waitNewBlocks(waitForBlocks);
246259
247 const aliceBalanceAfterFirst = await getFreeBalance(alice);260 const aliceBalanceAfterFirst = await getFreeBalance(alice);
248 expect(261 expect(
251 ).to.be.true;264 ).to.be.true;
252265
253 diff = aliceInitBalance - aliceBalanceAfterFirst;266 diff = aliceInitBalance - aliceBalanceAfterFirst;
254 expect(diff).to.be.equal(dummyTxFeeAmount, 'Scheduled task should take the right amount of fees');267 expect(diff).to.be.equal(expectedFee, 'Scheduled task should take the right amount of fees');
255268
256 await waitNewBlocks(period);269 await waitNewBlocks(period);
257270
262 ).to.be.true;275 ).to.be.true;
263276
264 diff = aliceBalanceAfterFirst - aliceBalanceAfterSecond;277 diff = aliceBalanceAfterFirst - aliceBalanceAfterSecond;
265 expect(diff).to.be.equal(dummyTxFeeAmount, 'Scheduled task should take the right amount of fees');278 expect(diff).to.be.equal(expectedFee, 'Scheduled task should take the right amount of fees');
266 });279 });
267 });280 });
268281
269 // FIXME What purpose of this test?282 // FIXME What purpose of this test?
270 it.skip('Can schedule a scheduled operation of canceling the scheduled operation', async () => {283 it.skip('Can schedule a scheduled operation of canceling the scheduled operation', async () => {
271 await usingApi(async api => {284 await usingApi(async api => {
272 const scheduledId = makeScheduledId();285 const scheduledId = await makeScheduledId();
273286
274 const waitForBlocks = 2;287 const waitForBlocks = 2;
275 const period = 3;288 const period = 3;
323 await usingApi(async api => {336 await usingApi(async api => {
324 const collectionId = await createCollectionExpectSuccess();337 const collectionId = await createCollectionExpectSuccess();
325 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');338 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');
326 const scheduledId = makeScheduledId();339 const scheduledId = await makeScheduledId();
327 const waitForBlocks = 4;340 const waitForBlocks = 4;
328 const amount = 1;341 const amount = 1;
329342
338351
339 const bobsBalanceBefore = await getFreeBalance(bob);352 const bobsBalanceBefore = await getFreeBalance(bob);
340353
341 await waitNewBlocks(waitForBlocks);354 await waitNewBlocks(waitForBlocks + 1);
342355
343 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(bob.address));356 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(bob.address));
344 expect(bobsBalanceBefore).to.be.equal(await getFreeBalance(bob));357 expect(bobsBalanceBefore).to.be.equal(await getFreeBalance(bob));
347360
348 it("Can't cancel an operation which is not scheduled", async () => {361 it("Can't cancel an operation which is not scheduled", async () => {
349 await usingApi(async api => {362 await usingApi(async api => {
350 const scheduledId = makeScheduledId();363 const scheduledId = await makeScheduledId();
351 await expect(cancelScheduled(api, alice, scheduledId)).to.be.rejectedWith(/scheduler\.NotFound/);364 await expect(cancelScheduled(api, alice, scheduledId)).to.be.rejectedWith(/scheduler\.NotFound/);
352 });365 });
353 });366 });
356 await usingApi(async api => {369 await usingApi(async api => {
357 const collectionId = await createCollectionExpectSuccess();370 const collectionId = await createCollectionExpectSuccess();
358 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');371 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');
359 const scheduledId = makeScheduledId();372 const scheduledId = await makeScheduledId();
360 const waitForBlocks = 8;373 const waitForBlocks = 8;
361374
362 const amount = 1;375 const amount = 1;
363376
364 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, bob, amount, waitForBlocks, scheduledId);377 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, bob, amount, waitForBlocks, scheduledId);
365 await expect(cancelScheduled(api, bob, scheduledId)).to.be.rejectedWith(/BadOrigin/);378 await expect(cancelScheduled(api, bob, scheduledId)).to.be.rejectedWith(/BadOrigin/);
366379
367 await waitNewBlocks(waitForBlocks);380 await waitNewBlocks(waitForBlocks + 1);
368381
369 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(bob.address));382 expect(await getTokenOwner(api, collectionId, tokenId)).to.be.deep.equal(normalizeAccountId(bob.address));
370 });383 });
389 await confirmSponsorshipExpectSuccess(collectionId, '//Bob');402 await confirmSponsorshipExpectSuccess(collectionId, '//Bob');
390403
391 await usingApi(async api => {404 await usingApi(async api => {
405 const scheduledId = await makeScheduledId();
392 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address);406 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address);
393407
394 const bobBalanceBefore = await getFreeBalance(bob);408 const bobBalanceBefore = await getFreeBalance(bob);
395 const waitForBlocks = 4;409 const waitForBlocks = 4;
396 // no need to wait to check, fees must be deducted on scheduling, immediately410 // no need to wait to check, fees must be deducted on scheduling, immediately
397 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, bob, 0, waitForBlocks, makeScheduledId());411 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, bob, 0, waitForBlocks, scheduledId);
398 const bobBalanceAfter = await getFreeBalance(bob);412 const bobBalanceAfter = await getFreeBalance(bob);
399 // expect(aliceBalanceAfter == aliceBalanceBefore).to.be.true;413 // expect(aliceBalanceAfter == aliceBalanceBefore).to.be.true;
400 expect(bobBalanceAfter < bobBalanceBefore).to.be.true;414 expect(bobBalanceAfter < bobBalanceBefore).to.be.true;
420434
421 // Mint a fresh NFT435 // Mint a fresh NFT
422 const tokenId = await createItemExpectSuccess(zeroBalance, collectionId, 'NFT');436 const tokenId = await createItemExpectSuccess(zeroBalance, collectionId, 'NFT');
437 const scheduledId = await makeScheduledId();
423438
424 // Schedule transfer of the NFT a few blocks ahead439 // Schedule transfer of the NFT a few blocks ahead
425 const waitForBlocks = 5;440 const waitForBlocks = 5;
426 await scheduleTransferExpectSuccess(api, collectionId, tokenId, zeroBalance, alice, 1, waitForBlocks, makeScheduledId());441 await scheduleTransferExpectSuccess(api, collectionId, tokenId, zeroBalance, alice, 1, waitForBlocks, scheduledId);
427442
428 // Get rid of the account's funds before the scheduled transaction takes place443 // Get rid of the account's funds before the scheduled transaction takes place
429 const balanceTx2 = api.tx.balances.transfer(alice.address, UNIQUE * 68n / 100n);444 const balanceTx2 = api.tx.balances.transfer(alice.address, UNIQUE * 68n / 100n);
452 await setCollectionSponsorExpectSuccess(collectionId, zeroBalance.address);467 await setCollectionSponsorExpectSuccess(collectionId, zeroBalance.address);
453 await confirmSponsorshipByKeyExpectSuccess(collectionId, zeroBalance);468 await confirmSponsorshipByKeyExpectSuccess(collectionId, zeroBalance);
454469
470 const scheduledId = await makeScheduledId();
455 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address);471 const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address);
456472
457 const waitForBlocks = 5;473 const waitForBlocks = 5;
458 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, zeroBalance, 1, waitForBlocks, makeScheduledId());474 await scheduleTransferExpectSuccess(api, collectionId, tokenId, alice, zeroBalance, 1, waitForBlocks, scheduledId);
459475
460 const emptyBalanceSponsorTx = api.tx.balances.setBalance(zeroBalance.address, 0, 0);476 const emptyBalanceSponsorTx = api.tx.balances.setBalance(zeroBalance.address, 0, 0);
461 const sudoTx = api.tx.sudo.sudo(emptyBalanceSponsorTx as any);477 const sudoTx = api.tx.sudo.sudo(emptyBalanceSponsorTx as any);
484500
485 const createData = {nft: {const_data: [], variable_data: []}};501 const createData = {nft: {const_data: [], variable_data: []}};
486 const creationTx = api.tx.unique.createItem(collectionId, normalizeAccountId(zeroBalance), createData as any);502 const creationTx = api.tx.unique.createItem(collectionId, normalizeAccountId(zeroBalance), createData as any);
503 const scheduledId = await makeScheduledId();
487504
488 /*const badTransaction = async function () {505 /*const badTransaction = async function () {
489 await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);506 await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
490 };507 };
491 await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');*/508 await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');*/
492509
493 await expect(scheduleAfter(api, creationTx, zeroBalance, 3, makeScheduledId(), 1, 3)).to.be.rejectedWith(/Inability to pay some fees/);510 await expect(scheduleAfter(api, creationTx, zeroBalance, 3, scheduledId, 1, 3)).to.be.rejectedWith(/Inability to pay some fees/);
494511
495 expect(await getFreeBalance(bob)).to.be.equal(bobBalanceBefore);512 expect(await getFreeBalance(bob)).to.be.equal(bobBalanceBefore);
496 });513 });
modifiedtests/src/deprecated-helpers/helpers.tsdiffbeforeafterboth
1260) {1260) {
1261 const transferTx = api.tx.balances.transfer(recipient.address, amount);1261 const transferTx = api.tx.balances.transfer(recipient.address, amount);
12621262
1263<<<<<<< HEAD
1264 const balanceBefore = await getFreeBalance(recipient);
1265
1266 await scheduleExpectSuccess(transferTx, sender, blockSchedule, scheduledId, period, repetitions);
1267=======
1268 const balanceBefore = await getFreeBalance(recipient);1263 const balanceBefore = await getFreeBalance(recipient);
1269 1264
1270 await expect(scheduleAfter(api, transferTx, sender, blocksBeforeExecution, scheduledId, period, repetitions)).to.not.be.rejected;1265 await expect(scheduleAfter(api, transferTx, sender, blocksBeforeExecution, scheduledId, period, repetitions)).to.not.be.rejected;
1271>>>>>>> test(scheduler): enable and add more coverage, leave sponsorship disabled
12721266
1273 expect(await getFreeBalance(recipient)).to.be.equal(balanceBefore);1267 expect(await getFreeBalance(recipient)).to.be.equal(balanceBefore);
1274}1268}