v39

package
v0.11.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "oracle"

Variables

View Source
var StatusTextToString = [...]string{"pending", "success", "failed"}
View Source
var StringToStatusText = map[string]StatusText{
	"pending": PendingStatusText,
	"success": SuccessStatusText,
	"failed":  FailedStatusText,
}

Functions

This section is empty.

Types

type DBProphecy

type DBProphecy struct {
	ID              string `json:"id"`
	Status          Status `json:"status"`
	ClaimValidators []byte `json:"claim_validators"`
	ValidatorClaims []byte `json:"validator_claims"`
}

DBProphecy is what the prophecy becomes when being saved to the database.

Tendermint/Amino does not support maps so we must serialize those variables into bytes.

type GenesisState

type GenesisState struct {
	AddressWhitelist []sdk.ValAddress `json:"address_whitelist"`
	AdminAddress     sdk.AccAddress   `json:"admin_address"`
	Prophecies       []DBProphecy     `json:"prophecies"`
}

type Prophecy

type Prophecy struct {
	ID     string `json:"id"`
	Status Status `json:"status"`

	//This is a mapping from a claim to the list of validators that made that claim.
	ClaimValidators map[string][]sdk.ValAddress `json:"claim_validators"`
	//This is a mapping from a validator bech32 address to their claim
	ValidatorClaims map[string]string `json:"validator_claims"`
}

type Status

type Status struct {
	Text       StatusText `json:"text"`
	FinalClaim string     `json:"final_claim"`
}

type StatusText

type StatusText int
const (
	PendingStatusText StatusText = iota
	SuccessStatusText
	FailedStatusText
)

func (StatusText) MarshalJSON

func (text StatusText) MarshalJSON() ([]byte, error)

func (StatusText) String

func (text StatusText) String() string

func (*StatusText) UnmarshalJSON

func (text *StatusText) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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