Documentation
¶
Index ¶
- func AddRandomSeedsToFuzzer(f *testing.F, num uint)
- func BlockCreationResultToProofs(inputs []*BlockCreationResult) []*btcctypes.BTCSpvProof
- func CreatOpReturnTransaction(r *rand.Rand, babylonData []byte) *wire.MsgTx
- func GenRandomAccWithBalance(n int) ([]authtypes.GenesisAccount, []banktypes.Balance)
- func GenRandomBTCHeaderBits(r *rand.Rand) uint32
- func GenRandomBTCHeaderBytes(r *rand.Rand, parent *btclightclienttypes.BTCHeaderInfo, bitsBig *sdkmath.Uint) bbn.BTCHeaderBytes
- func GenRandomBTCHeaderInfo(r *rand.Rand) *btclightclienttypes.BTCHeaderInfo
- func GenRandomBTCHeaderInfoWithBits(r *rand.Rand, bits *sdkmath.Uint) *btclightclienttypes.BTCHeaderInfo
- func GenRandomBTCHeaderInfoWithInvalidHeader(r *rand.Rand, powLimit *big.Int) *btclightclienttypes.BTCHeaderInfo
- func GenRandomBTCHeaderInfoWithParent(r *rand.Rand, parent *btclightclienttypes.BTCHeaderInfo) *btclightclienttypes.BTCHeaderInfo
- func GenRandomBTCHeaderInfoWithParentAndBits(r *rand.Rand, parent *btclightclienttypes.BTCHeaderInfo, bits *sdkmath.Uint) *btclightclienttypes.BTCHeaderInfo
- func GenRandomBTCHeaderMerkleRoot(r *rand.Rand) *chainhash.Hash
- func GenRandomBTCHeaderNonce(r *rand.Rand) uint32
- func GenRandomBTCHeaderPrevBlock(r *rand.Rand) *bbn.BTCHeaderHashBytes
- func GenRandomBTCHeaderTimestamp(r *rand.Rand) time.Time
- func GenRandomBTCHeaderVersion(r *rand.Rand) int32
- func GenRandomBTCHeight(r *rand.Rand) uint64
- func GenRandomBabylonTx(r *rand.Rand) *wire.MsgTx
- func GenRandomBabylonTxPair(r *rand.Rand) ([]*wire.MsgTx, *btctxformatter.RawBtcCheckpoint)
- func GenRandomBitmap(r *rand.Rand) (bitmap.Bitmap, int)
- func GenRandomBlsMultiSig(r *rand.Rand) bls12381.Signature
- func GenRandomBtcdBlock(r *rand.Rand, numBabylonTxs int, prevHash *chainhash.Hash) (*wire.MsgBlock, *btctxformatter.RawBtcCheckpoint)
- func GenRandomBtcdBlockchainWithBabylonTx(r *rand.Rand, n uint64, oneTxThreshold float32, twoTxThreshold float32) ([]*wire.MsgBlock, int, []*btctxformatter.RawBtcCheckpoint)
- func GenRandomBtcdHash(r *rand.Rand) chainhash.Hash
- func GenRandomBtcdHeader(r *rand.Rand) *wire.BlockHeader
- func GenRandomByteArray(r *rand.Rand, length uint64) []byte
- func GenRandomEpoch(r *rand.Rand) *epochingtypes.Epoch
- func GenRandomEpochInterval(r *rand.Rand) uint64
- func GenRandomEpochNum(r *rand.Rand) uint64
- func GenRandomHexStr(r *rand.Rand, length uint64) string
- func GenRandomIBCTMHeader(r *rand.Rand, chainID string, height uint64) *ibctmtypes.Header
- func GenRandomLastCommitHash(r *rand.Rand) types.LastCommitHash
- func GenRandomPubkeysAndSigs(n int, msg []byte) ([]bls12381.PublicKey, []bls12381.Signature)
- func GenRandomRawCheckpoint(r *rand.Rand) *types.RawCheckpoint
- func GenRandomRawCheckpointWithMeta(r *rand.Rand) *types.RawCheckpointWithMeta
- func GenRandomSequenceRawCheckpointsWithMeta(r *rand.Rand) []*types.RawCheckpointWithMeta
- func GenRandomStatus(r *rand.Rand) types.CheckpointStatus
- func GenRandomTMHeader(r *rand.Rand, chainID string, height uint64) *tmproto.Header
- func GenRandomTx(r *rand.Rand) *wire.MsgTx
- func GenRandomValSet(n int) epochingtypes.ValidatorSet
- func GenRandomValidBTCHeaderInfoWithParent(r *rand.Rand, parent btclightclienttypes.BTCHeaderInfo) *btclightclienttypes.BTCHeaderInfo
- func GenRandomValidatorAddress() sdk.ValAddress
- func GenSequenceRawCheckpointsWithMeta(r *rand.Rand, tipEpoch uint64) []*types.RawCheckpointWithMeta
- func GenerateBLSSigs(keys []bls12381.PrivateKey, msg []byte) []bls12381.Signature
- func GenerateGenesisKey() *types.GenesisKey
- func GenerateLegitimateRawCheckpoint(r *rand.Rand, privKeys []bls12381.PrivateKey) *types.RawCheckpoint
- func GenerateMessageWithRandomSubmitter(blockResults []*BlockCreationResult) *btcctypes.MsgInsertBTCSpvProof
- func GenerateMessageWithRandomSubmitterForEpoch(r *rand.Rand, epoch uint64) *btcctypes.MsgInsertBTCSpvProof
- func GenerateValidatorSetWithBLSPrivKeys(n int) (*checkpointingtypes.ValidatorWithBlsKeySet, []bls12381.PrivateKey)
- func GetRandomRawBtcCheckpoint(r *rand.Rand) *btctxformatter.RawBtcCheckpoint
- func HeaderToHeaderInfo(header *ibctmtypes.Header) *extendedkeeper.HeaderInfo
- func InitializeNodeValidatorFiles(config *cfg.Config, addr sdk.AccAddress) (string, *privval.ValidatorKeys, error)
- func InitializeNodeValidatorFilesFromMnemonic(config *cfg.Config, mnemonic string, addr sdk.AccAddress) (nodeID string, valKeys *privval.ValidatorKeys, err error)
- func MutateHash(r *rand.Rand, hash *bbn.BTCHeaderHashBytes) *bbn.BTCHeaderHashBytes
- func OneInN(r *rand.Rand, n int) bool
- func RandomInt(r *rand.Rand, rng int) uint64
- func RandomIntOtherThan(r *rand.Rand, x int, rng int) uint64
- func SolveBlock(header *wire.BlockHeader) bool
- func ValidHex(hexStr string, length int) bool
- type BTCHeaderTree
- func (t *BTCHeaderTree) Add(node *blctypes.BTCHeaderInfo, parent *blctypes.BTCHeaderInfo)
- func (t *BTCHeaderTree) Contains(node *blctypes.BTCHeaderInfo) bool
- func (t *BTCHeaderTree) GenRandomBTCHeaderTree(r *rand.Rand, minHeight uint64, maxHeight uint64, ...)
- func (t *BTCHeaderTree) GetChildren(node *blctypes.BTCHeaderInfo) []*blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) GetHeadersMap() map[string]*blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) GetMainChain() []*blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) GetNodeAncestry(node *blctypes.BTCHeaderInfo) []*blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) GetNodeAncestryUpTo(node *blctypes.BTCHeaderInfo, upTo *blctypes.BTCHeaderInfo) []*blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) GetNodeDescendants(node *blctypes.BTCHeaderInfo) []*blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) GetParent(node *blctypes.BTCHeaderInfo) *blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) GetRoot() *blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) GetTip() *blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) IsOnNodeChain(node *blctypes.BTCHeaderInfo, ancestor *blctypes.BTCHeaderInfo) bool
- func (t *BTCHeaderTree) RandNumChildren(r *rand.Rand, zeroChildrenAllowed bool) int
- func (t *BTCHeaderTree) RandomAncestor(r *rand.Rand, node *blctypes.BTCHeaderInfo) *blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) RandomDescendant(r *rand.Rand, node *blctypes.BTCHeaderInfo) *blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) RandomNode(r *rand.Rand) *blctypes.BTCHeaderInfo
- func (t *BTCHeaderTree) Size() int
- type BlockCreationResult
- type BtcHeaderWithProof
- type PV
- type TestRawCheckpointData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRandomSeedsToFuzzer ¶
func BlockCreationResultToProofs ¶
func BlockCreationResultToProofs(inputs []*BlockCreationResult) []*btcctypes.BTCSpvProof
func GenRandomAccWithBalance ¶
func GenRandomAccWithBalance(n int) ([]authtypes.GenesisAccount, []banktypes.Balance)
func GenRandomBTCHeaderBits ¶
GenRandomBTCHeaderBits constructs a random uint32 corresponding to BTC header difficulty bits
func GenRandomBTCHeaderBytes ¶
func GenRandomBTCHeaderBytes(r *rand.Rand, parent *btclightclienttypes.BTCHeaderInfo, bitsBig *sdkmath.Uint) bbn.BTCHeaderBytes
GenRandomBTCHeaderBytes generates a random BTCHeaderBytes object based on randomly generated BTC header attributes If the `parent` argument is not `nil`, then the `PrevBlock` attribute of the BTC header will point to the hash of the parent and the `Timestamp` attribute will be later than the parent's `Timestamp`. If the `bitsBig` argument is not `nil`, then the `Bits` attribute of the BTC header will point to the compact form of big integer.
func GenRandomBTCHeaderInfo ¶
func GenRandomBTCHeaderInfo(r *rand.Rand) *btclightclienttypes.BTCHeaderInfo
GenRandomBTCHeaderInfo generates a random BTCHeaderInfo object
func GenRandomBTCHeaderInfoWithBits ¶
func GenRandomBTCHeaderInfoWithBits(r *rand.Rand, bits *sdkmath.Uint) *btclightclienttypes.BTCHeaderInfo
func GenRandomBTCHeaderInfoWithInvalidHeader ¶
func GenRandomBTCHeaderInfoWithInvalidHeader(r *rand.Rand, powLimit *big.Int) *btclightclienttypes.BTCHeaderInfo
func GenRandomBTCHeaderInfoWithParent ¶
func GenRandomBTCHeaderInfoWithParent(r *rand.Rand, parent *btclightclienttypes.BTCHeaderInfo) *btclightclienttypes.BTCHeaderInfo
GenRandomBTCHeaderInfoWithParent generates a random BTCHeaderInfo object in which the parent points to the `parent` parameter.
func GenRandomBTCHeaderInfoWithParentAndBits ¶
func GenRandomBTCHeaderInfoWithParentAndBits(r *rand.Rand, parent *btclightclienttypes.BTCHeaderInfo, bits *sdkmath.Uint) *btclightclienttypes.BTCHeaderInfo
GenRandomBTCHeaderInfoWithParentAndBits generates a BTCHeaderInfo object in which the `header.PrevBlock` points to the `parent` and the `Work` property points to the accumulated work (parent.Work + header.Work). Less bits as a parameter, means more difficulty.
func GenRandomBTCHeaderMerkleRoot ¶
GenRandomBTCHeaderMerkleRoot generates a random hex string corresponding to a merkle root
func GenRandomBTCHeaderNonce ¶
GenRandomBTCHeaderNonce generates a random BTC header nonce
func GenRandomBTCHeaderPrevBlock ¶
func GenRandomBTCHeaderPrevBlock(r *rand.Rand) *bbn.BTCHeaderHashBytes
GenRandomBTCHeaderPrevBlock constructs a random BTCHeaderHashBytes instance
func GenRandomBTCHeaderTimestamp ¶
GenRandomBTCHeaderTimestamp generates a random BTC header timestamp
func GenRandomBTCHeaderVersion ¶
GenRandomBTCHeaderVersion generates a random version integer
func GenRandomBTCHeight ¶
GenRandomBTCHeight returns a random uint64
func GenRandomBabylonTxPair ¶
func GenRandomBabylonTxPair(r *rand.Rand) ([]*wire.MsgTx, *btctxformatter.RawBtcCheckpoint)
func GenRandomBitmap ¶
GenRandomBitmap generates a random bitmap for the validator set It returns a random bitmap and the number of validators in the subset
func GenRandomBtcdBlock ¶
func GenRandomBtcdBlock(r *rand.Rand, numBabylonTxs int, prevHash *chainhash.Hash) (*wire.MsgBlock, *btctxformatter.RawBtcCheckpoint)
GenRandomBtcdBlock generates a random BTC block, which can include Babylon txs. Specifically, - when numBabylonTxs == 0 or numBabylonTxs > 2, it generates a BTC block with 3 random txs. - when numBabylonTxs == 1, it generates a BTC block with 2 random txs and a Babylon tx. - when numBabylonTxs == 2, it generates a BTC block with 1 random tx and 2 Babylon txs that constitute a raw BTC checkpoint. When numBabylonTxs == 2, the function will return the BTC raw checkpoint as well.
func GenRandomBtcdBlockchainWithBabylonTx ¶
func GenRandomBtcdBlockchainWithBabylonTx(r *rand.Rand, n uint64, oneTxThreshold float32, twoTxThreshold float32) ([]*wire.MsgBlock, int, []*btctxformatter.RawBtcCheckpoint)
GenRandomBtcdBlockchainWithBabylonTx generates a blockchain of `n` blocks, in which each block has some probability of including some Babylon txs Specifically, each block - has `oneTxThreshold` probability of including 1 Babylon tx that does not has any match - has `twoTxThreshold - oneTxThreshold` probability of including 2 Babylon txs that constitute a checkpoint - has `1 - twoTxThreshold` probability of including no Babylon tx
func GenRandomBtcdHash ¶
GenRandomBtcdHash generates a random hash in type `chainhash.Hash`, without any hash operations
func GenRandomBtcdHeader ¶
func GenRandomBtcdHeader(r *rand.Rand) *wire.BlockHeader
func GenRandomEpoch ¶
func GenRandomEpoch(r *rand.Rand) *epochingtypes.Epoch
func GenRandomEpochInterval ¶
func GenRandomEpochNum ¶
func GenRandomIBCTMHeader ¶
func GenRandomLastCommitHash ¶
func GenRandomLastCommitHash(r *rand.Rand) types.LastCommitHash
func GenRandomPubkeysAndSigs ¶
func GenRandomRawCheckpoint ¶
func GenRandomRawCheckpoint(r *rand.Rand) *types.RawCheckpoint
func GenRandomRawCheckpointWithMeta ¶
func GenRandomRawCheckpointWithMeta(r *rand.Rand) *types.RawCheckpointWithMeta
func GenRandomSequenceRawCheckpointsWithMeta ¶
func GenRandomSequenceRawCheckpointsWithMeta(r *rand.Rand) []*types.RawCheckpointWithMeta
GenRandomSequenceRawCheckpointsWithMeta generates random checkpoints from epoch 0 to a random epoch
func GenRandomStatus ¶
func GenRandomStatus(r *rand.Rand) types.CheckpointStatus
GenRandomStatus generates random status except for Finalized
func GenRandomTMHeader ¶
func GenRandomValSet ¶
func GenRandomValSet(n int) epochingtypes.ValidatorSet
func GenRandomValidBTCHeaderInfoWithParent ¶
func GenRandomValidBTCHeaderInfoWithParent(r *rand.Rand, parent btclightclienttypes.BTCHeaderInfo) *btclightclienttypes.BTCHeaderInfo
GenRandomValidBTCHeaderInfoWithParent generates random BTCHeaderInfo object with valid proof of work. WARNING: if parent is from network with a lot of work (mainnet) it may never finish use only with simnet headers
func GenRandomValidatorAddress ¶ added in v0.6.0
func GenRandomValidatorAddress() sdk.ValAddress
func GenSequenceRawCheckpointsWithMeta ¶
func GenSequenceRawCheckpointsWithMeta(r *rand.Rand, tipEpoch uint64) []*types.RawCheckpointWithMeta
func GenerateBLSSigs ¶
func GenerateBLSSigs(keys []bls12381.PrivateKey, msg []byte) []bls12381.Signature
func GenerateGenesisKey ¶
func GenerateGenesisKey() *types.GenesisKey
func GenerateLegitimateRawCheckpoint ¶
func GenerateLegitimateRawCheckpoint(r *rand.Rand, privKeys []bls12381.PrivateKey) *types.RawCheckpoint
func GenerateMessageWithRandomSubmitter ¶
func GenerateMessageWithRandomSubmitter(blockResults []*BlockCreationResult) *btcctypes.MsgInsertBTCSpvProof
func GenerateMessageWithRandomSubmitterForEpoch ¶
func GenerateMessageWithRandomSubmitterForEpoch(r *rand.Rand, epoch uint64) *btcctypes.MsgInsertBTCSpvProof
func GenerateValidatorSetWithBLSPrivKeys ¶
func GenerateValidatorSetWithBLSPrivKeys(n int) (*checkpointingtypes.ValidatorWithBlsKeySet, []bls12381.PrivateKey)
func GetRandomRawBtcCheckpoint ¶
func GetRandomRawBtcCheckpoint(r *rand.Rand) *btctxformatter.RawBtcCheckpoint
func HeaderToHeaderInfo ¶ added in v0.6.0
func HeaderToHeaderInfo(header *ibctmtypes.Header) *extendedkeeper.HeaderInfo
func InitializeNodeValidatorFiles ¶
func InitializeNodeValidatorFiles(config *cfg.Config, addr sdk.AccAddress) (string, *privval.ValidatorKeys, error)
InitializeNodeValidatorFiles creates private validator and p2p configuration files.
func InitializeNodeValidatorFilesFromMnemonic ¶
func InitializeNodeValidatorFilesFromMnemonic(config *cfg.Config, mnemonic string, addr sdk.AccAddress) (nodeID string, valKeys *privval.ValidatorKeys, err error)
func MutateHash ¶
func MutateHash(r *rand.Rand, hash *bbn.BTCHeaderHashBytes) *bbn.BTCHeaderHashBytes
MutateHash takes a hash as a parameter, copies it, modifies the copy, and returns the copy.
func SolveBlock ¶
func SolveBlock(header *wire.BlockHeader) bool
SolveBlock mutates provided header.Nonce, until it solves proof of work puzzle WARNING: providing header with too large difficulty (header.Bits) will make this function unfinishable.
Types ¶
type BTCHeaderTree ¶
type BTCHeaderTree struct {
// contains filtered or unexported fields
}
func NewBTCHeaderTree ¶
func NewBTCHeaderTree() *BTCHeaderTree
func (*BTCHeaderTree) Add ¶
func (t *BTCHeaderTree) Add(node *blctypes.BTCHeaderInfo, parent *blctypes.BTCHeaderInfo)
Add adds a node into storage. If the `parent` is set, it is also added to the list of `parent`.
func (*BTCHeaderTree) Contains ¶
func (t *BTCHeaderTree) Contains(node *blctypes.BTCHeaderInfo) bool
Contains checks whether a node is maintained in the internal storage
func (*BTCHeaderTree) GenRandomBTCHeaderTree ¶
func (t *BTCHeaderTree) GenRandomBTCHeaderTree(r *rand.Rand, minHeight uint64, maxHeight uint64, parent *blctypes.BTCHeaderInfo, callback func(info *blctypes.BTCHeaderInfo) bool)
GenRandomBTCHeaderTree recursively generates a random tree of BTCHeaderInfo objects rooted at `parent`. The tree generation is accomplished by randomly selecting the number of children using the `RandNumChildren()`. Then, for each child, a random BTCHeaderInfo object is generated and a new tree rooted at that child is recursively generated. For each node that is generated, the callback function is invoked in order to identify whether we should continue generating or not as well as help with maintenance tasks (e.g. inserting headers into keeper storage).
func (*BTCHeaderTree) GetChildren ¶
func (t *BTCHeaderTree) GetChildren(node *blctypes.BTCHeaderInfo) []*blctypes.BTCHeaderInfo
GetChildren returns the children of a node as a list of BTCHeaderInfo objects
func (*BTCHeaderTree) GetHeadersMap ¶
func (t *BTCHeaderTree) GetHeadersMap() map[string]*blctypes.BTCHeaderInfo
GetHeadersMap returns a mapping between node hashes and nodes
func (*BTCHeaderTree) GetMainChain ¶
func (t *BTCHeaderTree) GetMainChain() []*blctypes.BTCHeaderInfo
GetMainChain returns the tree fork with the most work
func (*BTCHeaderTree) GetNodeAncestry ¶
func (t *BTCHeaderTree) GetNodeAncestry(node *blctypes.BTCHeaderInfo) []*blctypes.BTCHeaderInfo
GetNodeAncestry returns an ancestry list starting from the tree node and leading to the root of the tree.
func (*BTCHeaderTree) GetNodeAncestryUpTo ¶
func (t *BTCHeaderTree) GetNodeAncestryUpTo(node *blctypes.BTCHeaderInfo, upTo *blctypes.BTCHeaderInfo) []*blctypes.BTCHeaderInfo
GetNodeAncestryUpTo returns an ancestry list starting from the tree node and leading to a child of the `upTo` parameter if it is not nil.
func (*BTCHeaderTree) GetNodeDescendants ¶
func (t *BTCHeaderTree) GetNodeDescendants(node *blctypes.BTCHeaderInfo) []*blctypes.BTCHeaderInfo
GetNodeDescendants returns a list of the descendants of a node
func (*BTCHeaderTree) GetParent ¶
func (t *BTCHeaderTree) GetParent(node *blctypes.BTCHeaderInfo) *blctypes.BTCHeaderInfo
GetParent returns the parent of the node, or nil if it doesn't exist
func (*BTCHeaderTree) GetRoot ¶
func (t *BTCHeaderTree) GetRoot() *blctypes.BTCHeaderInfo
GetRoot returns the root of the tree -- i.e. the node without an existing parent
func (*BTCHeaderTree) GetTip ¶
func (t *BTCHeaderTree) GetTip() *blctypes.BTCHeaderInfo
GetTip returns the header in the tree with the most work
func (*BTCHeaderTree) IsOnNodeChain ¶
func (t *BTCHeaderTree) IsOnNodeChain(node *blctypes.BTCHeaderInfo, ancestor *blctypes.BTCHeaderInfo) bool
IsOnNodeChain returns true or false depending on whether the node is equal or a descendant of the `ancestor` parameter.
func (*BTCHeaderTree) RandNumChildren ¶
func (t *BTCHeaderTree) RandNumChildren(r *rand.Rand, zeroChildrenAllowed bool) int
RandNumChildren randomly generates 0-2 children with the following probabilities: If zeroChildrenAllowed is not set:
1 child: 75% 2 children: 25%
Otherwise,
0 children: 25% 1 child: 50% 2 children: 25%
func (*BTCHeaderTree) RandomAncestor ¶
func (t *BTCHeaderTree) RandomAncestor(r *rand.Rand, node *blctypes.BTCHeaderInfo) *blctypes.BTCHeaderInfo
RandomAncestor retrieves the ancestry list and returns an ancestor from it. Can include the node itself.
func (*BTCHeaderTree) RandomDescendant ¶
func (t *BTCHeaderTree) RandomDescendant(r *rand.Rand, node *blctypes.BTCHeaderInfo) *blctypes.BTCHeaderInfo
RandomDescendant returns a random descendant of the node
func (*BTCHeaderTree) RandomNode ¶
func (t *BTCHeaderTree) RandomNode(r *rand.Rand) *blctypes.BTCHeaderInfo
RandomNode selects a random header from the list of nodes
func (*BTCHeaderTree) Size ¶
func (t *BTCHeaderTree) Size() int
Size returns the number of nodes that are maintained
type BlockCreationResult ¶
type BlockCreationResult struct {
HeaderBytes bbn.BTCHeaderBytes
Transactions []string
BbnTxIndex uint32
}
func CreateBlock ¶
type BtcHeaderWithProof ¶
type BtcHeaderWithProof struct {
HeaderBytes bbn.BTCHeaderBytes
SpvProof *btcctypes.BTCSpvProof
}
func CreateBlockWithTransaction ¶
func CreateBlockWithTransaction( r *rand.Rand, ph *wire.BlockHeader, babylonData []byte, ) *BtcHeaderWithProof
type PV ¶
type PV struct {
PrivKey cryptotypes.PrivKey
}
PV implements PrivValidator without any safety or persistence. Only use it for testing.
func (PV) SignProposal ¶
SignProposal implements PrivValidator interface
type TestRawCheckpointData ¶
type TestRawCheckpointData struct {
Epoch uint64
FirstPart []byte
SecondPart []byte
ExpectedOpReturn []byte
}
func EncodeRawCkptToTestData ¶
func EncodeRawCkptToTestData(rawBTCCkpt *txformat.RawBtcCheckpoint) *TestRawCheckpointData
func RandomRawCheckpointDataForEpoch ¶
func RandomRawCheckpointDataForEpoch(r *rand.Rand, e uint64) (*TestRawCheckpointData, *txformat.RawBtcCheckpoint)