Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
added rescan to fix missing balance
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh committed Aug 4, 2021
1 parent d8ffc4d commit b4bef31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/module.playground/_module.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { MasterNodeRegTestContainer } from '@defichain/testcontainers'
import { NestFastifyApplication } from '@nestjs/platform-fastify'
import { createTestingApp, stopTestingApp } from '@src/e2e.module'
import { JsonRpcClient } from '@defichain/jellyfish-api-jsonrpc'
import BigNumber from 'bignumber.js'

const container = new MasterNodeRegTestContainer()
let client: JsonRpcClient
Expand Down Expand Up @@ -37,3 +38,14 @@ it('should have masternode setup', async () => {
const oracles = await client.masternode.listMasternodes()
expect(Object.values(oracles).length).toBe(10)
})

it('should not have minted more than 200 blocks', async () => {
const count = await client.blockchain.getBlockCount()
expect(count).toBeLessThanOrEqual(200)
})

it('should have at least 199 million in balance', async () => {
const m199 = new BigNumber('199100100')
const balances = await client.wallet.getBalances()
expect(balances.mine.trusted.isGreaterThan(m199)).toStrictEqual(true)
})
4 changes: 2 additions & 2 deletions src/module.playground/_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export class PlaygroundModule implements OnApplicationBootstrap {
}

for (const genesisKey of GenesisKeys) {
await this.client.wallet.importPrivKey(genesisKey.owner.privKey, undefined, false)
await this.client.wallet.importPrivKey(genesisKey.operator.privKey, undefined, false)
await this.client.wallet.importPrivKey(genesisKey.owner.privKey, undefined, true)
await this.client.wallet.importPrivKey(genesisKey.operator.privKey, undefined, true)
}
}

Expand Down

0 comments on commit b4bef31

Please sign in to comment.