-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
363 additions
and
531 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package finalitygadget | ||
|
||
import ( | ||
"context" | ||
"math/big" | ||
|
||
"github.com/babylonlabs-io/finality-gadget/types" | ||
"github.com/btcsuite/btcd/chaincfg/chainhash" | ||
"github.com/btcsuite/btcd/wire" | ||
eth "github.com/ethereum/go-ethereum/core/types" | ||
) | ||
|
||
type IBitcoinClient interface { | ||
GetBlockCount() (uint64, error) | ||
GetBlockHashByHeight(height uint64) (*chainhash.Hash, error) | ||
GetBlockHeaderByHash(blockHash *chainhash.Hash) (*wire.BlockHeader, error) | ||
GetBlockHeightByTimestamp(targetTimestamp uint64) (uint64, error) | ||
GetBlockTimestampByHeight(height uint64) (uint64, error) | ||
} | ||
|
||
type IBabylonClient interface { | ||
QueryAllFpBtcPubKeys(consumerId string) ([]string, error) | ||
QueryFpPower(fpPubkeyHex string, btcHeight uint64) (uint64, error) | ||
QueryMultiFpPower(fpPubkeyHexList []string, btcHeight uint64) (map[string]uint64, error) | ||
QueryEarliestActiveDelBtcHeight(fpPubkeyHexList []string) (uint64, error) | ||
} | ||
|
||
type ICosmWasmClient interface { | ||
QueryListOfVotedFinalityProviders(queryParams *types.Block) ([]string, error) | ||
QueryConsumerId() (string, error) | ||
QueryIsEnabled() (bool, error) | ||
} | ||
|
||
type IEthL2Client interface { | ||
HeaderByNumber(ctx context.Context, number *big.Int) (*eth.Header, error) | ||
Close() | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.