mock

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 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 (s *Service) OnAbort(ctx context.Context, sender uint64, account string) error

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

func (*Service) OnCommit

func (s *Service) OnCommit(ctx context.Context, sender uint64, account string, confirmationData []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 (s *Service) OnContribute(ctx context.Context, sender uint64, account string, secret bls.SecretKey, vVec []bls.PublicKey) (bls.SecretKey, []bls.PublicKey, error)

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

func (*Service) OnExecute

func (s *Service) OnExecute(ctx context.Context, sender uint64, account string) error

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

func (*Service) OnGenerate

func (s *Service) OnGenerate(ctx context.Context, credentials *checker.Credentials, account string, passphrase []byte, threshold uint32, numParticipants uint32) ([]byte, []*core.Endpoint, error)

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

func (*Service) OnPrepare

func (s *Service) OnPrepare(ctx context.Context, sender uint64, account string, passphrase []byte, threshold uint32, participants []*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