Documentation
¶
Index ¶
- func GetDecimals(dataType uint8) (uint8, bool)
- func GetSchema(typ string, internalType string, components []abi.ArgumentMarshaling) abi.Arguments
- func NewEVMTestReport(t *testing.T, ccip bool) []byte
- func NewFeedUpdated(m *wt.WriteConfirmed, feedID FeedID, observationsTimestamp uint32, ...) *df.FeedUpdated
- func ToBenchmarkVal(feedID FeedID, val *big.Int) float64
- type CCIPFeedReport
- type CCIPReports
- type FeedID
- type FeedReport
- type PORReport
- type PORReports
- type Processor
- type Reports
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDecimals ¶
GetDecimals returns the number of decimals for the fe7], derived from the data type Returns false if the data type is not a number
func NewFeedUpdated ¶
func NewFeedUpdated( m *wt.WriteConfirmed, feedID FeedID, observationsTimestamp uint32, benchmarkPrice *big.Int, bundle []byte, report []byte, includeTxInfo bool, ) *df.FeedUpdated
newdf.FeedUpdated creates a df.FeedUpdated from the given common parameters. If includeTxInfo is true, TxSender and TxReceiver are set.
func ToBenchmarkVal ¶
ToBenchmarkVal returns the benchmark i192 on-chain value decoded as an double (float64), scaled by number of decimals (e.g., 1e-18) Where the number of decimals is extracted from the feed ID.
This is the largest type Prometheus supports, and this conversion can overflow but so far was sufficient for most use-cases. For big numbers, benchmark bytes should be used instead.
Returns `math.NaN()` if report data type not a number, or `+/-Inf` if number doesn't fit in double.
Types ¶
type CCIPFeedReport ¶
type CCIPReports ¶
type CCIPReports = []CCIPFeedReport
type FeedID ¶
type FeedID [32]byte
FeedID represents a 32-byte feed ID
func NewFeedIDFromHex ¶
NewFeedIDFromHex creates a FeedID from a hex string
func (FeedID) GetDataType ¶
GetDecimals returns the number of decimals for the feed, derived from the feedID
[DF2.0 | Data ID Final Specification](https://docs.google.com/document/d/13ciwTx8lSUfyz1IdETwpxlIVSn1lwYzGtzOBBTpl5Vg/edit?usp=sharing) Byte 7: Data Type - 256 options
- Given the variety of buckets, a data type for the buckets will be useful for correct parsing
- 0x00 = Boolean
- 0x01= String
- 0x02 = Address
- 0x03 = Bytes
- 0x04 = Bundle (Encoded Struct)
- 0x05-0x1F reserved
- 0x20 = Decimal0 (Integer)
- 0x21 = Decimal1 (Float w/ 1 decimal place)
- …
- 0x28 = Decimal8
- …
- 0x32 = Decimal18
- …
- 0x60 = Decimal64
- 0x61-0xFF reserved
func (FeedID) GetReportType ¶
GetReportType returns the report type sourced from the feedID
[DF2.0 | Data ID Final Specification](https://docs.google.com/document/d/13ciwTx8lSUfyz1IdETwpxlIVSn1lwYzGtzOBBTpl5Vg/edit?usp=sharing) Byte 0: ID Format - 256 options (base case)
- Incrementing from 0
- 0x00 = current Data Streams format
- 0x01 = this format
- 0x02 = PoR self-serve SA team allocated IDs (15 bytes)
- 0x03 = PoR from feeds team
- 0xFF can extend ID format to subsequent bytes, so 0xFF00 is first, then 0xFF01, etc.
type FeedReport ¶
type PORReports ¶
type PORReports = []PORReport
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
EVM POR specific processor decodes writes as 'data-feeds.registry.FeedUpdated' messages + metrics
func NewProcessor ¶
func NewProcessor(metrics *df.Metrics, emitter beholder.ProtoEmitter, schema abi.Arguments, decodeReport func(*wt.WriteConfirmed, []byte, abi.Arguments) ([]*df.FeedUpdated, error)) *Processor
func (*Processor) DecodeAsFeedUpdated ¶
func (p *Processor) DecodeAsFeedUpdated(m *wt.WriteConfirmed) ([]*df.FeedUpdated, error)
type Reports ¶
type Reports = []FeedReport