keeper

package
v0.0.0-...-1ebabd0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestID                     = "oracleID"
	AlternateTestID            = "altOracleID"
	TestString                 = "{value: 5}"
	AlternateTestString        = "{value: 7}"
	AnotherAlternateTestString = "{value: 9}"
)

Variables

This section is empty.

Functions

func CreateTestAddrs

func CreateTestAddrs(numAddrs int) ([]sdk.AccAddress, []sdk.ValAddress)

nolint: unparam

func CreateTestPubKeys

func CreateTestPubKeys(numPubKeys int) []crypto.PubKey

nolint: unparam

func MakeTestCodec

func MakeTestCodec() *codec.Codec

create a codec used only for testing

func NewPubKey

func NewPubKey(pk string) (res crypto.PubKey)

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func CreateTestKeepers

func CreateTestKeepers(t *testing.T, consensusNeeded float64, validatorAmounts []int64, extraMaccPerm string) (
	sdk.Context, Keeper, bank.Keeper, supply.Keeper, auth.AccountKeeper, []sdk.ValAddress)

CreateTestKeepers greates an Mock App, OracleKeeper, BankKeeper and ValidatorAddresses to be used for test input

func NewKeeper

func NewKeeper(
	cdc *codec.Codec, storeKey sdk.StoreKey, stakeKeeper types.StakingKeeper, consensusNeeded float64,
) Keeper

NewKeeper creates new instances of the oracle Keeper

func (Keeper) GetProphecy

func (k Keeper) GetProphecy(ctx sdk.Context, id string) (types.Prophecy, bool)

GetProphecy gets the entire prophecy data struct for a given id

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) ProcessClaim

func (k Keeper) ProcessClaim(ctx sdk.Context, claim types.Claim) (types.Status, error)

ProcessClaim ...

Jump to

Keyboard shortcuts

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