types

package
v2.2.0-testnet Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the module.
	ModuleName = "oracle"

	// Version defines the current version the IBC oracle module supports
	Version = "bandchain-1"

	// StoreKey to be used when creating the KVStore.
	StoreKey = ModuleName

	// QuerierRoute is the querier route for the oracle module
	QuerierRoute = ModuleName

	// RouterKey is the msg router key for the oracle module
	RouterKey = ModuleName

	// PortID is the default port id that oracle module binds to.
	PortID = ModuleName
)

Variables

View Source
var (
	ErrOwasmCompilation         = sdkerrors.Register(ModuleName, 1, "owasm compilation failed")
	ErrBadWasmExecution         = sdkerrors.Register(ModuleName, 2, "bad wasm execution")
	ErrDataSourceNotFound       = sdkerrors.Register(ModuleName, 3, "data source not found")
	ErrOracleScriptNotFound     = sdkerrors.Register(ModuleName, 4, "oracle script not found")
	ErrRequestNotFound          = sdkerrors.Register(ModuleName, 5, "request not found")
	ErrRawRequestNotFound       = sdkerrors.Register(ModuleName, 6, "raw request not found")
	ErrReporterNotFound         = sdkerrors.Register(ModuleName, 7, "reporter not found")
	ErrResultNotFound           = sdkerrors.Register(ModuleName, 8, "result not found")
	ErrReporterAlreadyExists    = sdkerrors.Register(ModuleName, 9, "reporter already exists")
	ErrValidatorNotRequested    = sdkerrors.Register(ModuleName, 10, "validator not requested")
	ErrValidatorAlreadyReported = sdkerrors.Register(ModuleName, 11, "validator already reported")
	ErrInvalidReportSize        = sdkerrors.Register(ModuleName, 12, "invalid report size")
	ErrReporterNotAuthorized    = sdkerrors.Register(ModuleName, 13, "reporter not authorized")
	ErrEditorNotAuthorized      = sdkerrors.Register(ModuleName, 14, "editor not authorized")
	ErrValidatorAlreadyActive   = sdkerrors.Register(ModuleName, 16, "validator already active")
	ErrTooSoonToActivate        = sdkerrors.Register(ModuleName, 17, "too soon to activate")
	ErrTooLongName              = sdkerrors.Register(ModuleName, 18, "too long name")
	ErrTooLongDescription       = sdkerrors.Register(ModuleName, 19, "too long description")
	ErrEmptyExecutable          = sdkerrors.Register(ModuleName, 20, "empty executable")
	ErrEmptyWasmCode            = sdkerrors.Register(ModuleName, 21, "empty wasm code")
	ErrTooLargeExecutable       = sdkerrors.Register(ModuleName, 22, "too large executable")
	ErrTooLargeWasmCode         = sdkerrors.Register(ModuleName, 23, "too large wasm code")
	ErrInvalidMinCount          = sdkerrors.Register(ModuleName, 24, "invalid min count")
	ErrInvalidAskCount          = sdkerrors.Register(ModuleName, 25, "invalid ask count")
	ErrTooLargeCalldata         = sdkerrors.Register(ModuleName, 26, "too large calldata")
	ErrTooLongClientID          = sdkerrors.Register(ModuleName, 27, "too long client id")
	ErrEmptyRawRequests         = sdkerrors.Register(ModuleName, 28, "empty raw requests")
	ErrEmptyReport              = sdkerrors.Register(ModuleName, 29, "empty report")
	ErrDuplicateExternalID      = sdkerrors.Register(ModuleName, 30, "duplicate external id")
	ErrTooLongSchema            = sdkerrors.Register(ModuleName, 31, "too long schema")
	ErrTooLongURL               = sdkerrors.Register(ModuleName, 32, "too long url")
	ErrTooLargeRawReportData    = sdkerrors.Register(ModuleName, 33, "too large raw report data")
	ErrInsufficientValidators   = sdkerrors.Register(ModuleName, 34, "insufficient available validators")
	ErrCreateWithDoNotModify    = sdkerrors.Register(ModuleName, 35, "cannot create with [do-not-modify] content")
	ErrSelfReferenceAsReporter  = sdkerrors.Register(ModuleName, 36, "cannot reference self as reporter")
	ErrOBIDecode                = sdkerrors.Register(ModuleName, 37, "obi decode failed")
	ErrUncompressionFailed      = sdkerrors.Register(ModuleName, 38, "uncompression failed")
	ErrRequestAlreadyExpired    = sdkerrors.Register(ModuleName, 39, "request already expired")
	ErrBadDrbgInitialization    = sdkerrors.Register(ModuleName, 40, "bad drbg initialization")
	ErrMaxOracleChannels        = sdkerrors.Register(ModuleName, 41, "max oracle channels")
	ErrInvalidVersion           = sdkerrors.Register(ModuleName, 42, "invalid ICS20 version")
	ErrNotEnoughFee             = sdkerrors.Register(ModuleName, 43, "not enough fee")
	ErrInvalidOwasmGas          = sdkerrors.Register(ModuleName, 44, "invalid owasm gas")
	ErrIBCRequestDisabled       = sdkerrors.Register(ModuleName, 45, "sending oracle request via IBC is disabled")
)
View Source
var (
	// RollingSeedSizeInBytes is the size of rolling block hash for random seed.
	RollingSeedSizeInBytes = 32
	// GlobalStoreKeyPrefix is the prefix for global primitive state variables.
	GlobalStoreKeyPrefix = []byte{0x00}
	// RollingSeedStoreKey is the key that keeps the seed based on the first 8-bit of the most recent 32 block hashes.
	RollingSeedStoreKey = append(GlobalStoreKeyPrefix, []byte("RollingSeed")...)
	// RequestCountStoreKey is the key that keeps the total request count.
	RequestCountStoreKey = append(GlobalStoreKeyPrefix, []byte("RequestCount")...)
	// RequestLastExpiredStoreKey is the key that keeps the ID of the last expired request, or 0 if none.
	RequestLastExpiredStoreKey = append(GlobalStoreKeyPrefix, []byte("RequestLastExpired")...)
	// PendingResolveListStoreKey is the key that keeps the list of pending-resolve requests.
	PendingResolveListStoreKey = append(GlobalStoreKeyPrefix, []byte("PendingList")...)
	// DataSourceCountStoreKey is the key that keeps the total data source count.
	DataSourceCountStoreKey = append(GlobalStoreKeyPrefix, []byte("DataSourceCount")...)
	// OracleScriptCountStoreKey is the key that keeps the total oracle sciprt count.
	OracleScriptCountStoreKey = append(GlobalStoreKeyPrefix, []byte("OracleScriptCount")...)

	// RequestStoreKeyPrefix is the prefix for request store.
	RequestStoreKeyPrefix = []byte{0x01}
	// ReportStoreKeyPrefix is the prefix for report store.
	ReportStoreKeyPrefix = []byte{0x02}
	// DataSourceStoreKeyPrefix is the prefix for data source store.
	DataSourceStoreKeyPrefix = []byte{0x03}
	// OracleScriptStoreKeyPrefix is the prefix for oracle script store.
	OracleScriptStoreKeyPrefix = []byte{0x04}
	// ValidatorStatusKeyPrefix is the prefix for validator status store.
	ValidatorStatusKeyPrefix = []byte{0x05}
	// ResultStoreKeyPrefix is the prefix for request result store.
	ResultStoreKeyPrefix = []byte{0xff}

	// PortKey defines the key to store the port ID in store
	PortKey = []byte{0xf0}
)
View Source
var (
	ErrInvalidLengthOracle        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOracle          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupOracle = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// ModuleCdc references the global x/oracle module codec. Note, the codec
	// should ONLY be used in certain instances of tests and for JSON encoding.
	//
	// The actual codec used for serialization should be provided to x/oracle and
	// defined at the application level.
	ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
)
View Source
var ResolveStatus_name = map[int32]string{
	0: "RESOLVE_STATUS_OPEN_UNSPECIFIED",
	1: "RESOLVE_STATUS_SUCCESS",
	2: "RESOLVE_STATUS_FAILURE",
	3: "RESOLVE_STATUS_EXPIRED",
}
View Source
var ResolveStatus_value = map[string]int32{
	"RESOLVE_STATUS_OPEN_UNSPECIFIED": 0,
	"RESOLVE_STATUS_SUCCESS":          1,
	"RESOLVE_STATUS_FAILURE":          2,
	"RESOLVE_STATUS_EXPIRED":          3,
}

Functions

func DataSourceStoreKey

func DataSourceStoreKey(dataSourceID DataSourceID) []byte

DataSourceStoreKey returns the key to retrieve a specific data source from the store.

func OracleScriptStoreKey

func OracleScriptStoreKey(oracleScriptID OracleScriptID) []byte

OracleScriptStoreKey returns the key to retrieve a specific oracle script from the store.

func ReportStoreKey

func ReportStoreKey(requestID RequestID) []byte

ReportStoreKey returns the key to retrieve all data reports for a request.

func ReportsOfValidatorPrefixKey

func ReportsOfValidatorPrefixKey(reqID RequestID, val sdk.ValAddress) []byte

ReportsOfValidatorPrefixKey returns the prefix key to get all reports for a request from a validator.

func RequestStoreKey

func RequestStoreKey(requestID RequestID) []byte

RequestStoreKey returns the key to retrieve a specific request from the store.

func ResultStoreKey

func ResultStoreKey(requestID RequestID) []byte

ResultStoreKey returns the key to a request result in the store.

func ValidatorStatusStoreKey

func ValidatorStatusStoreKey(v sdk.ValAddress) []byte

ValidatorStatusStoreKey returns the key to a validator's status.

func WrapMaxError

func WrapMaxError(err error, got int, max int) error

WrapMaxError wraps an error message with additional info of the current and max values.

Types

type ActiveValidator

type ActiveValidator struct {
	// Address is a validator address
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	// Power is an amount of token that the validator is holding
	Power uint64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"`
}

ActiveValidator is information of currently active validator

func (*ActiveValidator) Descriptor

func (*ActiveValidator) Descriptor() ([]byte, []int)

func (*ActiveValidator) GetAddress

func (m *ActiveValidator) GetAddress() string

func (*ActiveValidator) GetPower

func (m *ActiveValidator) GetPower() uint64

func (*ActiveValidator) Marshal

func (m *ActiveValidator) Marshal() (dAtA []byte, err error)

func (*ActiveValidator) MarshalTo

func (m *ActiveValidator) MarshalTo(dAtA []byte) (int, error)

func (*ActiveValidator) MarshalToSizedBuffer

func (m *ActiveValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ActiveValidator) ProtoMessage

func (*ActiveValidator) ProtoMessage()

func (*ActiveValidator) Reset

func (m *ActiveValidator) Reset()

func (*ActiveValidator) Size

func (m *ActiveValidator) Size() (n int)

func (*ActiveValidator) String

func (m *ActiveValidator) String() string

func (*ActiveValidator) Unmarshal

func (m *ActiveValidator) Unmarshal(dAtA []byte) error

func (*ActiveValidator) XXX_DiscardUnknown

func (m *ActiveValidator) XXX_DiscardUnknown()

func (*ActiveValidator) XXX_Marshal

func (m *ActiveValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ActiveValidator) XXX_Merge

func (m *ActiveValidator) XXX_Merge(src proto.Message)

func (*ActiveValidator) XXX_Size

func (m *ActiveValidator) XXX_Size() int

func (*ActiveValidator) XXX_Unmarshal

func (m *ActiveValidator) XXX_Unmarshal(b []byte) error

type DataSource

type DataSource struct {
	// Owner is an address of the account who own the data source
	Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// Name is data source name used for display
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Description is data source description used for display
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Filename is string of file name used as reference for locating
	// data source file stored in bandchain nodes
	Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"`
	// Treasury is the account address who receive data source fee from requester.
	Treasury string `protobuf:"bytes,5,opt,name=treasury,proto3" json:"treasury,omitempty"`
	// Fee is the data source fee per ask_count that data provider will receive
	// from requester.
	Fee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=fee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"fee"`
}

DataSource is the data structure for storing data sources in the storage.

func (*DataSource) Descriptor

func (*DataSource) Descriptor() ([]byte, []int)

func (*DataSource) Equal

func (this *DataSource) Equal(that interface{}) bool

func (*DataSource) GetDescription

func (m *DataSource) GetDescription() string

func (*DataSource) GetFee

func (*DataSource) GetFilename

func (m *DataSource) GetFilename() string

func (*DataSource) GetName

func (m *DataSource) GetName() string

func (*DataSource) GetOwner

func (m *DataSource) GetOwner() string

func (*DataSource) GetTreasury

func (m *DataSource) GetTreasury() string

func (*DataSource) Marshal

func (m *DataSource) Marshal() (dAtA []byte, err error)

func (*DataSource) MarshalTo

func (m *DataSource) MarshalTo(dAtA []byte) (int, error)

func (*DataSource) MarshalToSizedBuffer

func (m *DataSource) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DataSource) ProtoMessage

func (*DataSource) ProtoMessage()

func (*DataSource) Reset

func (m *DataSource) Reset()

func (*DataSource) Size

func (m *DataSource) Size() (n int)

func (*DataSource) String

func (m *DataSource) String() string

func (*DataSource) Unmarshal

func (m *DataSource) Unmarshal(dAtA []byte) error

func (*DataSource) XXX_DiscardUnknown

func (m *DataSource) XXX_DiscardUnknown()

func (*DataSource) XXX_Marshal

func (m *DataSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DataSource) XXX_Merge

func (m *DataSource) XXX_Merge(src proto.Message)

func (*DataSource) XXX_Size

func (m *DataSource) XXX_Size() int

func (*DataSource) XXX_Unmarshal

func (m *DataSource) XXX_Unmarshal(b []byte) error

type DataSourceID

type DataSourceID uint64

DataSourceID is the type-safe unique identifier type for data sources.

type ExternalID

type ExternalID uint64

ExternalID is the type-safe unique identifier type for raw data requests.

type IBCChannel

type IBCChannel struct {
	// PortID is port ID used for sending response packet when request is
	// resolved.
	PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"`
	// ChannelID is channel ID used for sending response packet when request is
	// resolved.
	ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
}

IBCChannel is information of IBC protocol to allow communicating with other chain

func (*IBCChannel) Descriptor

func (*IBCChannel) Descriptor() ([]byte, []int)

func (*IBCChannel) Equal

func (this *IBCChannel) Equal(that interface{}) bool

func (*IBCChannel) GetChannelId

func (m *IBCChannel) GetChannelId() string

func (*IBCChannel) GetPortId

func (m *IBCChannel) GetPortId() string

func (*IBCChannel) Marshal

func (m *IBCChannel) Marshal() (dAtA []byte, err error)

func (*IBCChannel) MarshalTo

func (m *IBCChannel) MarshalTo(dAtA []byte) (int, error)

func (*IBCChannel) MarshalToSizedBuffer

func (m *IBCChannel) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*IBCChannel) ProtoMessage

func (*IBCChannel) ProtoMessage()

func (*IBCChannel) Reset

func (m *IBCChannel) Reset()

func (*IBCChannel) Size

func (m *IBCChannel) Size() (n int)

func (*IBCChannel) String

func (m *IBCChannel) String() string

func (*IBCChannel) Unmarshal

func (m *IBCChannel) Unmarshal(dAtA []byte) error

func (*IBCChannel) XXX_DiscardUnknown

func (m *IBCChannel) XXX_DiscardUnknown()

func (*IBCChannel) XXX_Marshal

func (m *IBCChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IBCChannel) XXX_Merge

func (m *IBCChannel) XXX_Merge(src proto.Message)

func (*IBCChannel) XXX_Size

func (m *IBCChannel) XXX_Size() int

func (*IBCChannel) XXX_Unmarshal

func (m *IBCChannel) XXX_Unmarshal(b []byte) error

type OracleRequestPacketAcknowledgement

type OracleRequestPacketAcknowledgement struct {
	// RequestID is BandChain's unique identifier for this oracle request.
	RequestID RequestID `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"`
}

OracleRequestPacketAcknowledgement encodes an oracle request acknowledgement send back to requester chain.

func (*OracleRequestPacketAcknowledgement) Descriptor

func (*OracleRequestPacketAcknowledgement) Descriptor() ([]byte, []int)

func (*OracleRequestPacketAcknowledgement) Equal

func (this *OracleRequestPacketAcknowledgement) Equal(that interface{}) bool

func (*OracleRequestPacketAcknowledgement) GetRequestID

func (*OracleRequestPacketAcknowledgement) Marshal

func (m *OracleRequestPacketAcknowledgement) Marshal() (dAtA []byte, err error)

func (*OracleRequestPacketAcknowledgement) MarshalTo

func (m *OracleRequestPacketAcknowledgement) MarshalTo(dAtA []byte) (int, error)

func (*OracleRequestPacketAcknowledgement) MarshalToSizedBuffer

func (m *OracleRequestPacketAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*OracleRequestPacketAcknowledgement) ProtoMessage

func (*OracleRequestPacketAcknowledgement) ProtoMessage()

func (*OracleRequestPacketAcknowledgement) Reset

func (*OracleRequestPacketAcknowledgement) Size

func (*OracleRequestPacketAcknowledgement) String

func (*OracleRequestPacketAcknowledgement) Unmarshal

func (m *OracleRequestPacketAcknowledgement) Unmarshal(dAtA []byte) error

func (*OracleRequestPacketAcknowledgement) XXX_DiscardUnknown

func (m *OracleRequestPacketAcknowledgement) XXX_DiscardUnknown()

func (*OracleRequestPacketAcknowledgement) XXX_Marshal

func (m *OracleRequestPacketAcknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OracleRequestPacketAcknowledgement) XXX_Merge

func (*OracleRequestPacketAcknowledgement) XXX_Size

func (*OracleRequestPacketAcknowledgement) XXX_Unmarshal

func (m *OracleRequestPacketAcknowledgement) XXX_Unmarshal(b []byte) error

type OracleRequestPacketData

type OracleRequestPacketData struct {
	// ClientID is the unique identifier of this oracle request, as specified by
	// the client. This same unique ID will be sent back to the requester with the
	// oracle response.
	ClientID string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// OracleScriptID is the unique identifier of the oracle script to be
	// executed.
	OracleScriptID OracleScriptID `` /* 130-byte string literal not displayed */
	// Calldata is the OBI-encoded calldata bytes available for oracle executor to
	// read.
	Calldata []byte `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata,omitempty"`
	// AskCount is the number of validators that are requested to respond to this
	// oracle request. Higher value means more security, at a higher gas cost.
	AskCount uint64 `protobuf:"varint,4,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty"`
	// MinCount is the minimum number of validators necessary for the request to
	// proceed to the execution phase. Higher value means more security, at the
	// cost of liveness.
	MinCount uint64 `protobuf:"varint,5,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"`
	// FeeLimit is the maximum tokens that will be paid to all data source
	// providers.
	FeeLimit github_com_cosmos_cosmos_sdk_types.Coins `` /* 129-byte string literal not displayed */
	// PrepareGas is amount of gas to pay to prepare raw requests
	PrepareGas uint64 `protobuf:"varint,7,opt,name=prepare_gas,json=prepareGas,proto3" json:"prepare_gas,omitempty"`
	// ExecuteGas is amount of gas to reserve for executing
	ExecuteGas uint64 `protobuf:"varint,8,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty"`
}

OracleRequestPacketData encodes an oracle request sent from other blockchains to BandChain.

func NewOracleRequestPacketData

func NewOracleRequestPacketData(
	clientID string, oracleScriptID OracleScriptID, calldata []byte, askCount uint64, minCount uint64, feeLimit sdk.Coins, prepareGas uint64, executeGas uint64,
) OracleRequestPacketData

NewOracleRequestPacketData constructs a new OracleRequestPacketData instance

func (*OracleRequestPacketData) Descriptor

func (*OracleRequestPacketData) Descriptor() ([]byte, []int)

func (*OracleRequestPacketData) Equal

func (this *OracleRequestPacketData) Equal(that interface{}) bool

func (*OracleRequestPacketData) GetAskCount

func (m *OracleRequestPacketData) GetAskCount() uint64

func (OracleRequestPacketData) GetBytes

func (p OracleRequestPacketData) GetBytes() []byte

GetBytes is a helper for serialising

func (*OracleRequestPacketData) GetCalldata

func (m *OracleRequestPacketData) GetCalldata() []byte

func (*OracleRequestPacketData) GetClientID

func (m *OracleRequestPacketData) GetClientID() string

func (*OracleRequestPacketData) GetExecuteGas

func (m *OracleRequestPacketData) GetExecuteGas() uint64

func (*OracleRequestPacketData) GetFeeLimit

func (*OracleRequestPacketData) GetMinCount

func (m *OracleRequestPacketData) GetMinCount() uint64

func (*OracleRequestPacketData) GetOracleScriptID

func (m *OracleRequestPacketData) GetOracleScriptID() OracleScriptID

func (*OracleRequestPacketData) GetPrepareGas

func (m *OracleRequestPacketData) GetPrepareGas() uint64

func (*OracleRequestPacketData) Marshal

func (m *OracleRequestPacketData) Marshal() (dAtA []byte, err error)

func (*OracleRequestPacketData) MarshalTo

func (m *OracleRequestPacketData) MarshalTo(dAtA []byte) (int, error)

func (*OracleRequestPacketData) MarshalToSizedBuffer

func (m *OracleRequestPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*OracleRequestPacketData) ProtoMessage

func (*OracleRequestPacketData) ProtoMessage()

func (*OracleRequestPacketData) Reset

func (m *OracleRequestPacketData) Reset()

func (*OracleRequestPacketData) Size

func (m *OracleRequestPacketData) Size() (n int)

func (*OracleRequestPacketData) String

func (m *OracleRequestPacketData) String() string

func (*OracleRequestPacketData) Unmarshal

func (m *OracleRequestPacketData) Unmarshal(dAtA []byte) error

func (*OracleRequestPacketData) XXX_DiscardUnknown

func (m *OracleRequestPacketData) XXX_DiscardUnknown()

func (*OracleRequestPacketData) XXX_Marshal

func (m *OracleRequestPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OracleRequestPacketData) XXX_Merge

func (m *OracleRequestPacketData) XXX_Merge(src proto.Message)

func (*OracleRequestPacketData) XXX_Size

func (m *OracleRequestPacketData) XXX_Size() int

func (*OracleRequestPacketData) XXX_Unmarshal

func (m *OracleRequestPacketData) XXX_Unmarshal(b []byte) error

type OracleResponsePacketData

type OracleResponsePacketData struct {
	// ClientID is the unique identifier matched with that of the oracle request
	// packet.
	ClientID string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// RequestID is BandChain's unique identifier for this oracle request.
	RequestID RequestID `protobuf:"varint,2,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"`
	// AnsCount is the number of validators among to the asked validators that
	// actually responded to this oracle request prior to this oracle request
	// being resolved.
	AnsCount uint64 `protobuf:"varint,3,opt,name=ans_count,json=ansCount,proto3" json:"ans_count,omitempty"`
	// RequestTime is the UNIX epoch time at which the request was sent to
	// BandChain.
	RequestTime int64 `protobuf:"varint,4,opt,name=request_time,json=requestTime,proto3" json:"request_time,omitempty"`
	// ResolveTime is the UNIX epoch time at which the request was resolved to the
	// final result.
	ResolveTime int64 `protobuf:"varint,5,opt,name=resolve_time,json=resolveTime,proto3" json:"resolve_time,omitempty"`
	// ResolveStatus is the status of this oracle request, which can be OK,
	// FAILURE, or EXPIRED.
	ResolveStatus ResolveStatus `` /* 130-byte string literal not displayed */
	// Result is the final aggregated value encoded in OBI format. Only available
	// if status if OK.
	Result []byte `protobuf:"bytes,7,opt,name=result,proto3" json:"result,omitempty"`
}

OracleResponsePacketData encodes an oracle response from BandChain to the requester.

func (*OracleResponsePacketData) Descriptor

func (*OracleResponsePacketData) Descriptor() ([]byte, []int)

func (*OracleResponsePacketData) Equal

func (this *OracleResponsePacketData) Equal(that interface{}) bool

func (*OracleResponsePacketData) GetAnsCount

func (m *OracleResponsePacketData) GetAnsCount() uint64

func (*OracleResponsePacketData) GetClientID

func (m *OracleResponsePacketData) GetClientID() string

func (*OracleResponsePacketData) GetRequestID

func (m *OracleResponsePacketData) GetRequestID() RequestID

func (*OracleResponsePacketData) GetRequestTime

func (m *OracleResponsePacketData) GetRequestTime() int64

func (*OracleResponsePacketData) GetResolveStatus

func (m *OracleResponsePacketData) GetResolveStatus() ResolveStatus

func (*OracleResponsePacketData) GetResolveTime

func (m *OracleResponsePacketData) GetResolveTime() int64

func (*OracleResponsePacketData) GetResult

func (m *OracleResponsePacketData) GetResult() []byte

func (*OracleResponsePacketData) Marshal

func (m *OracleResponsePacketData) Marshal() (dAtA []byte, err error)

func (*OracleResponsePacketData) MarshalTo

func (m *OracleResponsePacketData) MarshalTo(dAtA []byte) (int, error)

func (*OracleResponsePacketData) MarshalToSizedBuffer

func (m *OracleResponsePacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*OracleResponsePacketData) ProtoMessage

func (*OracleResponsePacketData) ProtoMessage()

func (*OracleResponsePacketData) Reset

func (m *OracleResponsePacketData) Reset()

func (*OracleResponsePacketData) Size

func (m *OracleResponsePacketData) Size() (n int)

func (*OracleResponsePacketData) String

func (m *OracleResponsePacketData) String() string

func (*OracleResponsePacketData) Unmarshal

func (m *OracleResponsePacketData) Unmarshal(dAtA []byte) error

func (*OracleResponsePacketData) XXX_DiscardUnknown

func (m *OracleResponsePacketData) XXX_DiscardUnknown()

func (*OracleResponsePacketData) XXX_Marshal

func (m *OracleResponsePacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OracleResponsePacketData) XXX_Merge

func (m *OracleResponsePacketData) XXX_Merge(src proto.Message)

func (*OracleResponsePacketData) XXX_Size

func (m *OracleResponsePacketData) XXX_Size() int

func (*OracleResponsePacketData) XXX_Unmarshal

func (m *OracleResponsePacketData) XXX_Unmarshal(b []byte) error

type OracleScript

type OracleScript struct {
	// Owner is an address of the account who own the oracle script
	Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// Name is oracle script name used for display
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Description is oracle script description used for display
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Filename is string of file name used as reference for locating
	// compiled oracle script WASM file stored in bandchain nodes
	Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"`
	// Schema is the schema of the oracle script input/output
	// which is formatted in OBI format e.g.
	// "{symbol:string,multiplier:u64}/{px:u64}"
	Schema string `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"`
	// SourceCodeURL is the URL of oracle script's source code.
	// It is recommendded to store source code on IPFS and get its URL to preserve
	// decentralization.
	SourceCodeURL string `protobuf:"bytes,6,opt,name=source_code_url,json=sourceCodeUrl,proto3" json:"source_code_url,omitempty"`
}

OracleScript is the data structure for storing oracle scripts in the storage.

func (*OracleScript) Descriptor

func (*OracleScript) Descriptor() ([]byte, []int)

func (*OracleScript) Equal

func (this *OracleScript) Equal(that interface{}) bool

func (*OracleScript) GetDescription

func (m *OracleScript) GetDescription() string

func (*OracleScript) GetFilename

func (m *OracleScript) GetFilename() string

func (*OracleScript) GetName

func (m *OracleScript) GetName() string

func (*OracleScript) GetOwner

func (m *OracleScript) GetOwner() string

func (*OracleScript) GetSchema

func (m *OracleScript) GetSchema() string

func (*OracleScript) GetSourceCodeURL

func (m *OracleScript) GetSourceCodeURL() string

func (*OracleScript) Marshal

func (m *OracleScript) Marshal() (dAtA []byte, err error)

func (*OracleScript) MarshalTo

func (m *OracleScript) MarshalTo(dAtA []byte) (int, error)

func (*OracleScript) MarshalToSizedBuffer

func (m *OracleScript) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*OracleScript) ProtoMessage

func (*OracleScript) ProtoMessage()

func (*OracleScript) Reset

func (m *OracleScript) Reset()

func (*OracleScript) Size

func (m *OracleScript) Size() (n int)

func (*OracleScript) String

func (m *OracleScript) String() string

func (*OracleScript) Unmarshal

func (m *OracleScript) Unmarshal(dAtA []byte) error

func (*OracleScript) XXX_DiscardUnknown

func (m *OracleScript) XXX_DiscardUnknown()

func (*OracleScript) XXX_Marshal

func (m *OracleScript) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OracleScript) XXX_Merge

func (m *OracleScript) XXX_Merge(src proto.Message)

func (*OracleScript) XXX_Size

func (m *OracleScript) XXX_Size() int

func (*OracleScript) XXX_Unmarshal

func (m *OracleScript) XXX_Unmarshal(b []byte) error

type OracleScriptID

type OracleScriptID uint64

OracleScriptID is the type-safe unique identifier type for oracle scripts.

type Params

type Params struct {
	// MaxRawRequestCount is the maximum number of data source raw requests a
	// request can make.
	MaxRawRequestCount uint64 `protobuf:"varint,1,opt,name=max_raw_request_count,json=maxRawRequestCount,proto3" json:"max_raw_request_count,omitempty"`
	// MaxAskCount is the maximum number of validators a request can target.
	MaxAskCount uint64 `protobuf:"varint,2,opt,name=max_ask_count,json=maxAskCount,proto3" json:"max_ask_count,omitempty"`
	// MaxCalldataSize is the maximum size limit of calldata (bytes) in a request.
	MaxCalldataSize uint64 `protobuf:"varint,3,opt,name=max_calldata_size,json=maxCalldataSize,proto3" json:"max_calldata_size,omitempty"`
	// MaxReportDataSize is the maximum size limit of report data (bytes) in a
	// report.
	MaxReportDataSize uint64 `protobuf:"varint,4,opt,name=max_report_data_size,json=maxReportDataSize,proto3" json:"max_report_data_size,omitempty"`
	// ExpirationBlockCount is the number of blocks a request stays valid before
	// it gets expired due to insufficient reports.
	ExpirationBlockCount uint64 `protobuf:"varint,5,opt,name=expiration_block_count,json=expirationBlockCount,proto3" json:"expiration_block_count,omitempty"`
	// BaseOwasmGas is the base amount of Cosmos-SDK gas charged for owasm
	// execution.
	BaseOwasmGas uint64 `protobuf:"varint,6,opt,name=base_owasm_gas,json=baseOwasmGas,proto3" json:"base_owasm_gas,omitempty"`
	// PerValidatorRequestGas is the amount of Cosmos-SDK gas charged per
	// requested validator.
	PerValidatorRequestGas uint64 `` /* 132-byte string literal not displayed */
	// SamplingTryCount the number of validator sampling tries to pick the highest
	// voting power subset of validators to perform an oracle task.
	SamplingTryCount uint64 `protobuf:"varint,8,opt,name=sampling_try_count,json=samplingTryCount,proto3" json:"sampling_try_count,omitempty"`
	// OracleRewardPercentage is the percentage of block rewards allocated to
	// active oracle validators.
	OracleRewardPercentage uint64 `` /* 130-byte string literal not displayed */
	// InactivePenaltyDuration is the duration period where a validator cannot
	// activate back after missing an oracle report.
	InactivePenaltyDuration uint64 `` /* 134-byte string literal not displayed */
	// IBCRequestEnabled is a flag indicating whether sending oracle request via
	// IBC is allowed
	IBCRequestEnabled bool `protobuf:"varint,11,opt,name=ibc_request_enabled,json=ibcRequestEnabled,proto3" json:"ibc_request_enabled,omitempty"`
}

Params is the data structure that keeps the parameters of the oracle module.

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal

func (this *Params) Equal(that interface{}) bool

func (*Params) GetBaseOwasmGas

func (m *Params) GetBaseOwasmGas() uint64

func (*Params) GetExpirationBlockCount

func (m *Params) GetExpirationBlockCount() uint64

func (*Params) GetIBCRequestEnabled

func (m *Params) GetIBCRequestEnabled() bool

func (*Params) GetInactivePenaltyDuration

func (m *Params) GetInactivePenaltyDuration() uint64

func (*Params) GetMaxAskCount

func (m *Params) GetMaxAskCount() uint64

func (*Params) GetMaxCalldataSize

func (m *Params) GetMaxCalldataSize() uint64

func (*Params) GetMaxRawRequestCount

func (m *Params) GetMaxRawRequestCount() uint64

func (*Params) GetMaxReportDataSize

func (m *Params) GetMaxReportDataSize() uint64

func (*Params) GetOracleRewardPercentage

func (m *Params) GetOracleRewardPercentage() uint64

func (*Params) GetPerValidatorRequestGas

func (m *Params) GetPerValidatorRequestGas() uint64

func (*Params) GetSamplingTryCount

func (m *Params) GetSamplingTryCount() uint64

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (Params) String

func (p Params) String() string

String returns a human readable string representation of the parameters.

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type PendingResolveList

type PendingResolveList struct {
	// RequestIDs is a list of request IDs that are waiting to be resolved
	RequestIds []uint64 `protobuf:"varint,1,rep,packed,name=request_ids,json=requestIds,proto3" json:"request_ids,omitempty"`
}

PendingResolveList is a list of requests that are waiting to be resolved

func (*PendingResolveList) Descriptor

func (*PendingResolveList) Descriptor() ([]byte, []int)

func (*PendingResolveList) Equal

func (this *PendingResolveList) Equal(that interface{}) bool

func (*PendingResolveList) GetRequestIds

func (m *PendingResolveList) GetRequestIds() []uint64

func (*PendingResolveList) Marshal

func (m *PendingResolveList) Marshal() (dAtA []byte, err error)

func (*PendingResolveList) MarshalTo

func (m *PendingResolveList) MarshalTo(dAtA []byte) (int, error)

func (*PendingResolveList) MarshalToSizedBuffer

func (m *PendingResolveList) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PendingResolveList) ProtoMessage

func (*PendingResolveList) ProtoMessage()

func (*PendingResolveList) Reset

func (m *PendingResolveList) Reset()

func (*PendingResolveList) Size

func (m *PendingResolveList) Size() (n int)

func (*PendingResolveList) String

func (m *PendingResolveList) String() string

func (*PendingResolveList) Unmarshal

func (m *PendingResolveList) Unmarshal(dAtA []byte) error

func (*PendingResolveList) XXX_DiscardUnknown

func (m *PendingResolveList) XXX_DiscardUnknown()

func (*PendingResolveList) XXX_Marshal

func (m *PendingResolveList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PendingResolveList) XXX_Merge

func (m *PendingResolveList) XXX_Merge(src proto.Message)

func (*PendingResolveList) XXX_Size

func (m *PendingResolveList) XXX_Size() int

func (*PendingResolveList) XXX_Unmarshal

func (m *PendingResolveList) XXX_Unmarshal(b []byte) error

type PriceResult

type PriceResult struct {
	// Symbol is unit of data indicating what the data is. It is price currencies
	// for this case.
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// Multiplier is a number used for left-shifting value to eliminate decimal
	// digits
	Multiplier uint64 `protobuf:"varint,2,opt,name=multiplier,proto3" json:"multiplier,omitempty"`
	// Px is the actual data, which is rate number multiplied by the multiplier.
	Px uint64 `protobuf:"varint,3,opt,name=px,proto3" json:"px,omitempty"`
	// RequestID is oracle request ID that contains this price
	RequestID RequestID `protobuf:"varint,4,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"`
	// ResolveTime is epoch timestamp indicating the time when the request had
	// been resolved
	ResolveTime int64 `protobuf:"varint,5,opt,name=resolve_time,json=resolveTime,proto3" json:"resolve_time,omitempty"`
}

PriceResult is a result from standard price reference

func (*PriceResult) Descriptor

func (*PriceResult) Descriptor() ([]byte, []int)

func (*PriceResult) GetMultiplier

func (m *PriceResult) GetMultiplier() uint64

func (*PriceResult) GetPx

func (m *PriceResult) GetPx() uint64

func (*PriceResult) GetRequestID

func (m *PriceResult) GetRequestID() RequestID

func (*PriceResult) GetResolveTime

func (m *PriceResult) GetResolveTime() int64

func (*PriceResult) GetSymbol

func (m *PriceResult) GetSymbol() string

func (*PriceResult) Marshal

func (m *PriceResult) Marshal() (dAtA []byte, err error)

func (*PriceResult) MarshalTo

func (m *PriceResult) MarshalTo(dAtA []byte) (int, error)

func (*PriceResult) MarshalToSizedBuffer

func (m *PriceResult) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PriceResult) ProtoMessage

func (*PriceResult) ProtoMessage()

func (*PriceResult) Reset

func (m *PriceResult) Reset()

func (*PriceResult) Size

func (m *PriceResult) Size() (n int)

func (*PriceResult) String

func (m *PriceResult) String() string

func (*PriceResult) Unmarshal

func (m *PriceResult) Unmarshal(dAtA []byte) error

func (*PriceResult) XXX_DiscardUnknown

func (m *PriceResult) XXX_DiscardUnknown()

func (*PriceResult) XXX_Marshal

func (m *PriceResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PriceResult) XXX_Merge

func (m *PriceResult) XXX_Merge(src proto.Message)

func (*PriceResult) XXX_Size

func (m *PriceResult) XXX_Size() int

func (*PriceResult) XXX_Unmarshal

func (m *PriceResult) XXX_Unmarshal(b []byte) error

type RawReport

type RawReport struct {
	// ExternalID is an ID of the raw request
	ExternalID ExternalID `protobuf:"varint,1,opt,name=external_id,json=externalId,proto3,casttype=ExternalID" json:"external_id,omitempty"`
	// ExitCode is status code provided by validators to specify error, if any.
	// Exit code is usually filled by the exit code returned from execution of
	// specified data source script. With code 0 means there is no error.
	ExitCode uint32 `protobuf:"varint,2,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	// Data is raw result provided by validators.
	// It is usually filled by the result from execution of specified data source
	// script.
	Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
}

RawRequest is the data structure for storing raw reporter in the storage.

func (*RawReport) Descriptor

func (*RawReport) Descriptor() ([]byte, []int)

func (*RawReport) Equal

func (this *RawReport) Equal(that interface{}) bool

func (*RawReport) GetData

func (m *RawReport) GetData() []byte

func (*RawReport) GetExitCode

func (m *RawReport) GetExitCode() uint32

func (*RawReport) GetExternalID

func (m *RawReport) GetExternalID() ExternalID

func (*RawReport) Marshal

func (m *RawReport) Marshal() (dAtA []byte, err error)

func (*RawReport) MarshalTo

func (m *RawReport) MarshalTo(dAtA []byte) (int, error)

func (*RawReport) MarshalToSizedBuffer

func (m *RawReport) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RawReport) ProtoMessage

func (*RawReport) ProtoMessage()

func (*RawReport) Reset

func (m *RawReport) Reset()

func (*RawReport) Size

func (m *RawReport) Size() (n int)

func (*RawReport) String

func (m *RawReport) String() string

func (*RawReport) Unmarshal

func (m *RawReport) Unmarshal(dAtA []byte) error

func (*RawReport) XXX_DiscardUnknown

func (m *RawReport) XXX_DiscardUnknown()

func (*RawReport) XXX_Marshal

func (m *RawReport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RawReport) XXX_Merge

func (m *RawReport) XXX_Merge(src proto.Message)

func (*RawReport) XXX_Size

func (m *RawReport) XXX_Size() int

func (*RawReport) XXX_Unmarshal

func (m *RawReport) XXX_Unmarshal(b []byte) error

type RawRequest

type RawRequest struct {
	// ExternalID is an ID of the raw request
	ExternalID ExternalID `protobuf:"varint,1,opt,name=external_id,json=externalId,proto3,casttype=ExternalID" json:"external_id,omitempty"`
	// DataSourceID is an ID of data source script that relates to the raw request
	DataSourceID DataSourceID `protobuf:"varint,2,opt,name=data_source_id,json=dataSourceId,proto3,casttype=DataSourceID" json:"data_source_id,omitempty"`
	// Calldata is the data used as argument params for executing data source
	// script
	Calldata []byte `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata,omitempty"`
}

RawRequest is the data structure for storing raw requests in the storage.

func (*RawRequest) Descriptor

func (*RawRequest) Descriptor() ([]byte, []int)

func (*RawRequest) Equal

func (this *RawRequest) Equal(that interface{}) bool

func (*RawRequest) GetCalldata

func (m *RawRequest) GetCalldata() []byte

func (*RawRequest) GetDataSourceID

func (m *RawRequest) GetDataSourceID() DataSourceID

func (*RawRequest) GetExternalID

func (m *RawRequest) GetExternalID() ExternalID

func (*RawRequest) Marshal

func (m *RawRequest) Marshal() (dAtA []byte, err error)

func (*RawRequest) MarshalTo

func (m *RawRequest) MarshalTo(dAtA []byte) (int, error)

func (*RawRequest) MarshalToSizedBuffer

func (m *RawRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RawRequest) ProtoMessage

func (*RawRequest) ProtoMessage()

func (*RawRequest) Reset

func (m *RawRequest) Reset()

func (*RawRequest) Size

func (m *RawRequest) Size() (n int)

func (*RawRequest) String

func (m *RawRequest) String() string

func (*RawRequest) Unmarshal

func (m *RawRequest) Unmarshal(dAtA []byte) error

func (*RawRequest) XXX_DiscardUnknown

func (m *RawRequest) XXX_DiscardUnknown()

func (*RawRequest) XXX_Marshal

func (m *RawRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RawRequest) XXX_Merge

func (m *RawRequest) XXX_Merge(src proto.Message)

func (*RawRequest) XXX_Size

func (m *RawRequest) XXX_Size() int

func (*RawRequest) XXX_Unmarshal

func (m *RawRequest) XXX_Unmarshal(b []byte) error

type Report

type Report struct {
	// Validator is a validator address who submit the report
	Validator string `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator,omitempty"`
	// InBeforeResolve indicates whether the report is submitted before the
	// request resolved
	InBeforeResolve bool `protobuf:"varint,2,opt,name=in_before_resolve,json=inBeforeResolve,proto3" json:"in_before_resolve,omitempty"`
	// RawReports is list of raw reports provided by the validator.
	// Each raw report has different external ID
	RawReports []RawReport `protobuf:"bytes,3,rep,name=raw_reports,json=rawReports,proto3" json:"raw_reports"`
}

Report is the data structure for storing reports in the storage.

func (*Report) Descriptor

func (*Report) Descriptor() ([]byte, []int)

func (*Report) Equal

func (this *Report) Equal(that interface{}) bool

func (*Report) GetInBeforeResolve

func (m *Report) GetInBeforeResolve() bool

func (*Report) GetRawReports

func (m *Report) GetRawReports() []RawReport

func (*Report) GetValidator

func (m *Report) GetValidator() string

func (*Report) Marshal

func (m *Report) Marshal() (dAtA []byte, err error)

func (*Report) MarshalTo

func (m *Report) MarshalTo(dAtA []byte) (int, error)

func (*Report) MarshalToSizedBuffer

func (m *Report) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Report) ProtoMessage

func (*Report) ProtoMessage()

func (*Report) Reset

func (m *Report) Reset()

func (*Report) Size

func (m *Report) Size() (n int)

func (*Report) String

func (m *Report) String() string

func (*Report) Unmarshal

func (m *Report) Unmarshal(dAtA []byte) error

func (*Report) XXX_DiscardUnknown

func (m *Report) XXX_DiscardUnknown()

func (*Report) XXX_Marshal

func (m *Report) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Report) XXX_Merge

func (m *Report) XXX_Merge(src proto.Message)

func (*Report) XXX_Size

func (m *Report) XXX_Size() int

func (*Report) XXX_Unmarshal

func (m *Report) XXX_Unmarshal(b []byte) error

type Request

type Request struct {
	// OracleScriptID is ID of an oracle script
	OracleScriptID OracleScriptID `` /* 130-byte string literal not displayed */
	// Calldata is the data used as argument params for the oracle script
	Calldata []byte `protobuf:"bytes,2,opt,name=calldata,proto3" json:"calldata,omitempty"`
	// RequestedValidators is a list of validator addresses that are assigned for
	// fulfilling the request
	RequestedValidators []string `protobuf:"bytes,3,rep,name=requested_validators,json=requestedValidators,proto3" json:"requested_validators,omitempty"`
	// MinCount is minimum number of validators required for fulfilling the
	// request
	MinCount uint64 `protobuf:"varint,4,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"`
	// RequestHeight is block height that the request has been created
	RequestHeight int64 `protobuf:"varint,5,opt,name=request_height,json=requestHeight,proto3" json:"request_height,omitempty"`
	// RequestTime is timestamp of the chain's block which contains the request
	RequestTime int64 `protobuf:"varint,6,opt,name=request_time,json=requestTime,proto3" json:"request_time,omitempty"`
	// ClientID is arbitrary id provided by requester.
	// It is used by client-side for referencing the request
	ClientID string `protobuf:"bytes,7,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// RawRequests is a list of raw requests specified by execution of oracle
	// script
	RawRequests []RawRequest `protobuf:"bytes,8,rep,name=raw_requests,json=rawRequests,proto3" json:"raw_requests"`
	// IBCChannel is an IBC channel info of the other chain, which contains a
	// channel and a port to allow bandchain connect to that chain. This field
	// allows other chain be able to request data from bandchain via IBC.
	IBCChannel *IBCChannel `protobuf:"bytes,9,opt,name=ibc_channel,json=ibcChannel,proto3" json:"ibc_channel,omitempty"`
	// ExecuteGas is amount of gas to reserve for executing
	ExecuteGas uint64 `protobuf:"varint,10,opt,name=execute_gas,json=executeGas,proto3" json:"execute_gas,omitempty"`
}

Request is the data structure for storing requests in the storage.

func (*Request) Descriptor

func (*Request) Descriptor() ([]byte, []int)

func (*Request) Equal

func (this *Request) Equal(that interface{}) bool

func (*Request) GetCalldata

func (m *Request) GetCalldata() []byte

func (*Request) GetClientID

func (m *Request) GetClientID() string

func (*Request) GetExecuteGas

func (m *Request) GetExecuteGas() uint64

func (*Request) GetIBCChannel

func (m *Request) GetIBCChannel() *IBCChannel

func (*Request) GetMinCount

func (m *Request) GetMinCount() uint64

func (*Request) GetOracleScriptID

func (m *Request) GetOracleScriptID() OracleScriptID

func (*Request) GetRawRequests

func (m *Request) GetRawRequests() []RawRequest

func (*Request) GetRequestHeight

func (m *Request) GetRequestHeight() int64

func (*Request) GetRequestTime

func (m *Request) GetRequestTime() int64

func (*Request) GetRequestedValidators

func (m *Request) GetRequestedValidators() []string

func (*Request) Marshal

func (m *Request) Marshal() (dAtA []byte, err error)

func (*Request) MarshalTo

func (m *Request) MarshalTo(dAtA []byte) (int, error)

func (*Request) MarshalToSizedBuffer

func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) Size

func (m *Request) Size() (n int)

func (*Request) String

func (m *Request) String() string

func (*Request) Unmarshal

func (m *Request) Unmarshal(dAtA []byte) error

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Request) XXX_Merge

func (m *Request) XXX_Merge(src proto.Message)

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

func (m *Request) XXX_Unmarshal(b []byte) error

type RequestID

type RequestID uint64

RequestID is the type-safe unique identifier type for data requests.

type RequestVerification

type RequestVerification struct {
	// ChainID is the ID of targeted chain
	ChainID string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	// Validator is an validator address
	Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"`
	// RequestID is the targeted request ID
	RequestID RequestID `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"`
	// ExternalID is the oracle's external ID of data source
	ExternalID ExternalID `protobuf:"varint,4,opt,name=external_id,json=externalId,proto3,casttype=ExternalID" json:"external_id,omitempty"`
}

RequestVerification is a message that is constructed and signed by a reporter to be used as a part of verification of oracle request.

func (*RequestVerification) Descriptor

func (*RequestVerification) Descriptor() ([]byte, []int)

func (*RequestVerification) Equal

func (this *RequestVerification) Equal(that interface{}) bool

func (*RequestVerification) GetChainID

func (m *RequestVerification) GetChainID() string

func (*RequestVerification) GetExternalID

func (m *RequestVerification) GetExternalID() ExternalID

func (*RequestVerification) GetRequestID

func (m *RequestVerification) GetRequestID() RequestID

func (*RequestVerification) GetValidator

func (m *RequestVerification) GetValidator() string

func (*RequestVerification) Marshal

func (m *RequestVerification) Marshal() (dAtA []byte, err error)

func (*RequestVerification) MarshalTo

func (m *RequestVerification) MarshalTo(dAtA []byte) (int, error)

func (*RequestVerification) MarshalToSizedBuffer

func (m *RequestVerification) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RequestVerification) ProtoMessage

func (*RequestVerification) ProtoMessage()

func (*RequestVerification) Reset

func (m *RequestVerification) Reset()

func (*RequestVerification) Size

func (m *RequestVerification) Size() (n int)

func (*RequestVerification) String

func (m *RequestVerification) String() string

func (*RequestVerification) Unmarshal

func (m *RequestVerification) Unmarshal(dAtA []byte) error

func (*RequestVerification) XXX_DiscardUnknown

func (m *RequestVerification) XXX_DiscardUnknown()

func (*RequestVerification) XXX_Marshal

func (m *RequestVerification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestVerification) XXX_Merge

func (m *RequestVerification) XXX_Merge(src proto.Message)

func (*RequestVerification) XXX_Size

func (m *RequestVerification) XXX_Size() int

func (*RequestVerification) XXX_Unmarshal

func (m *RequestVerification) XXX_Unmarshal(b []byte) error

type ResolveStatus

type ResolveStatus int32

ResolveStatus encodes the status of an oracle request.

const (
	// Open - the request is not yet resolved.
	RESOLVE_STATUS_OPEN ResolveStatus = 0
	// Success - the request has been resolved successfully with no errors.
	RESOLVE_STATUS_SUCCESS ResolveStatus = 1
	// Failure - an error occured during the request's resolve call.
	RESOLVE_STATUS_FAILURE ResolveStatus = 2
	// Expired - the request does not get enough reports from validator within the
	// timeframe.
	RESOLVE_STATUS_EXPIRED ResolveStatus = 3
)

func (ResolveStatus) EnumDescriptor

func (ResolveStatus) EnumDescriptor() ([]byte, []int)

func (ResolveStatus) String

func (x ResolveStatus) String() string

type Result

type Result struct {
	// ClientID is the unique identifier of this oracle request, as specified by
	// the client. This same unique ID will be sent back to the requester with the
	// oracle response.
	ClientID string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// OracleScriptID is the unique identifier of the oracle script to be
	// executed.
	OracleScriptID OracleScriptID `` /* 130-byte string literal not displayed */
	// Calldata is the calldata bytes available for oracle executor to read.
	Calldata []byte `protobuf:"bytes,3,opt,name=calldata,proto3" json:"calldata,omitempty"`
	// AskCount is the number of validators that are requested to respond to this
	// oracle request. Higher value means more security, at a higher gas cost.
	AskCount uint64 `protobuf:"varint,4,opt,name=ask_count,json=askCount,proto3" json:"ask_count,omitempty"`
	// MinCount is the minimum number of validators necessary for the request to
	// proceed to the execution phase. Higher value means more security, at the
	// cost of liveness.
	MinCount uint64 `protobuf:"varint,5,opt,name=min_count,json=minCount,proto3" json:"min_count,omitempty"`
	// RequestID is BandChain's unique identifier for this oracle request.
	RequestID RequestID `protobuf:"varint,6,opt,name=request_id,json=requestId,proto3,casttype=RequestID" json:"request_id,omitempty"`
	// AnsCount is the number of validators among to the asked validators that
	// actually responded to this oracle request prior to this oracle request
	// being resolved.
	AnsCount uint64 `protobuf:"varint,7,opt,name=ans_count,json=ansCount,proto3" json:"ans_count,omitempty"`
	// RequestTime is the UNIX epoch time at which the request was sent to
	// BandChain.
	RequestTime int64 `protobuf:"varint,8,opt,name=request_time,json=requestTime,proto3" json:"request_time,omitempty"`
	// ResolveTime is the UNIX epoch time at which the request was resolved to the
	// final result.
	ResolveTime int64 `protobuf:"varint,9,opt,name=resolve_time,json=resolveTime,proto3" json:"resolve_time,omitempty"`
	// ResolveStatus is the status of this oracle request, which can be OK,
	// FAILURE, or EXPIRED.
	ResolveStatus ResolveStatus `` /* 131-byte string literal not displayed */
	// Result is the final aggregated value only available if status if OK.
	Result []byte `protobuf:"bytes,11,opt,name=result,proto3" json:"result,omitempty"`
}

Result encodes a result of request and store in chain

func (*Result) Descriptor

func (*Result) Descriptor() ([]byte, []int)

func (*Result) Equal

func (this *Result) Equal(that interface{}) bool

func (*Result) GetAnsCount

func (m *Result) GetAnsCount() uint64

func (*Result) GetAskCount

func (m *Result) GetAskCount() uint64

func (*Result) GetCalldata

func (m *Result) GetCalldata() []byte

func (*Result) GetClientID

func (m *Result) GetClientID() string

func (*Result) GetMinCount

func (m *Result) GetMinCount() uint64

func (*Result) GetOracleScriptID

func (m *Result) GetOracleScriptID() OracleScriptID

func (*Result) GetRequestID

func (m *Result) GetRequestID() RequestID

func (*Result) GetRequestTime

func (m *Result) GetRequestTime() int64

func (*Result) GetResolveStatus

func (m *Result) GetResolveStatus() ResolveStatus

func (*Result) GetResolveTime

func (m *Result) GetResolveTime() int64

func (*Result) GetResult

func (m *Result) GetResult() []byte

func (*Result) Marshal

func (m *Result) Marshal() (dAtA []byte, err error)

func (*Result) MarshalTo

func (m *Result) MarshalTo(dAtA []byte) (int, error)

func (*Result) MarshalToSizedBuffer

func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) Size

func (m *Result) Size() (n int)

func (*Result) String

func (m *Result) String() string

func (*Result) Unmarshal

func (m *Result) Unmarshal(dAtA []byte) error

func (*Result) XXX_DiscardUnknown

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal

func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Result) XXX_Merge

func (m *Result) XXX_Merge(src proto.Message)

func (*Result) XXX_Size

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal

func (m *Result) XXX_Unmarshal(b []byte) error

type ValidatorStatus

type ValidatorStatus struct {
	// IsActive is a boolean indicating active status of validator.
	// The validator will be deactivated when they are unable to send reports
	// to fulfill oracle request before the request expired.
	IsActive bool `protobuf:"varint,1,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
	// Since is a block timestamp when validator has been activated/deactivated
	Since time.Time `protobuf:"bytes,2,opt,name=since,proto3,stdtime" json:"since"`
}

ValidatorStatus maintains whether a validator is an active oracle provider.

func (*ValidatorStatus) Descriptor

func (*ValidatorStatus) Descriptor() ([]byte, []int)

func (*ValidatorStatus) Equal

func (this *ValidatorStatus) Equal(that interface{}) bool

func (*ValidatorStatus) GetIsActive

func (m *ValidatorStatus) GetIsActive() bool

func (*ValidatorStatus) GetSince

func (m *ValidatorStatus) GetSince() time.Time

func (*ValidatorStatus) Marshal

func (m *ValidatorStatus) Marshal() (dAtA []byte, err error)

func (*ValidatorStatus) MarshalTo

func (m *ValidatorStatus) MarshalTo(dAtA []byte) (int, error)

func (*ValidatorStatus) MarshalToSizedBuffer

func (m *ValidatorStatus) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidatorStatus) ProtoMessage

func (*ValidatorStatus) ProtoMessage()

func (*ValidatorStatus) Reset

func (m *ValidatorStatus) Reset()

func (*ValidatorStatus) Size

func (m *ValidatorStatus) Size() (n int)

func (*ValidatorStatus) String

func (m *ValidatorStatus) String() string

func (*ValidatorStatus) Unmarshal

func (m *ValidatorStatus) Unmarshal(dAtA []byte) error

func (*ValidatorStatus) XXX_DiscardUnknown

func (m *ValidatorStatus) XXX_DiscardUnknown()

func (*ValidatorStatus) XXX_Marshal

func (m *ValidatorStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidatorStatus) XXX_Merge

func (m *ValidatorStatus) XXX_Merge(src proto.Message)

func (*ValidatorStatus) XXX_Size

func (m *ValidatorStatus) XXX_Size() int

func (*ValidatorStatus) XXX_Unmarshal

func (m *ValidatorStatus) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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