testutils

package
v0.1.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBaseSDKContext

func CreateBaseSDKContext(t *testing.T) sdk.Context

CreateBaseSDKContext creates a base sdk context with the default store key and transient key.

func CreateBaseSDKContextWithKeys

func CreateBaseSDKContextWithKeys(t *testing.T, storekey storetypes.StoreKey, transientkey *storetypes.TransientStoreKey) sdk.Context

CreateBaseSDKContextWithKeys creates a base sdk context with the given store key and transient key.

func CreateExtendedCommitInfo

func CreateExtendedCommitInfo(commitInfo []cometabci.ExtendedVoteInfo, codec compression.ExtendedCommitCodec) (cometabci.ExtendedCommitInfo, []byte, error)

CreateExtendedCommitInfo creates an extended commit info with the given commit info.

func CreateExtendedVoteInfo

func CreateExtendedVoteInfo(
	consAddr sdk.ConsAddress,
	prices map[uint64][]byte,
	codec compression.VoteExtensionCodec,
) (cometabci.ExtendedVoteInfo, error)

CreateExtendedVoteInfo creates an extended vote info with the given prices, timestamp and height.

func CreateTestOracleKeeperWithGenesis

func CreateTestOracleKeeperWithGenesis(ctx sdk.Context, key *storetypes.KVStoreKey, genesis oracletypes.GenesisState) keeper.Keeper

CreateTestOracleKeeperWithGenesis creates a test oracle keeper with the given genesis state.

func CreateVoteExtension

func CreateVoteExtension(
	prices map[uint64][]byte,
) types.OracleVoteExtension

CreateVoteExtension creates a vote extension with the given prices, timestamp and height.

func CreateVoteExtensionBytes

func CreateVoteExtensionBytes(
	prices map[uint64][]byte,
	codec compression.VoteExtensionCodec,
) ([]byte, error)

CreateVoteExtensionBytes creates a vote extension bytes with the given prices, timestamp and height.

func UpdateContextWithVEHeight

func UpdateContextWithVEHeight(ctx sdk.Context, height int64) sdk.Context

UpdateContextWithVEHeight updates the context with the given height and enables vote extensions for the given height.

Types

This section is empty.

Jump to

Keyboard shortcuts

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