nonce

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
	PeekNonce(account common.Address) (uint64, error)
	ResetNonce(ctx context.Context, account common.Address) error
	EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
	SuggestGasPrice(ctx context.Context) (*big.Int, error)
}

type MemoryStorage

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

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

func (*MemoryStorage) GetNonce

func (s *MemoryStorage) GetNonce(account common.Address) (uint64, error)

func (*MemoryStorage) NonceLockFrom

func (s *MemoryStorage) NonceLockFrom(from common.Address) sync.Locker

func (*MemoryStorage) SetNonce

func (s *MemoryStorage) SetNonce(account common.Address, nonce uint64) error

type RedisStorage

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

func NewRedisStorage

func NewRedisStorage(chainId *big.Int, pool redis.Pool) *RedisStorage

func (*RedisStorage) GetNonce

func (s *RedisStorage) GetNonce(account common.Address) (uint64, error)

func (*RedisStorage) NonceLockFrom

func (s *RedisStorage) NonceLockFrom(from common.Address) sync.Locker

func (*RedisStorage) SetNonce

func (s *RedisStorage) SetNonce(account common.Address, nonce uint64) error

type SimpleManager

type SimpleManager struct {
	Storage
	// contains filtered or unexported fields
}

func GetSimpleManager

func GetSimpleManager(backend ethBackend, storage Storage) (*SimpleManager, error)

func NewSimpleManager

func NewSimpleManager(backend ethBackend, storage Storage) (*SimpleManager, error)

func (*SimpleManager) EstimateGas added in v0.1.0

func (nm *SimpleManager) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)

func (*SimpleManager) PeekNonce

func (nm *SimpleManager) PeekNonce(account common.Address) (uint64, error)

func (*SimpleManager) PendingNonceAt

func (nm *SimpleManager) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

func (*SimpleManager) ResetNonce

func (nm *SimpleManager) ResetNonce(ctx context.Context, account common.Address) error

func (*SimpleManager) SuggestGasPrice

func (nm *SimpleManager) SuggestGasPrice(ctx context.Context) (gasPrice *big.Int, err error)

type Storage

type Storage interface {
	NonceLockFrom(from common.Address) sync.Locker
	// without locks
	GetNonce(account common.Address) (uint64, error)
	// without locks
	SetNonce(account common.Address, nonce uint64) error
}

Jump to

Keyboard shortcuts

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