Skip to content

Commit

Permalink
Added a test to check for the balance after sending out some amount.
Browse files Browse the repository at this point in the history
  • Loading branch information
aikchun committed Jun 11, 2021
1 parent 694f6d3 commit 270ef03
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,17 @@ describe('getBalances on masternode', () => {
expect(typeof balances.watchonly).toStrictEqual('undefined')
})

it('should show balances after transfer', async () => {
it('should show balances after sending the amount out', async () => {
const balance = await client.wallet.getBalances()

const address = await client.wallet.getNewAddress()
const address = 'bcrt1q2tke5fa7wx26m684d7yuyt85rvjl36u6q8l6e2'

await client.wallet.sendToAddress(address, 10000)
await container.generate(1)

const newBalance = await client.wallet.getBalances()

console.log('balance.mine.trusted', balance.mine.trusted.toNumber())
console.log('newBalance.mine.trusted', balance.mine.trusted.toNumber())

expect(newBalance.mine.trusted.toNumber() - balance.mine.trusted.toNumber()).toBeGreaterThan(10000)
expect(balance.mine.trusted.toNumber() - newBalance.mine.trusted.toNumber()).toBeGreaterThan(10000)
})
})

Expand Down

0 comments on commit 270ef03

Please sign in to comment.