From 5e2ed69e737675bbf7ee0c37fe261881394fc007 Mon Sep 17 00:00:00 2001 From: Pauan Date: Sat, 7 Sep 2024 16:51:09 -0700 Subject: [PATCH] Fixing failing unit test --- sdk/src/network-client.ts | 4 ++-- sdk/src/record-provider.ts | 2 +- sdk/tests/network-client.test.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/src/network-client.ts b/sdk/src/network-client.ts index 1abe9321c..d470bf42a 100644 --- a/sdk/src/network-client.ts +++ b/sdk/src/network-client.ts @@ -392,9 +392,9 @@ class AleoNetworkClient { * @example * const latestHeight = networkClient.getLatestHeight(); */ - async getLatestHeight(): Promise { + async getLatestHeight(): Promise { try { - return await this.fetchData("/latest/height"); + return await this.fetchData("/latest/height"); } catch (error) { throw new Error("Error fetching latest height."); } diff --git a/sdk/src/record-provider.ts b/sdk/src/record-provider.ts index cc508e851..6e1143651 100644 --- a/sdk/src/record-provider.ts +++ b/sdk/src/record-provider.ts @@ -206,7 +206,7 @@ class NetworkRecordProvider implements RecordProvider { if (end instanceof Error) { throw logAndThrow("Unable to get current block height from the network") } - endHeight = end; + endHeight = Number(end); } // If the start height is greater than the end height, throw an error diff --git a/sdk/tests/network-client.test.ts b/sdk/tests/network-client.test.ts index 1b2118195..5be4867d7 100644 --- a/sdk/tests/network-client.test.ts +++ b/sdk/tests/network-client.test.ts @@ -100,7 +100,7 @@ describe('NodeConnection', () => { describe('getLatestHeight', () => { it('should return a number', async () => { const latestHeight = await connection.getLatestHeight(); - expect(typeof latestHeight).toBe('number'); + expect(typeof latestHeight).toBe('bigint'); }, 60000); });