da

package
v1.0.0-beta.10 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressSelector

type AddressSelector interface {
	// Next returns the next address to use for signing.
	// Implementations may return empty string (NoOpSelector) or panic (RoundRobinSelector with no addresses).
	Next() string
}

AddressSelector defines the interface for selecting a signing address from a list.

type NoOpSelector

type NoOpSelector struct{}

NoOpSelector always returns an empty string. Used when no signing addresses are configured.

func NewNoOpSelector

func NewNoOpSelector() *NoOpSelector

NewNoOpSelector creates a selector that returns no address.

func (*NoOpSelector) Next

func (s *NoOpSelector) Next() string

Next returns an empty string.

type RoundRobinSelector

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

RoundRobinSelector implements round-robin selection of signing addresses. This helps prevent sequence mismatches in Cosmos SDK when submitting multiple transactions concurrently.

func NewRoundRobinSelector

func NewRoundRobinSelector(addresses []string) *RoundRobinSelector

NewRoundRobinSelector creates a new round-robin address selector. Panics if addresses is empty - use NewNoOpSelector instead.

func (*RoundRobinSelector) Next

func (s *RoundRobinSelector) Next() string

Next returns the next address in round-robin fashion. Thread-safe for concurrent access. Panics if no addresses are configured - this indicates a programming error.

Jump to

Keyboard shortcuts

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