-
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.
Added listCommunityBalances RPC (#368)
- Loading branch information
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
packages/jellyfish-api-core/__tests__/category/account/listCommunityBalances.test.ts
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' | ||
import BigNumber from 'bignumber.js' | ||
|
||
describe('Account', () => { | ||
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 listCommunityBalances', async () => { | ||
const data = await client.account.listCommunityBalances() | ||
|
||
expect(data.AnchorReward instanceof BigNumber).toStrictEqual(true) | ||
expect(data.IncentiveFunding instanceof BigNumber).toStrictEqual(true) | ||
expect(data.Burnt instanceof BigNumber).toStrictEqual(true) | ||
expect(data.Swap).toBeUndefined() | ||
expect(data.Futures).toBeUndefined() | ||
expect(data.Options).toBeUndefined() | ||
expect(data.Unallocated).toBeUndefined() | ||
expect(data.Unknown).toBeUndefined() | ||
}) | ||
}) |
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