Help us shape the future of Go! Take the 2026 Go Developer Survey

verify

package
v1.30.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Overview

Package verify is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSameChainID      = errors.New("same chainID")
	ErrMismatchedNetIDs = errors.New("mismatched netIDs")
)

Functions

func All

func All(verifiables ...Verifiable) error

All returns nil if all the verifiables were verified with no errors

func SameChain added in v1.22.84

func SameChain(ctx context.Context, consensusRuntime *runtime.Runtime, peerChainID ids.ID) error

SameChain verifies that the peerChainID is in the same network as the chain represented by consensusRuntime, but not the same chain. This is a convenience wrapper for coreth compatibility that accepts *runtime.Runtime directly. With the simplified NetworkID model (1=mainnet, 2=testnet), chains on the same network are always in the same "chain".

func SameNet added in v1.16.56

func SameNet(ctx context.Context, chainRuntime *ChainContext, peerChainID ids.ID) error

SameNet verifies that the provided [ctx] was provided to a chain in the same chain as [peerChainID], but not the same chain. If this verification fails, a non-nil error will be returned.

Types

type ChainContext added in v1.16.56

type ChainContext struct {
	ChainID        ids.ID
	NetID          ids.ID
	ValidatorState ValidatorState
}

ChainContext provides context for chain operations

type ConsensusValidatorState added in v1.16.56

type ConsensusValidatorState interface {
	GetNetworkID(chainID ids.ID) (ids.ID, error)
}

ConsensusValidatorState wraps the Runtime ValidatorState interface

type IsNotState added in v0.1.1

type IsNotState = vmverify.IsNotState

type IsState added in v0.1.1

type IsState = vmverify.IsState

type MockVerifiable added in v1.1.11

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

MockVerifiable is a mock of Verifiable interface.

func NewMockVerifiable added in v1.1.11

func NewMockVerifiable(ctrl *gomock.Controller) *MockVerifiable

NewMockVerifiable creates a new mock instance.

func (*MockVerifiable) EXPECT added in v1.1.11

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

func (*MockVerifiable) Verify added in v1.1.11

func (m *MockVerifiable) Verify() error

Verify mocks base method.

type MockVerifiableMockRecorder added in v1.1.11

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

MockVerifiableMockRecorder is the mock recorder for MockVerifiable.

func (*MockVerifiableMockRecorder) Verify added in v1.1.11

func (mr *MockVerifiableMockRecorder) Verify() *gomock.Call

Verify indicates an expected call of Verify.

type State added in v0.1.1

type State = vmverify.State

type ValidatorState added in v1.16.56

type ValidatorState interface {
	GetNetworkID(chainID ids.ID) (ids.ID, error)
}

ValidatorState provides validator state lookups

type Verifiable

type Verifiable = vmverify.Verifiable

Directories

Path Synopsis
Package verifymock is a generated GoMock package.
Package verifymock is a generated GoMock package.

Jump to

Keyboard shortcuts

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