Skip to content

Latest commit

 

History

History
150 lines (81 loc) · 3.28 KB

File metadata and controls

150 lines (81 loc) · 3.28 KB

@algorandfoundation/algokit-utils / testing / TransactionLogger

Class: TransactionLogger

testing.TransactionLogger

Allows you to keep track of Algorand transaction IDs by wrapping an Algodv2 in a proxy. Useful for automated tests.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new TransactionLogger(): TransactionLogger

Returns

TransactionLogger

Properties

_sentTransactionIds

Private _sentTransactionIds: string[] = []

Defined in

src/testing/transaction-logger.ts:12

Accessors

sentTransactionIds

get sentTransactionIds(): readonly string[]

The list of transaction IDs that has been logged thus far.

Returns

readonly string[]

Defined in

src/testing/transaction-logger.ts:17

Methods

capture

capture(algod): AlgodClient

Return a proxy that wraps the given Algodv2 with this transaction logger.

Parameters

Name Type Description
algod AlgodClient The Algodv2 to wrap

Returns

AlgodClient

The wrapped Algodv2, any transactions sent using this algod instance will be logged by this transaction logger

Defined in

src/testing/transaction-logger.ts:48


clear

clear(): void

Clear all logged IDs.

Returns

void

Defined in

src/testing/transaction-logger.ts:24


logRawTransaction

logRawTransaction(signedTransactions): void

The method that captures raw transactions and stores the transaction IDs.

Parameters

Name Type
signedTransactions Uint8Array | Uint8Array[]

Returns

void

Defined in

src/testing/transaction-logger.ts:31


waitForIndexer

waitForIndexer(algod, indexer): Promise<void>

Wait until indexer has the last round from algod.

Parameters

Name Type
algod AlgodClient
indexer IndexerClient

Returns

Promise<void>

Defined in

src/testing/transaction-logger.ts:53