Skip to content

Commit

Permalink
remove unnecessary transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-aurele-besner committed Jun 13, 2024
1 parent 46f50a9 commit 322acab
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions packages/auto-consensus/__test__/staking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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,
])
Expand All @@ -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()', () => {
Expand Down Expand Up @@ -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'
Expand All @@ -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)

Expand Down

0 comments on commit 322acab

Please sign in to comment.