Skip to content

创建文章

We are looking for publications that demonstrate building dApps or smart contracts!
See the full list of Gitcoin bounties that are eligible for rewards.

testing.TransactionLogger

@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): default

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

Parameters
Name Type Description
algod default The Algodv2 to wrap
Returns

default

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(indexer): Promise\<void>

Wait until all logged transactions IDs appear in the given Indexer.

Parameters
Name Type
indexer default
Returns

Promise\<void>

Defined in

src/testing/transaction-logger.ts:53