-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Monitoring: Migrate to latest SDK (#819)
Depends on: #818 Depends on: #820 Here we migrate the monitoring package to the latest version of tBTC SDK. We are using the latest `development` version of the SDK for now as it contains some unreleased features and fixes that are useful for the monitoring tool. Migration of the monitoring to the new tBTC SDK pays off some tech debt but also reduces the number of requests sent to the Ethereum node due to some optimizations introduced in the recent versions of the SDK.
- Loading branch information
Showing
15 changed files
with
495 additions
and
642 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
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,21 @@ | ||
import { providers } from "ethers" | ||
|
||
import { context } from "./context" | ||
|
||
const resolve = () => { | ||
const provider = new providers.JsonRpcProvider(context.ethereumUrl) | ||
|
||
const latestBlock = async () => { | ||
const block = await provider.getBlock("latest") | ||
return block.number | ||
} | ||
|
||
const blockTimestamp = async (blockNumber: number): Promise<number> => { | ||
const block = await provider.getBlock(blockNumber) | ||
return block.timestamp | ||
} | ||
|
||
return { latestBlock, blockTimestamp } | ||
} | ||
|
||
export const blocks = resolve() |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.