Documentation ¶
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, k Keeper) (resTags sdk.Tags)
- func ErrNotEnoughVotes(codespace sdk.CodespaceType) sdk.Error
- func ErrNotValidator(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
- func ErrWrongDenomination(codespace sdk.CodespaceType, denom string) sdk.Error
- func GetElectKey(denom string) []byte
- func GetVoteKey(denom string, voter sdk.AccAddress) []byte
- func GetVotePrefix(denom string) []byte
- func NewEndBlocker(k Keeper) sdk.EndBlocker
- func NewHandler(k Keeper) sdk.Handler
- type Keeper
- type PriceFeedMsg
- type PriceVote
- type PriceVotes
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = "ORA" CodeNotValidator sdk.CodeType = 1 CodeNotEnoughVotes sdk.CodeType = 2 CodeUnknownRequest sdk.CodeType = sdk.CodeUnknownRequest )
Oracle errors reserve 1101-1199
Variables ¶
var ( PrefixVote = []byte{0x00} PrefixElect = []byte{0x01} )
nolint
Functions ¶
func ErrNotEnoughVotes ¶
func ErrNotEnoughVotes(codespace sdk.CodespaceType) sdk.Error
ErrAlreadyProcessed called when a payload is already processed
func ErrNotValidator ¶
func ErrNotValidator(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error
ErrNotValidator called when the signer of a Msg is not a validator
func ErrWrongDenomination ¶
func ErrWrongDenomination(codespace sdk.CodespaceType, denom string) sdk.Error
ErrWrongDenomination called when the signer of a Msg is not a validator
func GetElectKey ¶
GetElectKey is in format of PrefixElect||denom
func GetVoteKey ¶
func GetVoteKey(denom string, voter sdk.AccAddress) []byte
GetVoteKey Key is in format of PrefixVote||denom||voter.AccAddress
func GetVotePrefix ¶
GetVotePrefix is in format of prefix||denom
func NewEndBlocker ¶
func NewEndBlocker(k Keeper) sdk.EndBlocker
NewEndBlocker checks proposals and generates a EndBlocker
func NewHandler ¶
NewHandler returns a handler for "bank" type messages.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the oracle store
func NewKeeper ¶
func NewKeeper(key sdk.StoreKey, cdc *codec.Codec, valset sdk.ValidatorSet, supermajority sdk.Dec, timeout int64) Keeper
NewKeeper constructs a new keeper
type PriceFeedMsg ¶
type PriceFeedMsg struct { Denom string Price sdk.Dec Feeder sdk.AccAddress }
PriceFeedMsg - struct for voting on payloads
func NewPriceFeedMsg ¶
func NewPriceFeedMsg(denom string, price sdk.Dec, feederAddress sdk.AccAddress) PriceFeedMsg
NewPriceFeedMsg creates a PriceFeedMsg instance
func (PriceFeedMsg) GetSignBytes ¶
func (msg PriceFeedMsg) GetSignBytes() []byte
GetSignBytes implements sdk.Msg
func (PriceFeedMsg) GetSigners ¶
func (msg PriceFeedMsg) GetSigners() []sdk.AccAddress
GetSigners implements sdk.Msg
func (PriceFeedMsg) ValidateBasic ¶
func (msg PriceFeedMsg) ValidateBasic() sdk.Error
ValidateBasic Implements sdk.Msg
type PriceVote ¶
PriceVote - struct to store a validator's vote on the price
func NewPriceVote ¶
func NewPriceVote(feedMsg PriceFeedMsg, power sdk.Dec) PriceVote
NewPriceVote creates a PriceVote instance
type PriceVotes ¶
type PriceVotes []PriceVote
PriceVotes are a collection of Price Votes
func (PriceVotes) Len ¶
func (pv PriceVotes) Len() int
func (PriceVotes) Less ¶
func (pv PriceVotes) Less(i, j int) bool
func (PriceVotes) Swap ¶
func (pv PriceVotes) Swap(i, j int)