forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from babylonlabs-io/feat/finality-gadget-client
feat: finality gadget client
- Loading branch information
Showing
12 changed files
with
268 additions
and
1,542 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,26 @@ | ||
package finality | ||
|
||
import "github.com/babylonlabs-io/finality-gadget/types" | ||
|
||
type IFinalityGadgetClient interface { | ||
/// QueryIsBlockBabylonFinalized checks if the given L2 block is finalized by the Babylon finality gadget | ||
QueryIsBlockBabylonFinalized(block *types.Block) (bool, error) | ||
|
||
/// QueryBlockRangeBabylonFinalized searches for a row of consecutive finalized blocks in the block range, and returns | ||
QueryBlockRangeBabylonFinalized(blocks []*types.Block) (*uint64, error) | ||
|
||
/// QueryBtcStakingActivatedTimestamp returns the timestamp when the BTC staking is activated | ||
QueryBtcStakingActivatedTimestamp() (uint64, error) | ||
|
||
/// QueryIsBlockFinalizedByHeight returns the btc finalization status of a block at given height by querying the local db | ||
QueryIsBlockFinalizedByHeight(height uint64) (bool, error) | ||
|
||
/// QueryIsBlockFinalizedByHash returns the btc finalization status of a block at given hash by querying the local db | ||
QueryIsBlockFinalizedByHash(hash string) (bool, error) | ||
|
||
/// QueryLatestFinalizedBlock returns the latest finalized block by querying the local db | ||
QueryLatestFinalizedBlock() (*types.Block, error) | ||
|
||
// Closes the client | ||
Close() error | ||
} |
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.