Skip to content

Commit

Permalink
Skip using safe tag for cronos (#193)
Browse files Browse the repository at this point in the history
* Skip using safe tag for cronos

* Update changelog
  • Loading branch information
stwiname authored Oct 27, 2023
1 parent e53a47f commit ededfd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Unfinalized blocks not working with Cronos (#193)

## [3.1.1] - 2023-10-25
### Fixed
Expand Down
4 changes: 3 additions & 1 deletion packages/node/src/ethereum/api.ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ export class EthereumApi implements ApiWrapper {
}

async getBestBlockHeight(): Promise<number> {
const tag = this.supportsFinalization ? 'safe' : 'latest';
// Cronos "safe" tag doesn't currently work as indended
const tag =
this.supportsFinalization && this.chainId !== 25 ? 'safe' : 'latest';
return (await this.client.getBlock(tag)).number;
}

Expand Down

0 comments on commit ededfd6

Please sign in to comment.