crypto

package
v3.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorruptCommitSigsInHeader added in v3.3.0

func CorruptCommitSigsInHeader(header *ibctmtypes.Header, valAddress bytes.HexBytes)

CorruptCommitSigsInHeader corrupts the header by changing the value of the commit signature for given validator address. Note that this method is solely used for testing purposes

func CorruptValidatorPubkeyInHeader added in v3.3.0

func CorruptValidatorPubkeyInHeader(header *ibctmtypes.Header, valAddress bytes.HexBytes)

CorruptValidatorPubkeyInHeader corrupts the header by changing the validator pubkey of the given validator address in the validator set. Note that this method is solely used for testing purposes

func MakeAndSignVote added in v3.3.0

func MakeAndSignVote(
	blockID tmtypes.BlockID,
	blockHeight int64,
	blockTime time.Time,
	valSet *tmtypes.ValidatorSet,
	signer tmtypes.PrivValidator,
	chainID string,
) *tmtypes.Vote

func MakeAndSignVoteWithForgedValAddress added in v3.3.0

func MakeAndSignVoteWithForgedValAddress(
	blockID tmtypes.BlockID,
	blockHeight int64,
	blockTime time.Time,
	valSet *tmtypes.ValidatorSet,
	signer tmtypes.PrivValidator,
	valAddressSigner tmtypes.PrivValidator,
	chainID string,
) *tmtypes.Vote

MakeAndSignVoteWithForgedValAddress makes and signs a vote using two different keys: one to derive the validator address in the vote and a second to sign it.

func MakeBlockID added in v3.3.0

func MakeBlockID(hash []byte, partSetSize uint32, partSetHash []byte) tmtypes.BlockID

utility function duplicated from CometBFT see https://github.com/cometbft/cometbft/blob/main/evidence/verify_test.go#L554

Types

type CryptoIdentity

type CryptoIdentity struct {
	// contains filtered or unexported fields
}

CryptoIdentity is a test helper for generating keys and addresses of various interfaces and types used by the SDK and Tendermint from a single 'root' seed.

func GenMultipleCryptoIds

func GenMultipleCryptoIds(num, fromIntSeed int) []*CryptoIdentity

GenMultipleCryptoIds generates and returns multiple CryptoIdentities from a starting int seed.

func NewCryptoIdentityFromBytesSeed

func NewCryptoIdentityFromBytesSeed(seed []byte) *CryptoIdentity

func NewCryptoIdentityFromIntSeed

func NewCryptoIdentityFromIntSeed(i int) *CryptoIdentity

func (*CryptoIdentity) ConsensusSDKPubKey

func (v *CryptoIdentity) ConsensusSDKPubKey() sdkcryptotypes.PubKey

func (*CryptoIdentity) ConsumerConsAddress

func (v *CryptoIdentity) ConsumerConsAddress() providertypes.ConsumerConsAddress

Returns the cons address of the crypto identity as a ConsumerConsAddress. In most cases, one crypto identity should NOT be casted to both a ProviderConsAddress and ConsumerConsAddress. However, test intention is left to the caller.

func (*CryptoIdentity) OperatorSDKPubKey

func (v *CryptoIdentity) OperatorSDKPubKey() sdkcryptotypes.PubKey

func (*CryptoIdentity) ProviderConsAddress

func (v *CryptoIdentity) ProviderConsAddress() providertypes.ProviderConsAddress

Returns the cons address of the crypto identity as a ProviderConsAddress. In most cases, one crypto identity should NOT be casted to both a ProviderConsAddress and ConsumerConsAddress. However, test intention is left to the caller.

func (*CryptoIdentity) SDKStakingValidator

func (v *CryptoIdentity) SDKStakingValidator() sdkstakingtypes.Validator

func (*CryptoIdentity) SDKValConsAddress

func (v *CryptoIdentity) SDKValConsAddress() sdktypes.ConsAddress

func (*CryptoIdentity) SDKValOpAddress

func (v *CryptoIdentity) SDKValOpAddress() sdktypes.ValAddress

func (*CryptoIdentity) TMCryptoPubKey

func (v *CryptoIdentity) TMCryptoPubKey() tmcrypto.PubKey

func (*CryptoIdentity) TMProtoCryptoPublicKey

func (v *CryptoIdentity) TMProtoCryptoPublicKey() tmprotocrypto.PublicKey

func (*CryptoIdentity) TMValidator

func (v *CryptoIdentity) TMValidator(power int64) *tmtypes.Validator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL