state

package
v0.0.0-...-8887c1e Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PruneExpiredNonces

func PruneExpiredNonces()

PruneExpiredNonces removes expired nonces from the map.

func ValidateNonce

func ValidateNonce(address string, nonce Nonce) bool

ValidateNonce checks if a nonce associated with the address is valid.

Types

type IState

type IState interface {
	Copy() *Matrix
	Apply(state interface{}, callbackFunc func(data interface{}) error)
	IsValid() bool
	Randomize(probability float32)
	PrintASCII()
}

type Matrix

type Matrix struct {
	Data *mat.Dense
}

func (*Matrix) Apply

func (sm *Matrix) Apply(objs ...ObjectState)

func (*Matrix) Copy

func (sm *Matrix) Copy() *Matrix

func (*Matrix) PrintASCII

func (sm *Matrix) PrintASCII()

type Nonce

type Nonce struct {
	Address   string
	Value     []byte
	Hash      []byte
	Timestamp int64
}

func GenerateOrUpdateNonce

func GenerateOrUpdateNonce(address string) *Nonce

GenerateOrUpdateNonce creates or updates a nonce for the given address.

type ObjectState

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

Jump to

Keyboard shortcuts

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