Skip to content

Commit 8f248db

Browse files
specified mentions of 'height' as 'blockHeight' in network-client
1 parent 9705b65 commit 8f248db

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

sdk/src/network-client.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,16 @@ class AleoNetworkClient {
316316
/**
317317
* Returns the contents of the block at the specified block height.
318318
*
319-
* @param {number} height
319+
* @param {number} blockHeight
320320
* @example
321321
* const block = networkClient.getBlock(1234);
322322
*/
323-
async getBlock(height: number): Promise<BlockJSON> {
323+
async getBlock(blockHeight: number): Promise<BlockJSON> {
324324
try {
325-
const block = await this.fetchData<BlockJSON>("/block/" + height);
325+
const block = await this.fetchData<BlockJSON>("/block/" + blockHeight);
326326
return block;
327327
} catch (error) {
328-
throw new Error(`Error fetching block ${height}: ${error}`);
328+
throw new Error(`Error fetching block ${blockHeight}: ${error}`);
329329
}
330330
}
331331

@@ -460,18 +460,18 @@ class AleoNetworkClient {
460460
/**
461461
* Returns the committe at the specified block height.
462462
*
463-
* @param {number} height
463+
* @param {number} blockHeight
464464
*
465465
* @returns {Promise<object>} A javascript object containing the committee
466466
*
467467
* @example
468468
* const committee = await networkClient.getCommitteByBlockHeight(1234);
469469
*/
470-
async getCommitteeByBlockHeight(height: number): Promise<object> {
470+
async getCommitteeByBlockHeight(blockHeight: number): Promise<object> {
471471
try {
472-
return await this.fetchData<object>(`/committee/${height}`);
472+
return await this.fetchData<object>(`/committee/${blockHeight}`);
473473
} catch (error) {
474-
throw new Error(`Error fetching committee at height ${height}: ${error}`);
474+
throw new Error(`Error fetching committee at height ${blockHeight}: ${error}`);
475475
}
476476
}
477477

@@ -493,9 +493,9 @@ class AleoNetworkClient {
493493
* Returns the latest block hash.
494494
*
495495
* @example
496-
* const latestHash - newtworkClient.getLatestHash();
496+
* const latestHash - newtworkClient.getLatestBlockHash();
497497
*/
498-
async getLatestHash(): Promise<string> {
498+
async getLatestBlockHash(): Promise<string> {
499499
try {
500500
return String(await this.fetchData<string>("/block/hash/latest"));
501501
} catch (error) {
@@ -809,13 +809,13 @@ class AleoNetworkClient {
809809
/**
810810
* Returns the transactions present at the specified block height.
811811
*
812-
* @param {number} height
812+
* @param {number} blockHeight
813813
* @example
814814
* const transactions = networkClient.getTransactions(654);
815815
*/
816-
async getTransactions(height: number): Promise<Array<ConfirmedTransactionJSON>> {
816+
async getTransactions(blockHeight: number): Promise<Array<ConfirmedTransactionJSON>> {
817817
try {
818-
return await this.fetchData<Array<ConfirmedTransactionJSON>>("/block/" + height.toString() + "/transactions");
818+
return await this.fetchData<Array<ConfirmedTransactionJSON>>("/block/" + blockHeight.toString() + "/transactions");
819819
} catch (error) {
820820
throw new Error(`Error fetching transactions: ${error}`);
821821
}

sdk/tests/network-client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ describe('NodeConnection', () => {
166166
});
167167
});
168168

169-
describe('getLatestHash', () => {
169+
describe('getLatestBlockHash', () => {
170170
it('should return a string', async () => {
171-
const latestHash = await connection.getLatestHash();
171+
const latestHash = await connection.getLatestBlockHash();
172172
expect(typeof latestHash).equal('string');
173173
});
174174

0 commit comments

Comments
 (0)