-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented getUnconfirmBalance and incomplete tests.
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { MasterNodeRegTestContainer } from '@defichain/testcontainers' | ||
import { ContainerAdapterClient } from '../../container_adapter_client' | ||
|
||
describe('Balance on masternode', () => { | ||
const container = new MasterNodeRegTestContainer() | ||
const client = new ContainerAdapterClient(container) | ||
|
||
beforeAll(async () => { | ||
await container.start() | ||
await container.waitForReady() | ||
await container.waitForWalletCoinbaseMaturity() | ||
}) | ||
|
||
afterAll(async () => { | ||
await container.stop() | ||
}) | ||
|
||
it('should getUnconfirmedBalance', async () => { | ||
const address = 'mwsZw8nF7pKxWH8eoKL9tPxTpaFkz7QeLU' | ||
const unconfirmedbalance = await client.wallet.getUnconfirmedBalance() | ||
|
||
expect(unconfirmedbalance.toNumber()).toStrictEqual(0) | ||
await client.wallet.sendToAddress(address, 35) | ||
|
||
await container.generate(1) | ||
|
||
const newUnconfirmedBalance = await client.wallet.getUnconfirmedBalance() | ||
|
||
expect(newUnconfirmedBalance.toNumber()).toStrictEqual(0) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters