Skip to content

Implement LocalPendingTransctionStorage #4391

@konstantinabl

Description

@konstantinabl

Motivation
We need light-weight storage, which will store pending transactions list when relay is not using Redis. An in-memory store avoids external dependencies and lets us test TransactionPool logic without a real Redis server.

Description
Create a class LocalPendingTransactionStorage that implements PendingTransactionStorage.
Internally use a Map<string, Set> (address → set of tx hashes) and another Map<string, bytes> (txHash -> tx rlp encoded). This will be used in the future for endpoints requiring the whole pool to be returned

The class needs to have the following methods:

  • getList(address: string): Promise
  • addTransaction(address: string, txHash: string): Promise
  • removeTransaction(address: string, txHash: string): Promise
  • removeAll(): Promise

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions