nonce

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: AGPL-3.0 Imports: 5 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
	SyncNetworkNonce(context.Context, string) (uint64, error)
	SetNewAccountNonce(context.Context, string) 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 {
	RedisPool    *redispool.RedisPool
	CeloProvider *celoutils.Provider
}

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) SetNewAccountNonce

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

func (*RedisNoncestore) SyncNetworkNonce

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

Jump to

Keyboard shortcuts

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