Documentation ¶
Index ¶
- Constants
- Variables
- func MustGetABI(json string) abi.ABI
- func ReceiptIndicatesRunLogFulfillment(txr types.Receipt) bool
- type ChainCfg
- type ChainConfigORM
- type DBChain
- type FunctionSelector
- func (f FunctionSelector) Bytes() []byte
- func (f FunctionSelector) MarshalJSON() ([]byte, error)
- func (f *FunctionSelector) Scan(value interface{}) error
- func (f *FunctionSelector) SetBytes(b []byte)
- func (f FunctionSelector) String() string
- func (f *FunctionSelector) UnmarshalJSON(input []byte) error
- func (f FunctionSelector) Value() (driver.Value, error)
- type Head
- func (h *Head) ChainHashes() []common.Hash
- func (h *Head) ChainLength() uint32
- func (h *Head) ChainString() string
- func (h *Head) EarliestInChain() *Head
- func (h *Head) GreaterThan(r *Head) bool
- func (h *Head) HashAtHeight(blockNum int64) common.Hash
- func (h *Head) IsInChain(blockHash common.Hash) bool
- func (h *Head) MarshalJSON() ([]byte, error)
- func (h *Head) NextInt() *big.Int
- func (h Head) String() string
- func (h *Head) ToInt() *big.Int
- func (h *Head) UnmarshalJSON(bs []byte) error
- type Log
- type NewNode
- type Node
- type ORM
- type Receipt
- type UntrustedBytes
Constants ¶
const FunctionSelectorLength = 4
FunctionSelectorLength should always be a length of 4 as a byte.
Variables ¶
var ChainlinkFulfilledTopic = utils.MustHash("ChainlinkFulfilled(bytes32)")
ChainlinkFulfilledTopic is the signature for the event emitted after calling ChainlinkClient.validateChainlinkCallback(requestId). See ../../contracts/src/v0.6/ChainlinkClient.sol
WeiPerEth is amount of Wei currency units in one Eth.
Functions ¶
func MustGetABI ¶ added in v1.2.0
func ReceiptIndicatesRunLogFulfillment ¶ added in v1.2.0
ReceiptIndicatesRunLogFulfillment returns true if this tx receipt is the result of a fulfilled run log.
Types ¶
type ChainCfg ¶
type ChainCfg struct { BlockHistoryEstimatorBlockDelay null.Int BlockHistoryEstimatorBlockHistorySize null.Int BlockHistoryEstimatorEIP1559FeeCapBufferBlocks null.Int ChainType null.String EthTxReaperThreshold *models.Duration EthTxResendAfterThreshold *models.Duration EvmEIP1559DynamicFees null.Bool EvmFinalityDepth null.Int EvmGasBumpPercent null.Int EvmGasBumpTxDepth null.Int EvmGasBumpWei *utils.Big EvmGasFeeCapDefault *utils.Big EvmGasLimitDefault null.Int EvmGasLimitMax null.Int EvmGasLimitMultiplier null.Float EvmGasLimitOCRJobType null.Int EvmGasLimitDRJobType null.Int EvmGasLimitVRFJobType null.Int EvmGasLimitFMJobType null.Int EvmGasLimitKeeperJobType null.Int EvmGasPriceDefault *utils.Big EvmGasTipCapDefault *utils.Big EvmGasTipCapMinimum *utils.Big EvmHeadTrackerHistoryDepth null.Int EvmHeadTrackerMaxBufferSize null.Int EvmHeadTrackerSamplingInterval *models.Duration EvmLogBackfillBatchSize null.Int EvmLogPollInterval *models.Duration EvmMaxGasPriceWei *utils.Big EvmNonceAutoSync null.Bool EvmUseForwarders null.Bool EvmRPCDefaultBatchSize null.Int FlagsContractAddress null.String GasEstimatorMode null.String KeySpecific map[string]ChainCfg LinkContractAddress null.String OperatorFactoryAddress null.String MinIncomingConfirmations null.Int MinimumContractPayment *assets.Link OCRObservationTimeout *models.Duration NodeNoNewHeadsThreshold *models.Duration }
type ChainConfigORM ¶ added in v1.1.0
type FunctionSelector ¶ added in v1.2.0
type FunctionSelector [FunctionSelectorLength]byte
FunctionSelector is the first four bytes of the call data for a function call and specifies the function to be called.
func BytesToFunctionSelector ¶ added in v1.2.0
func BytesToFunctionSelector(b []byte) FunctionSelector
BytesToFunctionSelector converts the given bytes to a FunctionSelector.
func HexToFunctionSelector ¶ added in v1.2.0
func HexToFunctionSelector(s string) FunctionSelector
HexToFunctionSelector converts the given string to a FunctionSelector.
func (FunctionSelector) Bytes ¶ added in v1.2.0
func (f FunctionSelector) Bytes() []byte
Bytes returns the FunctionSelector as a byte slice
func (FunctionSelector) MarshalJSON ¶ added in v1.2.0
func (f FunctionSelector) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding of f
func (*FunctionSelector) Scan ¶ added in v1.2.0
func (f *FunctionSelector) Scan(value interface{}) error
Scan returns the selector from its serialization in the database
func (*FunctionSelector) SetBytes ¶ added in v1.2.0
func (f *FunctionSelector) SetBytes(b []byte)
SetBytes sets the FunctionSelector to that of the given bytes (will trim).
func (FunctionSelector) String ¶ added in v1.2.0
func (f FunctionSelector) String() string
String returns the FunctionSelector as a string type.
func (*FunctionSelector) UnmarshalJSON ¶ added in v1.2.0
func (f *FunctionSelector) UnmarshalJSON(input []byte) error
UnmarshalJSON parses the raw FunctionSelector and sets the FunctionSelector type to the given input.
type Head ¶ added in v1.2.0
type Head struct { ID uint64 Hash common.Hash Number int64 L1BlockNumber null.Int64 ParentHash common.Hash Parent *Head EVMChainID *utils.Big Timestamp time.Time CreatedAt time.Time BaseFeePerGas *utils.Big ReceiptsRoot common.Hash TransactionsRoot common.Hash StateRoot common.Hash }
Head represents a BlockNumber, BlockHash.
func NewHead ¶ added in v1.2.0
func NewHead(number *big.Int, blockHash common.Hash, parentHash common.Hash, timestamp uint64, chainID *utils.Big) Head
NewHead returns a Head instance.
func (*Head) ChainHashes ¶ added in v1.2.0
ChainHashes returns an array of block hashes by recursively looking up parents
func (*Head) ChainLength ¶ added in v1.2.0
ChainLength returns the length of the chain followed by recursively looking up parents
func (*Head) ChainString ¶ added in v1.2.0
func (*Head) EarliestInChain ¶ added in v1.2.0
EarliestInChain recurses through parents until it finds the earliest one
func (*Head) GreaterThan ¶ added in v1.2.0
GreaterThan compares BlockNumbers and returns true if the receiver BlockNumber is greater than the supplied BlockNumber
func (*Head) HashAtHeight ¶ added in v1.2.0
HashAtHeight returns the hash of the block at the given height, if it is in the chain. If not in chain, returns the zero hash
func (*Head) IsInChain ¶ added in v1.2.0
IsInChain returns true if the given hash matches the hash of a head in the chain
func (*Head) MarshalJSON ¶ added in v1.2.0
func (*Head) NextInt ¶ added in v1.2.0
NextInt returns the next BlockNumber as big.int, or nil if nil to represent latest.
func (*Head) ToInt ¶ added in v1.2.0
ToInt return the height as a *big.Int. Also handles nil by returning nil.
func (*Head) UnmarshalJSON ¶ added in v1.2.0
type Log ¶ added in v1.2.0
type Log struct { Address common.Address `json:"address"` Topics []common.Hash `json:"topics"` Data []byte `json:"data"` BlockNumber uint64 `json:"blockNumber"` TxHash common.Hash `json:"transactionHash"` TxIndex uint `json:"transactionIndex"` BlockHash common.Hash `json:"blockHash"` Index uint `json:"logIndex"` Removed bool `json:"removed"` }
Log represents a contract log event.
Copied from go-ethereum: https://github.com/ethereum/go-ethereum/blob/ce9a289fa48e0d2593c4aaa7e207c8a5dd3eaa8a/core/types/log.go
We use our own version because Geth's version specifies various gencodec:"required" fields which cause unhelpful errors when unmarshalling from an empty JSON object which can happen in the batch fetcher.
func FromGethLog ¶ added in v1.2.0
FromGethLog converts a gethTypes.Log to a Log
func (Log) MarshalJSON ¶ added in v1.2.0
MarshalJSON marshals as JSON.
func (*Log) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON unmarshals from JSON.
type ORM ¶ added in v1.1.0
type ORM interface { Chain(id utils.Big, qopts ...pg.QOpt) (chain DBChain, err error) Chains(offset, limit int, qopts ...pg.QOpt) ([]DBChain, int, error) CreateChain(id utils.Big, config *ChainCfg, qopts ...pg.QOpt) (DBChain, error) UpdateChain(id utils.Big, enabled bool, config *ChainCfg, qopts ...pg.QOpt) (DBChain, error) DeleteChain(id utils.Big, qopts ...pg.QOpt) error GetChainsByIDs(ids []utils.Big) (chains []DBChain, err error) EnabledChains(...pg.QOpt) ([]DBChain, error) CreateNode(data Node, qopts ...pg.QOpt) (Node, error) DeleteNode(id int32, qopts ...pg.QOpt) error GetNodesByChainIDs(chainIDs []utils.Big, qopts ...pg.QOpt) (nodes []Node, err error) Node(id int32, qopts ...pg.QOpt) (Node, error) Nodes(offset, limit int, qopts ...pg.QOpt) ([]Node, int, error) NodesForChain(chainID utils.Big, offset, limit int, qopts ...pg.QOpt) ([]Node, int, error) ChainConfigORM SetupNodes([]Node, []utils.Big) error }
type Receipt ¶ added in v1.2.0
type Receipt struct { PostState []byte `json:"root"` Status uint64 `json:"status"` CumulativeGasUsed uint64 `json:"cumulativeGasUsed"` Bloom gethTypes.Bloom `json:"logsBloom"` Logs []*Log `json:"logs"` TxHash common.Hash `json:"transactionHash"` ContractAddress common.Address `json:"contractAddress"` GasUsed uint64 `json:"gasUsed"` BlockHash common.Hash `json:"blockHash,omitempty"` BlockNumber *big.Int `json:"blockNumber,omitempty"` TransactionIndex uint `json:"transactionIndex"` }
Receipt represents an ethereum receipt.
Copied from go-ethereum: https://github.com/ethereum/go-ethereum/blob/ce9a289fa48e0d2593c4aaa7e207c8a5dd3eaa8a/core/types/receipt.go#L50
We use our own version because Geth's version specifies various gencodec:"required" fields which cause unhelpful errors when unmarshalling from an empty JSON object which can happen in the batch fetcher.
func FromGethReceipt ¶ added in v1.2.0
FromGethReceipt converts a gethTypes.Receipt to a Receipt
func (Receipt) IsUnmined ¶ added in v1.2.0
IsUnmined returns true if the receipt is for a TX that has not been mined yet. Supposedly according to the spec this should never happen, but Parity does it anyway.
func (Receipt) IsZero ¶ added in v1.2.0
IsZero returns true if receipt is the zero receipt Batch calls to the RPC will return a pointer to an empty Receipt struct Easiest way to check if the receipt was missing is to see if the hash is 0x0 Real receipts will always have the TxHash set
func (Receipt) MarshalJSON ¶ added in v1.2.0
MarshalJSON marshals Receipt as JSON. Copied from: https://github.com/ethereum/go-ethereum/blob/ce9a289fa48e0d2593c4aaa7e207c8a5dd3eaa8a/core/types/gen_receipt_json.go
func (*Receipt) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON unmarshals from JSON.
type UntrustedBytes ¶ added in v1.2.0
type UntrustedBytes []byte
This data can contain anything and is submitted by user on-chain, so we must be extra careful how we interact with it
func (UntrustedBytes) SafeByteSlice ¶ added in v1.2.0
func (ary UntrustedBytes) SafeByteSlice(start int, end int) ([]byte, error)
SafeByteSlice returns an error on out of bounds access to a byte array, where a normal slice would panic instead