Documentation ¶
Index ¶
- func AnyArgsToJson(args []any) ([]string, error)
- func CanonicalizeJSON(in []byte) ([]byte, error)
- func JsonArgsToAny(methodName string, jsonArgs []string, abiJSON string) ([]any, error)
- type Call
- type Config
- type Engine
- type EthReaderCaller
- type Forwarder
- type Result
- type Spec
- type TimeTrigger
- type Trigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyArgsToJson ¶
AnyArgsToJson does the inverse of the JsonArgsToAny; takes a list of arguments in go types and marshals them to a list of JSON strings.
func CanonicalizeJSON ¶
func JsonArgsToAny ¶
JsonArgsToAny takes a list of arguments marshalled as JSON strings. It then uses the ethereum ABI to convert each JSON argument into the go type which corresponds to the ethereum type defined in the ABI for that argument.
Types ¶
type Call ¶
type Call struct {
// contains filtered or unexported fields
}
type EthReaderCaller ¶
type EthReaderCaller interface { ethereum.ContractCaller ethereum.ChainReader }
Still TODO
- listen for new data sources and add specs
- on tick check every block since last tick not just current
- submit some sort of error event if call fails
- know when datasources stop being active and remove them -- because e.g. market is dead, or amended to have different source -- or because trigger will never fire again
- what to do about catching up e.g. if node is restarted
type Forwarder ¶
type Forwarder interface {
ForwardFromSelf(*commandspb.ChainEvent)
}
type Spec ¶
func NewSpecFromProto ¶
func NewSpecFromProto(proto *vega.DataSourceDefinition) (Spec, error)
type TimeTrigger ¶
type TimeTrigger struct { Initial uint64 Every uint64 // 0 = don't repeat Until uint64 // 0 = forever }
func TimeTriggerFromProto ¶
func TimeTriggerFromProto(proto *vega.EthTimeTrigger) TimeTrigger
func (TimeTrigger) Hash ¶
func (t TimeTrigger) Hash() []byte
func (TimeTrigger) ToProto ¶
func (t TimeTrigger) ToProto() *vega.EthCallTrigger
func (TimeTrigger) Trigger ¶
func (t TimeTrigger) Trigger(prev blockish, current blockish) bool
type Trigger ¶
type Trigger interface { Trigger(prev blockish, current blockish) bool ToProto() *vega.EthCallTrigger Hash() []byte }
func TriggerFromProto ¶
func TriggerFromProto(proto *vega.EthCallTrigger) (Trigger, error)
Click to show internal directories.
Click to hide internal directories.