Skip to content

Commit

Permalink
Added finalized and safe blockTags (ethers-io#3091).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent b52240a commit 1a72306
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/providers/src.ts/formatter.ts
Expand Up @@ -250,8 +250,10 @@ export class Formatter {

if (blockTag === "earliest") { return "0x0"; }

if (blockTag === "latest" || blockTag === "pending") {
return blockTag;
switch (blockTag) {
case "earliest": return "0x0";
case "latest": case "pending": case "safe": case "finalized":
return blockTag;
}

if (typeof(blockTag) === "number" || isHexString(blockTag)) {
Expand Down

0 comments on commit 1a72306

Please sign in to comment.