Documentation ¶
Index ¶
- Constants
- Variables
- func DataSourceStoreKey(dataSourceID DataSourceID) []byte
- func ErrBadDataValue(format string, args ...interface{}) sdk.Error
- func ErrBadWasmExecution(format string, args ...interface{}) sdk.Error
- func ErrInvalidBasicMsg(format string, args ...interface{}) sdk.Error
- func ErrInvalidState(format string, args ...interface{}) sdk.Error
- func ErrItemDuplication(format string, args ...interface{}) sdk.Error
- func ErrItemNotFound(format string, args ...interface{}) sdk.Error
- func ErrUnauthorizedPermission(format string, args ...interface{}) sdk.Error
- func GetIteratorPrefix(prefix []byte, requestID RequestID) []byte
- func OracleScriptStoreKey(oracleScriptID OracleScriptID) []byte
- func RawDataReportStoreKey(requestID RequestID, externalID ExternalID, validatorAddress sdk.ValAddress) []byte
- func RawDataRequestStoreKey(requestID RequestID, externalID ExternalID) []byte
- func RegisterCodec(cdc *codec.Codec)
- func RequestStoreKey(requestID RequestID) []byte
- func ResultStoreKey(requestID RequestID, oracleScriptID OracleScriptID, calldata []byte) []byte
- type DataSource
- type DataSourceID
- type DataSourceQuerierInfo
- type ExternalID
- type MsgCreateDataSource
- type MsgCreateOracleScript
- type MsgEditDataSource
- type MsgEditOracleScript
- type MsgReportData
- type MsgRequestData
- type OracleScript
- type OracleScriptID
- type OracleScriptQuerierInfo
- type Params
- type RawBytes
- type RawDataReport
- type RawDataReportWithID
- type RawDataRequest
- type RawDataRequestWithExternalID
- type ReportWithValidator
- type Request
- type RequestID
- type RequestQuerierInfo
- type ResolveStatus
- type Result
- type U64Array
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = ModuleName CodeInvalidBasicMsg sdk.CodeType = 101 CodeBadDataValue sdk.CodeType = 102 CodeItemDuplication sdk.CodeType = 104 CodeItemNotFound sdk.CodeType = 105 CodeInvalidState sdk.CodeType = 106 CodeBadWasmExecution sdk.CodeType = 107 )
DefaultCodespace is the Module Name
const ( EventTypeCreateDataSource = "create_data_source" EventTypeEditDataSource = "edit_data_source" EventTypeCreateOracleScript = "create_oracle_script" EventTypeEditOracleScript = "edit_oracle_script" EventTypeRequest = "request" EventTypeReport = "report" AttributeKeyID = "id" AttributeKeyRequestID = "request_id" AttributeKeyValidator = "validator" )
Event types
const ( // ModuleName is the name of the module ModuleName = "zoracle" // StoreKey to be used when creating the KVStore StoreKey = ModuleName )
const ( DefaultParamspace = ModuleName // The maximum size of data source executable size, in bytes. // Default value is set to 10 kB. DefaultMaxDataSourceExecutableSize = int64(10 * 1024) // The maximum size of Owasm code, in bytes. // Default value is set to 500 kB. DefaultMaxOracleScriptCodeSize = int64(500 * 1024) // The maximum size of calldata when invoking for oracle scripts or data sources. // Default value is set 1 kB. DefaultMaxCalldataSize = int64(1 * 1024) // The maximum number of data sources a request can make. // Default value is set to 16. DefaultMaxDataSourceCountPerRequest = int64(16) // The maximum size of raw data report per data source. // Default value is set to 1 kB. DefaultMaxRawDataReportSize = int64(1 * 1024) // The maximum size of result after execution. // Default value is set 1 kB. DefaultMaxResultSize = int64(1 * 1024) // The maximum gas that can be used to resolve requests at endblock time // Default value is 1000000 DefaultEndBlockExecuteGasLimit = uint64(1000000) // The maximum size of name length. // Default value is 280 DefaultMaxNameLength = int64(280) // The maximum size of description length. // Default value 4096 DefaultDescriptionLength = int64(4096) // Gas cost per validator for each raw data request. DefaultGasPerRawDataRequestPerValidator = uint64(25000) )
Default parameter namespace.
const ( QueryDataSourceByID = "data_source" QueryDataSources = "data_sources" QueryOracleScriptByID = "oracle_script" QueryOracleScripts = "oracle_scripts" QueryRequestByID = "request" QueryRequests = "requests" QueryPending = "pending_request" QueryRequestNumber = "request_number" )
query endpoints
const RouterKey = ModuleName
RouterKey is they name of the bank module
Variables ¶
var ( // GlobalStoreKeyPrefix is a prefix for global primitive state variable GlobalStoreKeyPrefix = []byte{0x00} // RequestsCountStoreKey is a key that help getting to current requests count state variable RequestsCountStoreKey = append(GlobalStoreKeyPrefix, []byte("RequestsCount")...) // PendingResolveListStoreKey is a key that help getting pending request PendingResolveListStoreKey = append(GlobalStoreKeyPrefix, []byte("PendingList")...) // DataSourceCountStoreKey is a key that keeps the current data source count state variable. DataSourceCountStoreKey = append(GlobalStoreKeyPrefix, []byte("DataSourceCount")...) // OracleScriptCountStoreKey is a key that keeps the current oracle script count state variable. OracleScriptCountStoreKey = append(GlobalStoreKeyPrefix, []byte("OracleScriptCount")...) // RequestStoreKeyPrefix is a prefix for request store RequestStoreKeyPrefix = []byte{0x01} // ResultStoreKeyPrefix is a prefix for storing result ResultStoreKeyPrefix = []byte{0xff} // RawDataRequestStoreKeyPrefix is a prefix for storing raw data request detail. RawDataRequestStoreKeyPrefix = []byte{0x02} // RawDataReportStoreKeyPrefix is a prefix for report store RawDataReportStoreKeyPrefix = []byte{0x03} // DataSourceStoreKeyPrefix is a prefix for data source store. DataSourceStoreKeyPrefix = []byte{0x04} // OracleScriptStoreKeyPrefix is a prefix for oracle script store. OracleScriptStoreKeyPrefix = []byte{0x05} )
var ( KeyMaxDataSourceExecutableSize = []byte("MaxDataSourceExecutableSize") KeyMaxOracleScriptCodeSize = []byte("MaxOracleScriptCodeSize") KeyMaxCalldataSize = []byte("MaxCalldataSize") KeyMaxDataSourceCountPerRequest = []byte("MaxDataSourceCountPerRequest") KeyMaxRawDataReportSize = []byte("MaxRawDataReportSize") KeyMaxResultSize = []byte("MaxResultSize") KeyEndBlockExecuteGasLimit = []byte("EndBlockExecuteGasLimit") KeyMaxNameLength = []byte("MaxNameLength") KeyMaxDescriptionLength = []byte("MaxDescriptionLength") KeyGasPerRawDataRequestPerValidator = []byte("GasPerRawDataRequestPerValidator") )
Parameter store keys.
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func DataSourceStoreKey ¶
func DataSourceStoreKey(dataSourceID DataSourceID) []byte
DataSourceStoreKey is a function to generate key for each data source in store.
func ErrBadDataValue ¶
func ErrBadWasmExecution ¶
func ErrInvalidBasicMsg ¶
func ErrInvalidState ¶
func ErrItemDuplication ¶
func ErrItemNotFound ¶
func GetIteratorPrefix ¶
GetIteratorPrefix is a function to get specific prefix
func OracleScriptStoreKey ¶
func OracleScriptStoreKey(oracleScriptID OracleScriptID) []byte
OracleScriptStoreKey is a function to generate key for each oracle script in store.
func RawDataReportStoreKey ¶
func RawDataReportStoreKey(requestID RequestID, externalID ExternalID, validatorAddress sdk.ValAddress) []byte
RawDataReportStoreKey is a function to generate key for each raw data report in store.
func RawDataRequestStoreKey ¶
func RawDataRequestStoreKey(requestID RequestID, externalID ExternalID) []byte
RawDataRequestStoreKey is a function to generate key for each raw data request in store
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
func RequestStoreKey ¶
RequestStoreKey is a function to generate key for each request in store
func ResultStoreKey ¶
func ResultStoreKey(requestID RequestID, oracleScriptID OracleScriptID, calldata []byte) []byte
ResultStoreKey is a function to generate key for each result in store
Types ¶
type DataSource ¶
type DataSource struct { Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` Description string `josn:"description"` Fee sdk.Coins `json:"fee"` Executable []byte `json:"executable"` }
DataSource is a type to store detail of data source.
func NewDataSource ¶
func NewDataSource(owner sdk.AccAddress, name string, description string, fee sdk.Coins, executable []byte) DataSource
NewDataSource creates a new DataSource instance.
type DataSourceID ¶
type DataSourceID int64
type DataSourceQuerierInfo ¶
type DataSourceQuerierInfo struct { ID DataSourceID `json:"id"` Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` Description string `json:"description"` Fee sdk.Coins `json:"fee"` Executable []byte `json:"executable"` }
func NewDataSourceQuerierInfo ¶
func NewDataSourceQuerierInfo( id DataSourceID, owner sdk.AccAddress, name string, description string, fee sdk.Coins, executable []byte, ) DataSourceQuerierInfo
type ExternalID ¶
type ExternalID int64
func GetExternalIDFromRawDataRequestKey ¶
func GetExternalIDFromRawDataRequestKey(key []byte) ExternalID
GetExternalIDFromRawDataRequestKey is a function to get external id from raw data request key.
func GetValidatorAddressAndExternalID ¶
func GetValidatorAddressAndExternalID( key []byte, requestID RequestID, ) (sdk.ValAddress, ExternalID)
GetValidatorAddressAndExternalID is a function to get validator address and external id from raw data report key.
type MsgCreateDataSource ¶
type MsgCreateDataSource struct { Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` Description string `json:"description"` Fee sdk.Coins `json:"fee"` Executable []byte `json:"executable"` Sender sdk.AccAddress `json:"sender"` }
MsgCreateDataSource is a message for creating a new data source.
func NewMsgCreateDataSource ¶
func NewMsgCreateDataSource( owner sdk.AccAddress, name string, description string, fee sdk.Coins, executable []byte, sender sdk.AccAddress, ) MsgCreateDataSource
NewMsgCreateDataSource creates a new MsgCreateDataSource instance.
func (MsgCreateDataSource) GetSignBytes ¶
func (msg MsgCreateDataSource) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface for MsgCreateDataSource.
func (MsgCreateDataSource) GetSigners ¶
func (msg MsgCreateDataSource) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface for MsgCreateDataSource.
func (MsgCreateDataSource) Route ¶
func (msg MsgCreateDataSource) Route() string
Route implements the sdk.Msg interface for MsgCreateDataSource.
func (MsgCreateDataSource) Type ¶
func (msg MsgCreateDataSource) Type() string
Type implements the sdk.Msg interface for MsgCreateDataSource.
func (MsgCreateDataSource) ValidateBasic ¶
func (msg MsgCreateDataSource) ValidateBasic() sdk.Error
ValidateBasic implements the sdk.Msg interface for MsgCreateDataSource.
type MsgCreateOracleScript ¶
type MsgCreateOracleScript struct { Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` Description string `json:"description"` Code []byte `json:"code"` Sender sdk.AccAddress `json:"sender"` }
MsgCreateOracleScript is a message for creating an oracle script.
func NewMsgCreateOracleScript ¶
func NewMsgCreateOracleScript( owner sdk.AccAddress, name string, description string, code []byte, sender sdk.AccAddress, ) MsgCreateOracleScript
NewMsgCreateOracleScript creates a new MsgCreateOracleScript instance.
func (MsgCreateOracleScript) GetSignBytes ¶
func (msg MsgCreateOracleScript) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface for MsgCreateOracleScript.
func (MsgCreateOracleScript) GetSigners ¶
func (msg MsgCreateOracleScript) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface for MsgCreateOracleScript.
func (MsgCreateOracleScript) Route ¶
func (msg MsgCreateOracleScript) Route() string
Route implements the sdk.Msg interface for MsgCreateOracleScript.
func (MsgCreateOracleScript) Type ¶
func (msg MsgCreateOracleScript) Type() string
Type implements the sdk.Msg interface for MsgCreateOracleScript.
func (MsgCreateOracleScript) ValidateBasic ¶
func (msg MsgCreateOracleScript) ValidateBasic() sdk.Error
ValidateBasic implements the sdk.Msg interface for MsgCreateOracleScript.
type MsgEditDataSource ¶
type MsgEditDataSource struct { DataSourceID DataSourceID `json:"dataSourceID"` Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` Description string `json:"description"` Fee sdk.Coins `json:"fee"` Executable []byte `json:"executable"` Sender sdk.AccAddress `json:"sender"` }
MsgEditDataSource is a message for editing an existing data source.
func NewMsgEditDataSource ¶
func NewMsgEditDataSource( dataSourceID DataSourceID, owner sdk.AccAddress, name string, description string, fee sdk.Coins, executable []byte, sender sdk.AccAddress, ) MsgEditDataSource
NewMsgEditDataSource creates a new MsgEditDataSource instance.
func (MsgEditDataSource) GetSignBytes ¶
func (msg MsgEditDataSource) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface for MsgEditDataSource.
func (MsgEditDataSource) GetSigners ¶
func (msg MsgEditDataSource) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface for MsgEditDataSource.
func (MsgEditDataSource) Route ¶
func (msg MsgEditDataSource) Route() string
Route implements the sdk.Msg interface for MsgEditDataSource.
func (MsgEditDataSource) Type ¶
func (msg MsgEditDataSource) Type() string
Type implements the sdk.Msg interface for MsgEditDataSource.
func (MsgEditDataSource) ValidateBasic ¶
func (msg MsgEditDataSource) ValidateBasic() sdk.Error
ValidateBasic implements the sdk.Msg interface for MsgEditDataSource.
type MsgEditOracleScript ¶
type MsgEditOracleScript struct { OracleScriptID OracleScriptID `json:"oracleScriptID"` Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` Description string `json:"description"` Code []byte `json:"code"` Sender sdk.AccAddress `json:"sender"` }
MsgEditOracleScript is a message for editing an existing oracle script.
func NewMsgEditOracleScript ¶
func NewMsgEditOracleScript( oracleScriptID OracleScriptID, owner sdk.AccAddress, name string, description string, code []byte, sender sdk.AccAddress, ) MsgEditOracleScript
NewMsgEditOracleScript creates a new MsgEditOracleScript instance.
func (MsgEditOracleScript) GetSignBytes ¶
func (msg MsgEditOracleScript) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface for MsgEditOracleScript.
func (MsgEditOracleScript) GetSigners ¶
func (msg MsgEditOracleScript) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface for MsgEditOracleScript.
func (MsgEditOracleScript) Route ¶
func (msg MsgEditOracleScript) Route() string
Route implements the sdk.Msg interface for MsgEditOracleScript.
func (MsgEditOracleScript) Type ¶
func (msg MsgEditOracleScript) Type() string
Type implements the sdk.Msg interface for MsgEditOracleScript.
func (MsgEditOracleScript) ValidateBasic ¶
func (msg MsgEditOracleScript) ValidateBasic() sdk.Error
ValidateBasic implements the sdk.Msg interface for MsgEditOracleScript.
type MsgReportData ¶
type MsgReportData struct { RequestID RequestID `json:"requestID"` DataSet []RawDataReportWithID `json:"dataSet"` Sender sdk.ValAddress `json:"sender"` }
MsgReportData is a message sent by each of the block validators to respond to a data request.
func NewMsgReportData ¶
func NewMsgReportData( requestID RequestID, dataSet []RawDataReportWithID, sender sdk.ValAddress, ) MsgReportData
NewMsgReportData creates a new MsgReportData instance.
func (MsgReportData) GetSignBytes ¶
func (msg MsgReportData) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface for MsgReportData.
func (MsgReportData) GetSigners ¶
func (msg MsgReportData) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface for MsgReportData.
func (MsgReportData) Route ¶
func (msg MsgReportData) Route() string
Route implements the sdk.Msg interface for MsgReportData.
func (MsgReportData) Type ¶
func (msg MsgReportData) Type() string
Type implements the sdk.Msg interface for MsgReportData.
func (MsgReportData) ValidateBasic ¶
func (msg MsgReportData) ValidateBasic() sdk.Error
ValidateBasic implements the sdk.Msg interface for MsgReportData.
type MsgRequestData ¶
type MsgRequestData struct { OracleScriptID OracleScriptID `json:"oracleScriptID"` Calldata []byte `json:"calldata"` RequestedValidatorCount int64 `json:"requestedValidatorCount"` SufficientValidatorCount int64 `json:"sufficientValidatorCount"` Expiration int64 `json:"expiration"` PrepareGas uint64 `json:"prepareGas"` ExecuteGas uint64 `json:"executeGas"` Sender sdk.AccAddress `json:"sender"` }
MsgRequestData is a message for requesting a new data request to an existing oracle script.
func NewMsgRequestData ¶
func NewMsgRequestData( oracleScriptID OracleScriptID, calldata []byte, requestedValidatorCount int64, sufficientValidatorCount int64, expiration int64, prepareGas uint64, executeGas uint64, sender sdk.AccAddress, ) MsgRequestData
NewMsgRequestData creates a new MsgRequestData instance.
func (MsgRequestData) GetSignBytes ¶
func (msg MsgRequestData) GetSignBytes() []byte
GetSignBytes implements the sdk.Msg interface for MsgRequestData.
func (MsgRequestData) GetSigners ¶
func (msg MsgRequestData) GetSigners() []sdk.AccAddress
GetSigners implements the sdk.Msg interface for MsgRequestData.
func (MsgRequestData) Route ¶
func (msg MsgRequestData) Route() string
Route implements the sdk.Msg interface for MsgRequestData.
func (MsgRequestData) Type ¶
func (msg MsgRequestData) Type() string
Type implements the sdk.Msg interface for MsgRequestData.
func (MsgRequestData) ValidateBasic ¶
func (msg MsgRequestData) ValidateBasic() sdk.Error
ValidateBasic implements the sdk.Msg interface for MsgRequestData.
type OracleScript ¶
type OracleScript struct { Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` Description string `json:"description"` Code []byte `json:"code"` }
OracleScript is a type to store detail of oracle script.
func NewOracleScript ¶
func NewOracleScript(owner sdk.AccAddress, name string, description string, code []byte) OracleScript
NewOracleScript creates a new OracleScript instance.
type OracleScriptID ¶
type OracleScriptID int64
type OracleScriptQuerierInfo ¶
type OracleScriptQuerierInfo struct { ID OracleScriptID `json:"id"` Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` Description string `json:"description"` Code []byte `json:"code"` }
func NewOracleScriptQuerierInfo ¶
func NewOracleScriptQuerierInfo( id OracleScriptID, owner sdk.AccAddress, name string, description string, code []byte, ) OracleScriptQuerierInfo
type Params ¶
type Params struct { MaxDataSourceExecutableSize int64 `json:"max_data_source_executable_size" yaml:"max_data_source_executable_size"` MaxOracleScriptCodeSize int64 `json:"max_oracle_script_code_size" yaml:"max_oracle_script_code_size"` MaxCalldataSize int64 `json:"max_calldata_size" yaml:"max_calldata_size"` MaxDataSourceCountPerRequest int64 `json:"max_data_source_count_per_request" yaml:"max_data_source_count_per_request"` MaxRawDataReportSize int64 `json:"max_raw_data_report_size" yaml:"max_raw_data_report_size"` MaxResultSize int64 `json:"max_result_size" yaml:"max_result_size"` EndBlockExecuteGasLimit uint64 `json:"end_block_execute_gas_limit" yaml:"end_block_execute_gas_limit"` MaxNameLength int64 `json:"max_name_length" yaml:"max_name_length"` MaxDescriptionLength int64 `json:"max_description_length" yaml:"max_description_length"` GasPerRawDataRequestPerValidator uint64 `json:"gas_per_raw_data_request" yaml:"gas_per_raw_data_request"` }
Params - used for initializing default parameter for zoracle at genesis.
func NewParams ¶
func NewParams( maxDataSourceExecutableSize int64, maxOracleScriptCodeSize int64, maxCalldataSize int64, maxDataSourceCountPerRequest int64, maxRawDataReportSize int64, maxResultSize int64, endBlockExecuteGasLimit uint64, maxNameLength int64, maxDescriptionLength int64, gasPerRawDataRequestPerValidator uint64, ) Params
NewParams creates a new Params object.
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs implements the params.ParamSet interface for Params.
type RawDataReport ¶
func NewRawDataReport ¶
func NewRawDataReport(exitCode uint8, data []byte) RawDataReport
type RawDataReportWithID ¶
type RawDataReportWithID struct { ExternalDataID ExternalID `json:"externalDataID"` ExitCode uint8 `json:"exitCode"` Data []byte `json:"data"` }
RawDataReport encapsulates a raw data report for an external data source from a block validator.
func NewRawDataReportWithID ¶
func NewRawDataReportWithID(externalDataID ExternalID, exitCode uint8, data []byte) RawDataReportWithID
NewRawDataReport creates a new RawDataReport instance.
type RawDataRequest ¶
type RawDataRequest struct { DataSourceID DataSourceID `json:"dataSourceID"` Calldata []byte `json:"calldata"` }
RawDataRequest is a data structure that store what datasource and calldata will be used in request.
func NewRawDataRequest ¶
func NewRawDataRequest(dataSourceID DataSourceID, calldata []byte) RawDataRequest
NewRawDataRequest creates a new RawDataRequest instance
type RawDataRequestWithExternalID ¶
type RawDataRequestWithExternalID struct { ExternalID ExternalID `json:"externalID"` RawDataRequest RawDataRequest `json:"detail"` }
RawDataRequestWithExternalID is a raw data request that contain external id.
func NewRawDataRequestWithExternalID ¶
func NewRawDataRequestWithExternalID(externalID ExternalID, rawDataRequest RawDataRequest) RawDataRequestWithExternalID
NewRawDataRequestWithExternalID creates a new RawDataRequestWithExternalID instance.
type ReportWithValidator ¶
type ReportWithValidator struct { RawDataReports []RawDataReportWithID `json:"detail"` Validator sdk.ValAddress `json:"validator"` }
ReportWithValidator is a report that contains operator address in struct
func NewReportWithValidator ¶
func NewReportWithValidator( reports []RawDataReportWithID, valAddress sdk.ValAddress, ) ReportWithValidator
NewReportWithValidator is a contructor of ReportWithValidator
type Request ¶
type Request struct { OracleScriptID OracleScriptID `json:"oracleScriptID"` Calldata []byte `json:"calldata"` RequestedValidators []sdk.ValAddress `json:"requestedValidators"` SufficientValidatorCount int64 `json:"sufficientValidatorCount"` ReceivedValidators []sdk.ValAddress `json:"receivedValidators"` RequestHeight int64 `json:"requestHeight"` RequestTime int64 `json:"requestTime"` ExpirationHeight int64 `json:"expirationHeight"` ExecuteGas uint64 `json:"executeGas"` ResolveStatus ResolveStatus `json:"resolveStatus"` }
Request is a data structure that stores the detail of a request to an oracle script.
func NewRequest ¶
func NewRequest( oracleScriptID OracleScriptID, calldata []byte, requestedValidators []sdk.ValAddress, sufficientValidatorCount int64, requestHeight int64, requestTime int64, expirationHeight int64, executeGas uint64, ) Request
NewRequest creates a new Request instance.
type RequestQuerierInfo ¶
type RequestQuerierInfo struct { ID RequestID `json:"id"` Request Request `json:"request"` RawDataRequests []RawDataRequestWithExternalID `json:"rawDataRequests"` Reports []ReportWithValidator `json:"reports"` Result Result `json:"result"` }
func NewRequestQuerierInfo ¶
func NewRequestQuerierInfo( id RequestID, request Request, rawDataRequests []RawDataRequestWithExternalID, reports []ReportWithValidator, result Result, ) RequestQuerierInfo
type Result ¶
type Result struct { RequestTime int64 `json:"requestTime"` AggregationTime int64 `json:"aggregationTime"` RequestedValidatorsCount int64 `json:"requestedValidatorsCount"` SufficientValidatorCount int64 `json:"sufficientValidatorCount"` ReportedValidatorsCount int64 `json:"reportedValidatorsCount"` Data []byte `json:"data"` }
Result is a data structure that stores the detail of the result of a specific request.
func MustDecodeResult ¶
MustDecodeResult is a helper function for decoding bytes to Result. The function panics if the given input is less than 40 bytes long.
func NewResult ¶
func NewResult( requestTime int64, aggregationTime int64, requestedValidatorsCount int64, sufficientValidatorCount int64, reportedValidatorsCount int64, data []byte, ) Result
NewResult creates a new Result instance.
func (Result) EncodeResult ¶
Bytes is a helper function for encoding Result to bytes.