mock

package
v0.0.0-...-7838e69 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDenying

func NewDenying() rules.Service

NewDenying creates a mock rules service that denies all requests.

func NewFailing

func NewFailing() rules.Service

NewFailing creates a mock rules service that fails all requests.

Types

type Service

type Service struct{}

Service is the structure that keeps track of rules.

func New

func New() *Service

New creates a mock rules service.

func (*Service) ExportSlashingProtection

func (s *Service) ExportSlashingProtection(ctx context.Context) (map[[48]byte]*rules.SlashingProtection, error)

ExportSlashingProtection exports the slashing protection data.

func (*Service) ImportSlashingProtection

func (s *Service) ImportSlashingProtection(ctx context.Context, protection map[[48]byte]*rules.SlashingProtection) error

ImportSlashingProtection impports the slashing protection data.

func (*Service) Name

func (s *Service) Name() string

Name provides the name of the service.

func (*Service) OnCreateAccount

func (s *Service) OnCreateAccount(ctx context.Context, metadata *rules.ReqMetadata, req *rules.CreateAccountData) rules.Result

OnCreateAccount is called when a request to create an account needs to be approved.

func (*Service) OnListAccounts

func (s *Service) OnListAccounts(ctx context.Context, metadata *rules.ReqMetadata, req *rules.AccessAccountData) rules.Result

OnListAccounts is called when a request to list accounts needs to be approved.

func (*Service) OnLockAccount

func (s *Service) OnLockAccount(ctx context.Context, metadata *rules.ReqMetadata, req *rules.LockAccountData) rules.Result

OnLockAccount is called when a request to lock an account needs to be approved.

func (*Service) OnLockWallet

func (s *Service) OnLockWallet(ctx context.Context, metadata *rules.ReqMetadata, req *rules.LockWalletData) rules.Result

OnLockWallet is called when a request to lock a wallet needs to be approved.

func (*Service) OnSign

func (s *Service) OnSign(ctx context.Context, metadata *rules.ReqMetadata, req *rules.SignData) rules.Result

OnSign is called when a request to sign generic data needs to be approved.

func (*Service) OnSignBeaconAttestation

func (s *Service) OnSignBeaconAttestation(ctx context.Context, metadata *rules.ReqMetadata, req *rules.SignBeaconAttestationData) rules.Result

OnSignBeaconAttestation is called when a request to sign a beacon block attestation needs to be approved.

func (*Service) OnSignBeaconAttestations

func (s *Service) OnSignBeaconAttestations(ctx context.Context,
	metadata []*rules.ReqMetadata,
	req []*rules.SignBeaconAttestationData,
) []rules.Result

OnSignBeaconAttestations is called when a request to sign multiple beacon block attestations needs to be approved.

func (*Service) OnSignBeaconProposal

func (s *Service) OnSignBeaconProposal(ctx context.Context, metadata *rules.ReqMetadata, req *rules.SignBeaconProposalData) rules.Result

OnSignBeaconProposal is called when a request to sign a beacon block proposal needs to be approved.

func (*Service) OnUnlockAccount

func (s *Service) OnUnlockAccount(ctx context.Context, metadata *rules.ReqMetadata, req *rules.UnlockAccountData) rules.Result

OnUnlockAccount is called when a request to unlock an account needs to be approved.

func (*Service) OnUnlockWallet

func (s *Service) OnUnlockWallet(ctx context.Context, metadata *rules.ReqMetadata, req *rules.UnlockWalletData) rules.Result

OnUnlockWallet is called when a request to unlock a wallet needs to be approved.

Jump to

Keyboard shortcuts

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