result

package
v0.0.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResultStorage

type ResultStorage struct {
	// contains filtered or unexported fields
}

ResultStorage provides methods for storing and retrieving action responses.

func NewStorage

NewStorage creates a new ResultStorage backed by the provided Storage. The Notifier is used for pub/sub notifications when results are stored.

func (*ResultStorage) GetResponse

func (rs *ResultStorage) GetResponse(ctx context.Context, actionID common.Hash, submissionTag types.SubmissionTag) (*types.ActionResponse, error)

GetResponse returns action response for action id and submission tag.

func (*ResultStorage) StoreResponse

func (rs *ResultStorage) StoreResponse(ctx context.Context, response *types.ActionResponse) error

StoreResponse stores response with identifier actionID:submissionTag for 2 weeks for end and threshold actions, or half an hour for submit actions.

func (*ResultStorage) WaitOnResponse

func (rs *ResultStorage) WaitOnResponse(ctx context.Context, actionID common.Hash, submissionTag types.SubmissionTag, timeout time.Duration) (*types.ActionResponse, error)

WaitOnResponse waits on the response for the actionID with submissionTag until timeout runs out.

If timeout is not positive, it waits until the response arrives. Should only be used if an action with the given ID and submission tag is expected to be processed.

type Service

type Service struct {

	// A channel for wallet update actions (KEY_GENERATE, KEY_DATA_PROVIDER_RESTORE, KEY_DELETE)
	WalletSync chan *types.ActionResult
	// A channel for backup actions (TEE_BACKUP)
	Backups chan *types.ActionResult
	// A channel for backup trigger actions (UPDATE_POLICY)
	BackupTrigger chan bool
	// contains filtered or unexported fields
}

Service handles processing and storage of TEE action results.

func NewService

func NewService(rs *ResultStorage) *Service

NewService creates a new result service.

func (*Service) ProcessAndStore

func (s *Service) ProcessAndStore(ctx context.Context, r *types.ActionResponse) error

ProcessAndStore stores response into database and triggers appropriate hooks.

func (*Service) Serve

func (s *Service) Serve(ctx context.Context, actionID common.Hash, submissionTag types.SubmissionTag) (*types.ActionResponse, error)

Serve returns response for actionID with provided submissionTag if present.

func (*Service) SetIdentity

func (s *Service) SetIdentity(teeID common.Address) error

SetIdentity sets the TEE identity for the service. It can only be set once.

Jump to

Keyboard shortcuts

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