From 49e2a3f4e3a693df2a40fc61016c05221e7b53e6 Mon Sep 17 00:00:00 2001 From: Siradji Date: Thu, 20 May 2021 00:25:49 +0100 Subject: [PATCH] Minor fixes --- .../__tests__/category/blockchain.test.ts | 36 +++++++++---------- .../src/category/blockchain.ts | 1 - 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/packages/jellyfish-api-core/__tests__/category/blockchain.test.ts b/packages/jellyfish-api-core/__tests__/category/blockchain.test.ts index f9e4c1a29b..e6e4aef423 100644 --- a/packages/jellyfish-api-core/__tests__/category/blockchain.test.ts +++ b/packages/jellyfish-api-core/__tests__/category/blockchain.test.ts @@ -317,32 +317,28 @@ describe('masternode', () => { describe('getBlockStats', () => { it('should get blockchain stats and return all values', async () => { - const blockHash = await waitForBlockHash(1); - const stats = await client.blockchain.getBlockStats(blockHash); - + const blockHash = await waitForBlockHash(1) + const stats = await client.blockchain.getBlockStats(blockHash) - expect(stats.height).toBeGreaterThanOrEqual(1); - expect(stats.minfee).toBeLessThanOrEqual(stats.medianfee); - expect(stats.medianfee).toBeLessThanOrEqual(stats.maxfee); + expect(stats.height).toBeGreaterThanOrEqual(1) + expect(stats.minfee).toBeLessThanOrEqual(stats.medianfee) + expect(stats.medianfee).toBeLessThanOrEqual(stats.maxfee) }) it('should get blockchain stats with specific values', async () => { - const blockHash = await waitForBlockHash(1); - const stats = await client.blockchain.getBlockStats(blockHash, ["avgfee", "height"]); - - expect("height" in stats).toBeTruthy(); - expect("avgfee" in stats).toBeTruthy(); - expect(stats.height).toBeGreaterThanOrEqual(1); - expect(Object.keys(stats).length).toEqual(2); - + const blockHash = await waitForBlockHash(1) + const stats = await client.blockchain.getBlockStats(blockHash, ['avgfee', 'height']) + + expect('height' in stats).toBeTruthy() + expect('avgfee' in stats).toBeTruthy() + expect(stats.height).toBeGreaterThanOrEqual(1) + expect(Object.keys(stats).length).toEqual(2) }) }) describe('getBestBlockHash', () => { - test('should Get hash of best block and return a string', async () => { - const bestBlockHash = await client.blockchain.getBestBlockHash(); - expect(bestBlockHash).toBeTruthy(); - }) - + test('should Get hash of best block and return a string', async () => { + const bestBlockHash = await client.blockchain.getBestBlockHash() + expect(bestBlockHash).toBeTruthy() + }) }) - }) diff --git a/packages/jellyfish-api-core/src/category/blockchain.ts b/packages/jellyfish-api-core/src/category/blockchain.ts index 39dfe426f5..4dd242245a 100644 --- a/packages/jellyfish-api-core/src/category/blockchain.ts +++ b/packages/jellyfish-api-core/src/category/blockchain.ts @@ -325,7 +325,6 @@ export interface MempoolTx { 'bip125-replaceable': boolean } } - export interface BlockStats { avgfee: number avgfeerate: number