Skip to content

Commit

Permalink
fix: always default to latest block
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed May 24, 2022
1 parent 8977772 commit dafc575
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/provider/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ type BlockIdentifierObject =
* @returns block identifier object
*/
export function getBlockIdentifier(blockIdentifier: BlockIdentifier): BlockIdentifierObject {
if (blockIdentifier === null) {
return { type: 'BLOCK_NUMBER', data: null };
if (blockIdentifier === null || blockIdentifier === 'latest') {
return { type: 'BLOCK_NUMBER', data: 'latest' }; // default to latest block
}
if (blockIdentifier === 'pending') {
return { type: 'BLOCK_NUMBER', data: 'pending' };
Expand Down

0 comments on commit dafc575

Please sign in to comment.