testhelpers

package
v1.9.7-0...-38a7985 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: LGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package testhelpers is a generated GoMock package.

Package testhelpers is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSlotIdentityPreimage

func MakeSlotIdentityPreimage(t *testing.T, slot uint64) *shutter.IdentityPreimage

func MockDecryptionKeysEnvelopeData

func MockDecryptionKeysEnvelopeData(t *testing.T, opts MockDecryptionKeysEnvelopeDataOptions) []byte

func MockDecryptionKeysMsg

func MockDecryptionKeysMsg(topic string, envelopeData []byte) *pubsub.Message

func MockEonTrackerCreator

func MockEonTrackerCreator(opts ...MockEonTrackerCreatorOpt) func(t *testing.T) *MockEonTracker

func MockIdentityPreimages

func MockIdentityPreimages(t *testing.T, count uint64) shutter.IdentityPreimages

func MockIdentityPreimagesWithSlotIp

func MockIdentityPreimagesWithSlotIp(t *testing.T, slot uint64, count uint64) shutter.IdentityPreimages

func MockSlotCalculatorCreator

func MockSlotCalculatorCreator(opts ...MockSlotCalculatorCreatorOpt) func(t *testing.T) *MockSlotCalculator

func Signatures

func Signatures(t *testing.T, signers []Keyper, data shutter.DecryptionKeysSignatureData) [][]byte

func Uint64ToIdentityPreimage

func Uint64ToIdentityPreimage(t *testing.T, i uint64) *shutter.IdentityPreimage

Types

type CollectingLogHandler

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

func NewCollectingLogHandler

func NewCollectingLogHandler(handler log.Handler) *CollectingLogHandler

func (*CollectingLogHandler) Contains

func (clh *CollectingLogHandler) Contains(subStr string) bool

func (*CollectingLogHandler) ContainsAll

func (clh *CollectingLogHandler) ContainsAll(subStrs []string) bool

func (*CollectingLogHandler) FormattedRecords

func (clh *CollectingLogHandler) FormattedRecords() []string

func (*CollectingLogHandler) Log

func (clh *CollectingLogHandler) Log(r *log.Record) error

type CurrentEonMockResult

type CurrentEonMockResult struct {
	Eon shutter.Eon
	Ok  bool
}

type EonKeyGeneration

type EonKeyGeneration struct {
	EonIndex        shutter.EonIndex
	ActivationBlock uint64
	Threshold       uint64
	Keypers         []Keyper
	MaliciousKeyper Keyper
	EonPublicKey    *shuttercrypto.EonPublicKey
}

func MockEonKeyGeneration

func MockEonKeyGeneration(t *testing.T, idx shutter.EonIndex, threshold, numKeypers uint64) EonKeyGeneration

func (EonKeyGeneration) DecryptionKeys

func (ekg EonKeyGeneration) DecryptionKeys(t *testing.T, signers []Keyper, ips shutter.IdentityPreimages) []*proto.Key

func (EonKeyGeneration) Eon

func (ekg EonKeyGeneration) Eon() shutter.Eon

func (EonKeyGeneration) EpochSecretKey

func (ekg EonKeyGeneration) EpochSecretKey(t *testing.T, signers []Keyper, ip *shutter.IdentityPreimage) *shuttercrypto.EpochSecretKey

type EonTracker

type EonTracker interface {
	shutter.EonTracker
}

type Keyper

type Keyper struct {
	Index             int
	PrivateKey        *ecdsa.PrivateKey
	EonSecretKeyShare *shuttercrypto.EonSecretKeyShare
	EonPublicKeyShare *shuttercrypto.EonPublicKeyShare
}

func (Keyper) Address

func (k Keyper) Address() libcommon.Address

func (Keyper) EpochSecretKeyShare

func (k Keyper) EpochSecretKeyShare(ip *shutter.IdentityPreimage) *shuttercrypto.EpochSecretKeyShare

func (Keyper) PublicKey

func (k Keyper) PublicKey() ecdsa.PublicKey

type MockDecryptionKeysEnvelopeDataOptions

type MockDecryptionKeysEnvelopeDataOptions struct {
	EonIndex      shutter.EonIndex
	Keys          []*shutterproto.Key
	NilExtra      bool
	Slot          uint64
	TxnPointer    uint64
	SignerIndices []uint64
	Signatures    [][]byte
	InstanceId    uint64
	Version       string
}

type MockEonTracker

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

MockEonTracker is a mock of EonTracker interface.

func NewMockEonTracker

func NewMockEonTracker(ctrl *gomock.Controller) *MockEonTracker

NewMockEonTracker creates a new mock instance.

func (*MockEonTracker) CurrentEon

func (m *MockEonTracker) CurrentEon() (shutter.Eon, bool)

CurrentEon mocks base method.

func (*MockEonTracker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEonTracker) EonByBlockNum

func (m *MockEonTracker) EonByBlockNum(blockNum uint64) (shutter.Eon, bool)

EonByBlockNum mocks base method.

func (*MockEonTracker) RecentEon

func (m *MockEonTracker) RecentEon(index shutter.EonIndex) (shutter.Eon, bool)

RecentEon mocks base method.

func (*MockEonTracker) Run

func (m *MockEonTracker) Run(ctx context.Context) error

Run mocks base method.

type MockEonTrackerCreatorOpt

type MockEonTrackerCreatorOpt func(mock *MockEonTracker)

func WithCurrentEonMockResult

func WithCurrentEonMockResult(results ...CurrentEonMockResult) MockEonTrackerCreatorOpt

func WithRecentEonMockResult

func WithRecentEonMockResult(results ...RecentEonMockResult) MockEonTrackerCreatorOpt

type MockEonTrackerCurrentEonCall

type MockEonTrackerCurrentEonCall struct {
	*gomock.Call
}

MockEonTrackerCurrentEonCall wrap *gomock.Call

func (*MockEonTrackerCurrentEonCall) Do

Do rewrite *gomock.Call.Do

func (*MockEonTrackerCurrentEonCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockEonTrackerCurrentEonCall) Return

Return rewrite *gomock.Call.Return

type MockEonTrackerEonByBlockNumCall

type MockEonTrackerEonByBlockNumCall struct {
	*gomock.Call
}

MockEonTrackerEonByBlockNumCall wrap *gomock.Call

func (*MockEonTrackerEonByBlockNumCall) Do

Do rewrite *gomock.Call.Do

func (*MockEonTrackerEonByBlockNumCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockEonTrackerEonByBlockNumCall) Return

Return rewrite *gomock.Call.Return

type MockEonTrackerMockRecorder

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

MockEonTrackerMockRecorder is the mock recorder for MockEonTracker.

func (*MockEonTrackerMockRecorder) CurrentEon

CurrentEon indicates an expected call of CurrentEon.

func (*MockEonTrackerMockRecorder) EonByBlockNum

func (mr *MockEonTrackerMockRecorder) EonByBlockNum(blockNum any) *MockEonTrackerEonByBlockNumCall

EonByBlockNum indicates an expected call of EonByBlockNum.

func (*MockEonTrackerMockRecorder) RecentEon

RecentEon indicates an expected call of RecentEon.

func (*MockEonTrackerMockRecorder) Run

Run indicates an expected call of Run.

type MockEonTrackerRecentEonCall

type MockEonTrackerRecentEonCall struct {
	*gomock.Call
}

MockEonTrackerRecentEonCall wrap *gomock.Call

func (*MockEonTrackerRecentEonCall) Do

Do rewrite *gomock.Call.Do

func (*MockEonTrackerRecentEonCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockEonTrackerRecentEonCall) Return

Return rewrite *gomock.Call.Return

type MockEonTrackerRunCall

type MockEonTrackerRunCall struct {
	*gomock.Call
}

MockEonTrackerRunCall wrap *gomock.Call

func (*MockEonTrackerRunCall) Do

Do rewrite *gomock.Call.Do

func (*MockEonTrackerRunCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockEonTrackerRunCall) Return

Return rewrite *gomock.Call.Return

type MockSlotCalculator

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

MockSlotCalculator is a mock of SlotCalculator interface.

func NewMockSlotCalculator

func NewMockSlotCalculator(ctrl *gomock.Controller) *MockSlotCalculator

NewMockSlotCalculator creates a new mock instance.

func (*MockSlotCalculator) CalcCurrentSlot

func (m *MockSlotCalculator) CalcCurrentSlot() uint64

CalcCurrentSlot mocks base method.

func (*MockSlotCalculator) CalcSlot

func (m *MockSlotCalculator) CalcSlot(timestamp uint64) (uint64, error)

CalcSlot mocks base method.

func (*MockSlotCalculator) CalcSlotAge

func (m *MockSlotCalculator) CalcSlotAge(slot uint64) time.Duration

CalcSlotAge mocks base method.

func (*MockSlotCalculator) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSlotCalculator) SecondsPerSlot

func (m *MockSlotCalculator) SecondsPerSlot() uint64

SecondsPerSlot mocks base method.

type MockSlotCalculatorCalcCurrentSlotCall

type MockSlotCalculatorCalcCurrentSlotCall struct {
	*gomock.Call
}

MockSlotCalculatorCalcCurrentSlotCall wrap *gomock.Call

func (*MockSlotCalculatorCalcCurrentSlotCall) Do

Do rewrite *gomock.Call.Do

func (*MockSlotCalculatorCalcCurrentSlotCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockSlotCalculatorCalcCurrentSlotCall) Return

Return rewrite *gomock.Call.Return

type MockSlotCalculatorCalcSlotAgeCall

type MockSlotCalculatorCalcSlotAgeCall struct {
	*gomock.Call
}

MockSlotCalculatorCalcSlotAgeCall wrap *gomock.Call

func (*MockSlotCalculatorCalcSlotAgeCall) Do

Do rewrite *gomock.Call.Do

func (*MockSlotCalculatorCalcSlotAgeCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockSlotCalculatorCalcSlotAgeCall) Return

Return rewrite *gomock.Call.Return

type MockSlotCalculatorCalcSlotCall

type MockSlotCalculatorCalcSlotCall struct {
	*gomock.Call
}

MockSlotCalculatorCalcSlotCall wrap *gomock.Call

func (*MockSlotCalculatorCalcSlotCall) Do

Do rewrite *gomock.Call.Do

func (*MockSlotCalculatorCalcSlotCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockSlotCalculatorCalcSlotCall) Return

Return rewrite *gomock.Call.Return

type MockSlotCalculatorCreatorOpt

type MockSlotCalculatorCreatorOpt func(mock *MockSlotCalculator)

func WithCalcCurrentSlotMockResult

func WithCalcCurrentSlotMockResult(results ...uint64) MockSlotCalculatorCreatorOpt

type MockSlotCalculatorMockRecorder

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

MockSlotCalculatorMockRecorder is the mock recorder for MockSlotCalculator.

func (*MockSlotCalculatorMockRecorder) CalcCurrentSlot

CalcCurrentSlot indicates an expected call of CalcCurrentSlot.

func (*MockSlotCalculatorMockRecorder) CalcSlot

CalcSlot indicates an expected call of CalcSlot.

func (*MockSlotCalculatorMockRecorder) CalcSlotAge

CalcSlotAge indicates an expected call of CalcSlotAge.

func (*MockSlotCalculatorMockRecorder) SecondsPerSlot

SecondsPerSlot indicates an expected call of SecondsPerSlot.

type MockSlotCalculatorSecondsPerSlotCall

type MockSlotCalculatorSecondsPerSlotCall struct {
	*gomock.Call
}

MockSlotCalculatorSecondsPerSlotCall wrap *gomock.Call

func (*MockSlotCalculatorSecondsPerSlotCall) Do

Do rewrite *gomock.Call.Do

func (*MockSlotCalculatorSecondsPerSlotCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockSlotCalculatorSecondsPerSlotCall) Return

Return rewrite *gomock.Call.Return

type RecentEonMockResult

type RecentEonMockResult struct {
	Eon shutter.Eon
	Ok  bool
}

type SlotCalculator

type SlotCalculator interface {
	shutter.SlotCalculator
}

Jump to

Keyboard shortcuts

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