policy

package
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeadlineExceeded    = errors.New("deadline exceeded")
	ErrTooManyErrors       = errors.New("too many errors")
	ErrThresholdNotReached = errors.New("threshold not reached")
)
View Source
var (
	SigningPolicyInitializedEventSel common.Hash
)

Functions

func AddressToHash

func AddressToHash(a common.Address) common.Hash

AddressToHash zero prefixes address to 32 bytes.

func FetchSigningPolicy

func FetchSigningPolicy(ctx context.Context, db *gorm.DB, relayAddress common.Address, signingPolicyID uint32) (*policy.SigningPolicy, error)

FetchSigningPolicy fetches and parses the SigningPolicyInitialized event for the given policy ID from the database.

func InitializePolicyAction

func InitializePolicyAction(
	ctx context.Context,
	db *gorm.DB,
	addresses config.Addresses,
	offset int,
	chainID *big.Int,
) (*types.Action, *policy.SigningPolicy, int, error)

InitializePolicyAction prepares action for INITIALIZE_POLICY". SigningPolicyInitialized event that precedes the last emitted by offset is used. If such event is not found, the oldest found event is used.

The action, signing policy, and used offset are returned.

func UpdatePolicyAction

func UpdatePolicyAction(ctx context.Context, db *gorm.DB, addresses config.Addresses, log database.Log, activePolicy *policy.SigningPolicy, chainID *big.Int) (*types.Action, *policy.SigningPolicy, error)

UpdatePolicyAction prepares an UPDATE_POLICY action from a SigningPolicyInitialized log event.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL