Skip to content

Commit

Permalink
Fixing failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pauan committed Sep 7, 2024
1 parent 191b101 commit 5e2ed69
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sdk/src/network-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ class AleoNetworkClient {
* @example
* const latestHeight = networkClient.getLatestHeight();
*/
async getLatestHeight(): Promise<number | Error> {
async getLatestHeight(): Promise<bigint | Error> {
try {
return await this.fetchData<number>("/latest/height");
return await this.fetchData<bigint>("/latest/height");
} catch (error) {
throw new Error("Error fetching latest height.");
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/record-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sdk/tests/network-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit 5e2ed69

Please sign in to comment.