Skip to main content

wait_for_consumable_notes

Function wait_for_consumable_notes 

Source
pub async fn wait_for_consumable_notes(
    client: &mut TestClient,
    account_id: AccountId,
    max_blocks: u32,
) -> Vec<(InputNoteRecord, Vec<NoteConsumability>)>
Available on crate features std and testing only.
Expand description

Syncs repeatedly until the given account has at least one consumable note, or until max_blocks have elapsed since the call. Returns the list of consumable notes once found.

This is useful when waiting for a network transaction to produce an output note (e.g., a P2ID note created by a faucet after consuming a CLAIM note), where the exact number of blocks needed is unpredictable.

ยงPanics

Panics if max_blocks elapse without any consumable notes appearing.