From b2c497bc59dee847df47e90cf4ca41dd5351786e Mon Sep 17 00:00:00 2001 From: izzycsy Date: Mon, 24 May 2021 22:29:48 +0800 Subject: [PATCH] /kind feature Add getDifficulty --- .../__tests__/category/blockchain.test.ts | 14 -------------- .../jellyfish-api-core/src/category/blockchain.ts | 2 +- website/docs/jellyfish/api/blockchain.md | 1 + 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/jellyfish-api-core/__tests__/category/blockchain.test.ts b/packages/jellyfish-api-core/__tests__/category/blockchain.test.ts index 68c46487b3..960051df23 100644 --- a/packages/jellyfish-api-core/__tests__/category/blockchain.test.ts +++ b/packages/jellyfish-api-core/__tests__/category/blockchain.test.ts @@ -249,21 +249,7 @@ describe('masternode', () => { }) }) - // getDifficulty of masternode & non masternode describe('getdifficulty', () => { - // const container = new DifficultyRegTest() - const client = new ContainerAdapterClient(container) - - beforeAll(async () => { - await container.start() - await container.waitForReady() - // await container.waitForWalletCoinbaseMaturity() - }) - - afterAll(async () => { - await container.stop() - }) - it('should getDifficulty', async () => { const difficulty = await client.blockchain.getDifficulty() expect(difficulty).toBeGreaterThanOrEqual(0) diff --git a/packages/jellyfish-api-core/src/category/blockchain.ts b/packages/jellyfish-api-core/src/category/blockchain.ts index ec90429d1f..b688dc7b0d 100644 --- a/packages/jellyfish-api-core/src/category/blockchain.ts +++ b/packages/jellyfish-api-core/src/category/blockchain.ts @@ -111,7 +111,7 @@ export class Blockchain { } /** - * Get difficulty of chain. + * Get the proof-of-work difficulty as a multiple of the minimum difficulty. * * @return {Promise} */ diff --git a/website/docs/jellyfish/api/blockchain.md b/website/docs/jellyfish/api/blockchain.md index e8fadebbf3..63d62ec405 100644 --- a/website/docs/jellyfish/api/blockchain.md +++ b/website/docs/jellyfish/api/blockchain.md @@ -197,6 +197,7 @@ Return the proof-of-work difficulty as a multiple of the minimum difficulty. interface blockchain { getDifficulty (): Promise } +``` ## getTxOut