Documentation
¶
Overview ¶
Package contract hand-decodes the Starknet core L1 contract events juno consumes. It exists to remove the abigen + go-ethereum dependency from the L1 sync path. Only the event(s) juno actually subscribes to are implemented; calls into contract methods are not supported because juno doesn't make any.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrWrongTopic = errors.New("log topic is not LogStateUpdate")
var LogStateUpdateSigHash = eth.HashFromString(
"0xd342ddf7a308dec111745b00315c14b7efb2bdae570a6856e088ed0c65a3576c",
)
LogStateUpdateSigHash is keccak256("LogStateUpdate(uint256,int256,uint256)").
Functions ¶
func LogStateUpdateFilter ¶
func LogStateUpdateFilter(contract eth.Address) client.FilterQuery
LogStateUpdateFilter omits the block range: callers add one for eth_getLogs, or leave it unset for a live eth_subscribe subscription.
Types ¶
type LogClient ¶
type LogClient interface {
FilterLogs(ctx context.Context, q client.FilterQuery) ([]eth.Log, error)
}
LogClient lets tests swap in a fake without dialling a real endpoint.
type LogStateUpdate ¶
type LogStateUpdate struct {
GlobalRoot felt.Felt
BlockNumber uint64
BlockHash felt.Felt
// Raw log envelope, preserving the emitting L1 block number and the reorg Removed flag.
Raw eth.Log
}