nonce

package
v0.6.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Noncestore

type Noncestore interface {
	Peek(context.Context, string) (uint64, error)
	Acquire(context.Context, string) (uint64, error)
	Return(context.Context, string) error
	SetAccountNonce(context.Context, string, uint64) error
}

Noncestore defines how a nonce store should be implemented for any storage backend.

func NewRedisNoncestore

func NewRedisNoncestore(o Opts) Noncestore

type Opts

type Opts struct {
	ChainProvider *celoutils.Provider
	RedisPool     *redispool.RedisPool
	Store         store.Store
}

type RedisNoncestore

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

RedisNoncestore implements `Noncestore`

func (*RedisNoncestore) Acquire

func (n *RedisNoncestore) Acquire(ctx context.Context, publicKey string) (uint64, error)

func (*RedisNoncestore) Peek

func (n *RedisNoncestore) Peek(ctx context.Context, publicKey string) (uint64, error)

func (*RedisNoncestore) Return

func (n *RedisNoncestore) Return(ctx context.Context, publicKey string) error

func (*RedisNoncestore) SetAccountNonce

func (n *RedisNoncestore) SetAccountNonce(ctx context.Context, publicKey string, nonce uint64) error

Jump to

Keyboard shortcuts

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