Documentation ¶
Index ¶
- type ActiveBtcDelegation
- type BlockQuery
- type BlocksQuery
- type BlocksResponse
- type BtcStaking
- type BtcUndelegationInfo
- type CommitPublicRandomness
- type ConsumerDelegationsResponse
- type ConsumerFpInfoResponse
- type ConsumerFpsByPowerResponse
- type ConsumerFpsResponse
- type CosmwasmConsumerController
- func (cc *CosmwasmConsumerController) Close() error
- func (cc *CosmwasmConsumerController) CommitPubRandList(fpPk *btcec.PublicKey, startHeight uint64, numPubRand uint64, ...) (*types.TxResponse, error)
- func (cc *CosmwasmConsumerController) ExecuteFinalityContract(msgBytes []byte) (*provider.RelayerTxResponse, error)
- func (cc *CosmwasmConsumerController) ExecuteStakingContract(msgBytes []byte) (*provider.RelayerTxResponse, error)
- func (cc *CosmwasmConsumerController) GetCometBlock(height int64) (*coretypes.ResultBlock, error)
- func (cc *CosmwasmConsumerController) GetCometNodeStatus() (*coretypes.ResultStatus, error)
- func (cc *CosmwasmConsumerController) GetLatestCodeId() (uint64, error)
- func (cc *CosmwasmConsumerController) IBCChannels() (*channeltypes.QueryChannelsResponse, error)
- func (cc *CosmwasmConsumerController) InstantiateContract(codeID uint64, initMsg []byte) error
- func (cc *CosmwasmConsumerController) ListContractsByCode(codeID uint64, pagination *sdkquerytypes.PageRequest) (*wasmdtypes.QueryContractsByCodeResponse, error)
- func (cc *CosmwasmConsumerController) MustGetValidatorAddress() string
- func (cc *CosmwasmConsumerController) QueryActivatedHeight() (uint64, error)
- func (cc *CosmwasmConsumerController) QueryBabylonContractBalances() (sdk.Coins, error)
- func (cc *CosmwasmConsumerController) QueryBalance(address string, denom string) (*sdk.Coin, error)
- func (cc *CosmwasmConsumerController) QueryBalances(address string) (sdk.Coins, error)
- func (cc *CosmwasmConsumerController) QueryBlock(height uint64) (*types.BlockInfo, error)
- func (cc *CosmwasmConsumerController) QueryBlocks(startHeight, endHeight, limit uint64) ([]*types.BlockInfo, error)
- func (cc *CosmwasmConsumerController) QueryChannelClientState(channelID, portID string) (*channeltypes.QueryChannelClientStateResponse, error)
- func (cc *CosmwasmConsumerController) QueryDelegations() (*ConsumerDelegationsResponse, error)
- func (cc *CosmwasmConsumerController) QueryFinalityContractBalances() (sdk.Coins, error)
- func (cc *CosmwasmConsumerController) QueryFinalityProvider(btcPkHex string) (*SingleConsumerFpResponse, error)
- func (cc *CosmwasmConsumerController) QueryFinalityProviderHasPower(fpPk *btcec.PublicKey, blockHeight uint64) (bool, error)
- func (cc *CosmwasmConsumerController) QueryFinalityProviderInfo(fpPk *btcec.PublicKey, opts ...uint64) (*ConsumerFpInfoResponse, error)
- func (cc *CosmwasmConsumerController) QueryFinalityProviders() (*ConsumerFpsResponse, error)
- func (cc *CosmwasmConsumerController) QueryFinalityProvidersByPower() (*ConsumerFpsByPowerResponse, error)
- func (cc *CosmwasmConsumerController) QueryFinalitySignature(fpBtcPkHex string, height uint64) (*FinalitySignatureResponse, error)
- func (cc *CosmwasmConsumerController) QueryIndexedBlock(height uint64) (*IndexedBlock, error)
- func (cc *CosmwasmConsumerController) QueryIsBlockFinalized(height uint64) (bool, error)
- func (cc *CosmwasmConsumerController) QueryLastPublicRandCommit(fpPk *btcec.PublicKey) (*types.PubRandCommit, error)
- func (cc *CosmwasmConsumerController) QueryLatestBlockHeight() (uint64, error)
- func (cc *CosmwasmConsumerController) QueryLatestFinalizedBlock() (*types.BlockInfo, error)
- func (cc *CosmwasmConsumerController) QueryNextSequenceReceive(channelID, portID string) (*channeltypes.QueryNextSequenceReceiveResponse, error)
- func (cc *CosmwasmConsumerController) QueryNodeStatus() (*coretypes.ResultStatus, error)
- func (cc *CosmwasmConsumerController) QuerySmartContractState(contractAddress string, queryData string) (*wasmdtypes.QuerySmartContractStateResponse, error)
- func (cc *CosmwasmConsumerController) QueryStakingContractBalances() (sdk.Coins, error)
- func (cc *CosmwasmConsumerController) SetBtcFinalityContractAddress(newAddress string)
- func (cc *CosmwasmConsumerController) SetBtcStakingContractAddress(newAddress string)
- func (cc *CosmwasmConsumerController) StoreWasmCode(wasmFile string) error
- func (cc *CosmwasmConsumerController) SubmitBatchFinalitySigs(fpPk *btcec.PublicKey, blocks []*types.BlockInfo, ...) (*types.TxResponse, error)
- func (cc *CosmwasmConsumerController) SubmitFinalitySig(fpSK *btcec.PrivateKey, fpBtcPk *btcec.PublicKey, ...) (*types.TxResponse, error)
- func (cc *CosmwasmConsumerController) SubmitInvalidFinalitySig(r *rand.Rand, fpSK *btcec.PrivateKey, fpBtcPk *btcec.PublicKey, ...) (*types.TxResponse, error)
- type CovenantAdaptorSignatures
- type DelegatorUnbondingInfo
- type ExecMsg
- type FinalityProviderDescription
- type FinalityProviderInfo
- type FinalityProviderQuery
- type FinalitySignatureQuery
- type FinalitySignatureResponse
- type IndexedBlock
- type LastPubRandCommitQuery
- type NewFinalityProvider
- type Proof
- type ProofOfPossessionBtc
- type QueryMsgActivatedHeight
- type QueryMsgBlock
- type QueryMsgBlocks
- type QueryMsgDelegations
- type QueryMsgFinalityProvider
- type QueryMsgFinalityProviderInfo
- type QueryMsgFinalityProviders
- type QueryMsgFinalityProvidersByPower
- type QueryMsgFinalitySignature
- type QueryMsgLastPubRandCommit
- type SignatureInfo
- type SingleConsumerDelegationResponse
- type SingleConsumerFpResponse
- type SlashedBtcDelegation
- type SubmitFinalitySignature
- type UnbondedBtcDelegation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveBtcDelegation ¶
type ActiveBtcDelegation struct { StakerAddr string `json:"staker_addr"` BTCPkHex string `json:"btc_pk_hex"` FpBtcPkList []string `json:"fp_btc_pk_list"` StartHeight uint32 `json:"start_height"` EndHeight uint32 `json:"end_height"` TotalSat uint64 `json:"total_sat"` StakingTx []byte `json:"staking_tx"` SlashingTx []byte `json:"slashing_tx"` DelegatorSlashingSig []byte `json:"delegator_slashing_sig"` CovenantSigs []CovenantAdaptorSignatures `json:"covenant_sigs"` StakingOutputIdx uint32 `json:"staking_output_idx"` UnbondingTime uint32 `json:"unbonding_time"` UndelegationInfo BtcUndelegationInfo `json:"undelegation_info"` ParamsVersion uint32 `json:"params_version"` }
type BlockQuery ¶
type BlockQuery struct {
Height uint64 `json:"height"`
}
type BlocksQuery ¶
type BlocksResponse ¶
type BlocksResponse struct {
Blocks []IndexedBlock `json:"blocks"`
}
type BtcStaking ¶
type BtcStaking struct { NewFP []NewFinalityProvider `json:"new_fp"` ActiveDel []ActiveBtcDelegation `json:"active_del"` SlashedDel []SlashedBtcDelegation `json:"slashed_del"` UnbondedDel []UnbondedBtcDelegation `json:"unbonded_del"` }
type BtcUndelegationInfo ¶
type BtcUndelegationInfo struct { UnbondingTx []byte `json:"unbonding_tx"` SlashingTx []byte `json:"slashing_tx"` DelegatorSlashingSig []byte `json:"delegator_slashing_sig"` CovenantSlashingSigs []*CovenantAdaptorSignatures `json:"covenant_slashing_sigs"` CovenantUnbondingSigList []*SignatureInfo `json:"covenant_unbonding_sig_list"` DelegatorUnbondingInfo *DelegatorUnbondingInfo `json:"delegator_unbonding_info"` }
type CommitPublicRandomness ¶
type ConsumerDelegationsResponse ¶
type ConsumerDelegationsResponse struct {
Delegations []SingleConsumerDelegationResponse `json:"delegations"`
}
type ConsumerFpInfoResponse ¶
type ConsumerFpsByPowerResponse ¶
type ConsumerFpsByPowerResponse struct {
Fps []ConsumerFpInfoResponse `json:"fps"`
}
type ConsumerFpsResponse ¶
type ConsumerFpsResponse struct {
Fps []SingleConsumerFpResponse `json:"fps"`
}
type CosmwasmConsumerController ¶
type CosmwasmConsumerController struct {
// contains filtered or unexported fields
}
func NewCosmwasmConsumerController ¶
func NewCosmwasmConsumerController( cfg *cwconfig.CosmwasmConfig, encodingCfg wasmdparams.EncodingConfig, logger *zap.Logger, ) (*CosmwasmConsumerController, error)
func (*CosmwasmConsumerController) Close ¶
func (cc *CosmwasmConsumerController) Close() error
func (*CosmwasmConsumerController) CommitPubRandList ¶
func (cc *CosmwasmConsumerController) CommitPubRandList( fpPk *btcec.PublicKey, startHeight uint64, numPubRand uint64, commitment []byte, sig *schnorr.Signature, ) (*types.TxResponse, error)
CommitPubRandList commits a list of Schnorr public randomness to contract deployed on Consumer Chain it returns tx hash and error
func (*CosmwasmConsumerController) ExecuteFinalityContract ¶
func (cc *CosmwasmConsumerController) ExecuteFinalityContract(msgBytes []byte) (*provider.RelayerTxResponse, error)
func (*CosmwasmConsumerController) ExecuteStakingContract ¶
func (cc *CosmwasmConsumerController) ExecuteStakingContract(msgBytes []byte) (*provider.RelayerTxResponse, error)
func (*CosmwasmConsumerController) GetCometBlock ¶
func (cc *CosmwasmConsumerController) GetCometBlock(height int64) (*coretypes.ResultBlock, error)
GetCometBlock gets the tendermint block at a given height NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) GetCometNodeStatus ¶
func (cc *CosmwasmConsumerController) GetCometNodeStatus() (*coretypes.ResultStatus, error)
GetCometNodeStatus gets the tendermint node status of the consumer chain NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) GetLatestCodeId ¶
func (cc *CosmwasmConsumerController) GetLatestCodeId() (uint64, error)
GetLatestCodeId returns the latest wasm code id. NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) IBCChannels ¶
func (cc *CosmwasmConsumerController) IBCChannels() (*channeltypes.QueryChannelsResponse, error)
IBCChannels queries the IBC channels
func (*CosmwasmConsumerController) InstantiateContract ¶
func (cc *CosmwasmConsumerController) InstantiateContract(codeID uint64, initMsg []byte) error
InstantiateContract instantiates a contract with the given code id and init msg NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) ListContractsByCode ¶
func (cc *CosmwasmConsumerController) ListContractsByCode(codeID uint64, pagination *sdkquerytypes.PageRequest) (*wasmdtypes.QueryContractsByCodeResponse, error)
ListContractsByCode lists all contracts by wasm code id NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) MustGetValidatorAddress ¶
func (cc *CosmwasmConsumerController) MustGetValidatorAddress() string
MustGetValidatorAddress gets the validator address of the consumer chain NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) QueryActivatedHeight ¶
func (cc *CosmwasmConsumerController) QueryActivatedHeight() (uint64, error)
func (*CosmwasmConsumerController) QueryBabylonContractBalances ¶
func (cc *CosmwasmConsumerController) QueryBabylonContractBalances() (sdk.Coins, error)
func (*CosmwasmConsumerController) QueryBalance ¶
func (*CosmwasmConsumerController) QueryBalances ¶
func (cc *CosmwasmConsumerController) QueryBalances(address string) (sdk.Coins, error)
QueryBalances returns balances at the address
func (*CosmwasmConsumerController) QueryBlock ¶
func (cc *CosmwasmConsumerController) QueryBlock(height uint64) (*types.BlockInfo, error)
func (*CosmwasmConsumerController) QueryBlocks ¶
func (cc *CosmwasmConsumerController) QueryBlocks(startHeight, endHeight, limit uint64) ([]*types.BlockInfo, error)
func (*CosmwasmConsumerController) QueryChannelClientState ¶
func (cc *CosmwasmConsumerController) QueryChannelClientState(channelID, portID string) (*channeltypes.QueryChannelClientStateResponse, error)
func (*CosmwasmConsumerController) QueryDelegations ¶
func (cc *CosmwasmConsumerController) QueryDelegations() (*ConsumerDelegationsResponse, error)
func (*CosmwasmConsumerController) QueryFinalityContractBalances ¶
func (cc *CosmwasmConsumerController) QueryFinalityContractBalances() (sdk.Coins, error)
func (*CosmwasmConsumerController) QueryFinalityProvider ¶
func (cc *CosmwasmConsumerController) QueryFinalityProvider(btcPkHex string) (*SingleConsumerFpResponse, error)
func (*CosmwasmConsumerController) QueryFinalityProviderHasPower ¶
func (cc *CosmwasmConsumerController) QueryFinalityProviderHasPower( fpPk *btcec.PublicKey, blockHeight uint64, ) (bool, error)
QueryFinalityProviderHasPower queries whether the finality provider has voting power at a given height
func (*CosmwasmConsumerController) QueryFinalityProviderInfo ¶
func (cc *CosmwasmConsumerController) QueryFinalityProviderInfo( fpPk *btcec.PublicKey, opts ...uint64, ) (*ConsumerFpInfoResponse, error)
func (*CosmwasmConsumerController) QueryFinalityProviders ¶
func (cc *CosmwasmConsumerController) QueryFinalityProviders() (*ConsumerFpsResponse, error)
func (*CosmwasmConsumerController) QueryFinalityProvidersByPower ¶
func (cc *CosmwasmConsumerController) QueryFinalityProvidersByPower() (*ConsumerFpsByPowerResponse, error)
func (*CosmwasmConsumerController) QueryFinalitySignature ¶
func (cc *CosmwasmConsumerController) QueryFinalitySignature(fpBtcPkHex string, height uint64) (*FinalitySignatureResponse, error)
func (*CosmwasmConsumerController) QueryIndexedBlock ¶
func (cc *CosmwasmConsumerController) QueryIndexedBlock(height uint64) (*IndexedBlock, error)
QueryIndexedBlock queries the indexed block at a given height NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) QueryIsBlockFinalized ¶
func (cc *CosmwasmConsumerController) QueryIsBlockFinalized(height uint64) (bool, error)
func (*CosmwasmConsumerController) QueryLastPublicRandCommit ¶
func (cc *CosmwasmConsumerController) QueryLastPublicRandCommit(fpPk *btcec.PublicKey) (*types.PubRandCommit, error)
QueryLastPublicRandCommit returns the last public randomness commitments
func (*CosmwasmConsumerController) QueryLatestBlockHeight ¶
func (cc *CosmwasmConsumerController) QueryLatestBlockHeight() (uint64, error)
func (*CosmwasmConsumerController) QueryLatestFinalizedBlock ¶
func (cc *CosmwasmConsumerController) QueryLatestFinalizedBlock() (*types.BlockInfo, error)
func (*CosmwasmConsumerController) QueryNextSequenceReceive ¶
func (cc *CosmwasmConsumerController) QueryNextSequenceReceive(channelID, portID string) (*channeltypes.QueryNextSequenceReceiveResponse, error)
func (*CosmwasmConsumerController) QueryNodeStatus ¶
func (cc *CosmwasmConsumerController) QueryNodeStatus() (*coretypes.ResultStatus, error)
func (*CosmwasmConsumerController) QuerySmartContractState ¶
func (cc *CosmwasmConsumerController) QuerySmartContractState(contractAddress string, queryData string) (*wasmdtypes.QuerySmartContractStateResponse, error)
QuerySmartContractState queries the smart contract state NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) QueryStakingContractBalances ¶
func (cc *CosmwasmConsumerController) QueryStakingContractBalances() (sdk.Coins, error)
func (*CosmwasmConsumerController) SetBtcFinalityContractAddress ¶
func (cc *CosmwasmConsumerController) SetBtcFinalityContractAddress(newAddress string)
SetBtcFinalityContractAddress updates the BtcFinalityContractAddress in the configuration NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) SetBtcStakingContractAddress ¶
func (cc *CosmwasmConsumerController) SetBtcStakingContractAddress(newAddress string)
SetBtcStakingContractAddress updates the BtcStakingContractAddress in the configuration NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) StoreWasmCode ¶
func (cc *CosmwasmConsumerController) StoreWasmCode(wasmFile string) error
StoreWasmCode stores the wasm code on the consumer chain NOTE: this function is only meant to be used in tests.
func (*CosmwasmConsumerController) SubmitBatchFinalitySigs ¶
func (cc *CosmwasmConsumerController) SubmitBatchFinalitySigs( fpPk *btcec.PublicKey, blocks []*types.BlockInfo, pubRandList []*btcec.FieldVal, proofList [][]byte, sigs []*btcec.ModNScalar, ) (*types.TxResponse, error)
SubmitBatchFinalitySigs submits a batch of finality signatures to Babylon
func (*CosmwasmConsumerController) SubmitFinalitySig ¶
func (cc *CosmwasmConsumerController) SubmitFinalitySig( fpSK *btcec.PrivateKey, fpBtcPk *btcec.PublicKey, privateRand *eots.PrivateRand, pubRand *bbntypes.SchnorrPubRand, proof *cmtcrypto.Proof, heightToVote uint64, ) (*types.TxResponse, error)
func (*CosmwasmConsumerController) SubmitInvalidFinalitySig ¶
func (cc *CosmwasmConsumerController) SubmitInvalidFinalitySig( r *rand.Rand, fpSK *btcec.PrivateKey, fpBtcPk *btcec.PublicKey, privateRand *eots.PrivateRand, pubRand *bbntypes.SchnorrPubRand, proof *cmtcrypto.Proof, heightToVote int64, ) (*types.TxResponse, error)
type DelegatorUnbondingInfo ¶
type DelegatorUnbondingInfo struct {
SpendStakeTx []byte `json:"spend_stake_tx"`
}
type ExecMsg ¶
type ExecMsg struct { SubmitFinalitySignature *SubmitFinalitySignature `json:"submit_finality_signature,omitempty"` BtcStaking *BtcStaking `json:"btc_staking,omitempty"` CommitPublicRandomness *CommitPublicRandomness `json:"commit_public_randomness,omitempty"` }
type FinalityProviderInfo ¶
type FinalityProviderQuery ¶
type FinalityProviderQuery struct {
BtcPkHex string `json:"btc_pk_hex"`
}
type FinalitySignatureQuery ¶
type FinalitySignatureResponse ¶
type FinalitySignatureResponse struct {
Signature []byte `json:"signature"`
}
type IndexedBlock ¶
type LastPubRandCommitQuery ¶
type LastPubRandCommitQuery struct {
BtcPkHex string `json:"btc_pk_hex"`
}
type NewFinalityProvider ¶
type NewFinalityProvider struct { Description *FinalityProviderDescription `json:"description,omitempty"` Commission string `json:"commission"` Addr string `json:"addr"` BTCPKHex string `json:"btc_pk_hex"` Pop *ProofOfPossessionBtc `json:"pop,omitempty"` ConsumerID string `json:"consumer_id"` }
type ProofOfPossessionBtc ¶
type QueryMsgActivatedHeight ¶
type QueryMsgActivatedHeight struct {
ActivatedHeight struct{} `json:"activated_height"`
}
type QueryMsgBlock ¶
type QueryMsgBlock struct {
Block BlockQuery `json:"block"`
}
type QueryMsgBlocks ¶
type QueryMsgBlocks struct {
Blocks BlocksQuery `json:"blocks"`
}
type QueryMsgDelegations ¶
type QueryMsgDelegations struct {
Delegations struct{} `json:"delegations"`
}
type QueryMsgFinalityProvider ¶
type QueryMsgFinalityProvider struct {
FinalityProvider FinalityProviderQuery `json:"finality_provider"`
}
type QueryMsgFinalityProviderInfo ¶
type QueryMsgFinalityProviderInfo struct {
FinalityProviderInfo FinalityProviderInfo `json:"finality_provider_info"`
}
type QueryMsgFinalityProviders ¶
type QueryMsgFinalityProviders struct {
FinalityProviders struct{} `json:"finality_providers"`
}
type QueryMsgFinalityProvidersByPower ¶
type QueryMsgFinalityProvidersByPower struct {
FinalityProvidersByPower struct{} `json:"finality_providers_by_power"`
}
type QueryMsgFinalitySignature ¶
type QueryMsgFinalitySignature struct {
FinalitySignature FinalitySignatureQuery `json:"finality_signature"`
}
type QueryMsgLastPubRandCommit ¶
type QueryMsgLastPubRandCommit struct {
LastPubRandCommit LastPubRandCommitQuery `json:"last_pub_rand_commit"`
}
type SignatureInfo ¶
type SingleConsumerDelegationResponse ¶
type SingleConsumerDelegationResponse struct { BtcPkHex string `json:"btc_pk_hex"` FpBtcPkList []string `json:"fp_btc_pk_list"` StartHeight uint32 `json:"start_height"` EndHeight uint32 `json:"end_height"` TotalSat uint64 `json:"total_sat"` StakingTx []byte `json:"staking_tx"` SlashingTx []byte `json:"slashing_tx"` DelegatorSlashingSig []byte `json:"delegator_slashing_sig"` CovenantSigs []CovenantAdaptorSignatures `json:"covenant_sigs"` StakingOutputIdx uint32 `json:"staking_output_idx"` UnbondingTime uint32 `json:"unbonding_time"` UndelegationInfo *BtcUndelegationInfo `json:"undelegation_info"` ParamsVersion uint32 `json:"params_version"` }
type SingleConsumerFpResponse ¶
type SingleConsumerFpResponse struct { BtcPkHex string `json:"btc_pk_hex"` SlashedHeight uint64 `json:"slashed_height"` SlashedBtcHeight uint32 `json:"slashed_btc_height"` ConsumerId string `json:"consumer_id"` }
SingleConsumerFpResponse represents the finality provider data returned by the contract query. For more details, refer to the following links: https://github.com/babylonchain/babylon-contract/blob/v0.5.3/packages/apis/src/btc_staking_api.rs https://github.com/babylonchain/babylon-contract/blob/v0.5.3/contracts/btc-staking/src/msg.rs https://github.com/babylonchain/babylon-contract/blob/v0.5.3/contracts/btc-staking/schema/btc-staking.json
type SlashedBtcDelegation ¶
type SlashedBtcDelegation struct { }
type SubmitFinalitySignature ¶
type UnbondedBtcDelegation ¶
type UnbondedBtcDelegation struct { }