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.
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.