From 322acaba2e27b8b65c3b6067057c8e7aa0410b6c Mon Sep 17 00:00:00 2001 From: Marc-Aurele Besner <82244926+marc-aurele-besner@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:01:57 -0400 Subject: [PATCH] remove unnecessary transfer --- .../auto-consensus/__test__/staking.test.ts | 32 ++----------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/packages/auto-consensus/__test__/staking.test.ts b/packages/auto-consensus/__test__/staking.test.ts index 2d36c310..460d6541 100644 --- a/packages/auto-consensus/__test__/staking.test.ts +++ b/packages/auto-consensus/__test__/staking.test.ts @@ -114,14 +114,6 @@ describe('Verify staking functions', () => { const _balanceSenderStart = await balance(api, address(sender.address)) expect(_balanceSenderStart.free).toBeGreaterThan(BigInt(0)) - // Transfer some funds to the operator - const amountToTransfer = '10000000000000000000' - await signAndSendTx( - sender, - await transfer(api, operatorAccounts[0].address, amountToTransfer), - [events.transfer], - ) - const domainId = '0' const amountToStake = '100000000000000000000' const minimumNominatorStake = '1000000000000000000' @@ -138,11 +130,6 @@ describe('Verify staking functions', () => { await signAndSendTx(sender, await registerOperator(txInput), [events.operatorRegistered]) await verifyOperatorRegistration(txInput) - const _balanceSenderEnd = await balance(api, address(sender.address)) - expect(_balanceSenderEnd.free).toBeLessThan( - _balanceSenderStart.free - BigInt(amountToStake), - ) - await sudo(api, sender, await api.tx.domains.forceStakingEpochTransition(domainId), [ events.forceDomainEpochTransition, ]) @@ -151,16 +138,16 @@ describe('Verify staking functions', () => { if (operator) { const amountToAdd = '50000000000000000000' await signAndSendTx( - operatorAccounts[0], + sender, await nominateOperator({ api, - operatorId: operator?.operatorId, + operatorId: operator.operatorId, amountToStake: amountToAdd, }), [events.operatorNominated], ) } else throw new Error('Operator not found') - }, 120000) + }, 180000) }) describe('Test deregisterOperator()', () => { @@ -282,14 +269,6 @@ describe('Verify staking functions', () => { // const _balanceSenderStart = await balance(api, address(sender.address)) // expect(_balanceSenderStart.free).toBeGreaterThan(BigInt(0)) - // // Transfer some funds to the operator - // const amountToTransfer = '10000000000000000000' - // await signAndSendTx( - // sender, - // await transfer(api, operatorAccounts[0].address, amountToTransfer), - // [events.transfer] - // ) - // const domainId = '0' // const amountToStake = '100000000000000000000' // const minimumNominatorStake = '1000000000000000000' @@ -306,11 +285,6 @@ describe('Verify staking functions', () => { // await signAndSendTx(sender, await registerOperator(txInput), [events.operatorRegistered]) // await verifyOperatorRegistration(txInput) - // const _balanceSenderEnd = await balance(api, address(sender.address)) - // expect(_balanceSenderEnd.free).toBeLessThan( - // _balanceSenderStart.free - BigInt(amountToStake), - // ) - // await sudo(api, sender, await api.tx.domains.forceStakingEpochTransition(domainId), [events.forceDomainEpochTransition]) // const findOperator = await verifyOperatorRegistrationFinal(txInput)