-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(blockHash): add blockHash and fix test cases
- Loading branch information
Sean Han
committed
Jan 3, 2022
1 parent
f4257be
commit 4e107eb
Showing
4 changed files
with
99 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { BlockNumber } from '../types'; | ||
import { BigNumberish } from '../utils/number'; | ||
|
||
/** | ||
* TODO | ||
* [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L148-L153) | ||
* | ||
* @param hashValue | ||
* @param hashField | ||
*/ | ||
export function formatHash() {} | ||
|
||
/** | ||
* TODO | ||
* [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L156-L161) | ||
* @param txHash | ||
* @param txId | ||
*/ | ||
export function txIdentifier() {} | ||
|
||
/** | ||
* Gets the block identifier for API request | ||
* | ||
* [Reference](https://github.com/starkware-libs/cairo-lang/blob/fc97bdd8322a7df043c87c371634b26c15ed6cee/src/starkware/starknet/services/api/feeder_gateway/feeder_gateway_client.py#L164-L173) | ||
* | ||
* @param blockNumber | ||
* @param blockHash | ||
* @returns block identifier for API request | ||
*/ | ||
export function getFormattedBlockIdentifier( | ||
blockHash?: BigNumberish, | ||
blockNumber: BlockNumber = null | ||
): string { | ||
if (blockHash) { | ||
return `?blockHash=${blockHash}`; | ||
} | ||
return `?blockNumber=${blockNumber}`; | ||
} |