mock

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CheckerSvc           checker.Service
	SenderSvc            sender.Service
	PeersSvc             *peers.Service
	ID                   uint64
	Endpoints            map[uint64]string
	Stores               []e2wtypes.Store
	GenerationPassphrase []byte
}

Config is the configuration for the mock process service.

type Service

type Service struct {
}

Service is a mock service for distributed key generation.

func New

func New() (*Service, error)

New creates a new process service.

func (*Service) OnAbort

func (*Service) OnAbort(_ context.Context, _ uint64, _ string) error

OnAbort is called when we receive a request from the given participant to abort the given DKG.

func (*Service) OnCommit

func (*Service) OnCommit(_ context.Context, _ uint64, _ string, _ []byte) ([]byte, []byte, error)

OnCommit is called when we receive a request from the given participant to commit the given DKG.

func (*Service) OnContribute

func (*Service) OnContribute(_ context.Context, _ uint64, _ string, _ bls.SecretKey, _ []bls.PublicKey) (bls.SecretKey, []bls.PublicKey, error)

OnContribute is called when we need to swap contributions with another participant.

func (*Service) OnExecute

func (*Service) OnExecute(_ context.Context, _ uint64, _ string) error

OnExecute is called when we receive a request from the given participant to execute the given DKG.

func (*Service) OnGenerate

func (*Service) OnGenerate(_ context.Context, _ *checker.Credentials, _ string, _ []byte, _ uint32, _ uint32) ([]byte, []*core.Endpoint, error)

OnGenerate is called when an request to generate a new key is received.

func (*Service) OnPrepare

func (*Service) OnPrepare(_ context.Context, _ uint64, _ string, _ []byte, _ uint32, _ []*core.Endpoint) error

OnPrepare is called when we receive a request from the given participant to prepare for DKG.

Jump to

Keyboard shortcuts

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