Skip to content

Transaction re-execution fails without authenticator and basic auth #2092

@PhilippGackstatter

Description

@PhilippGackstatter

Re-execution of transaction fails on v0.12.2 when basic authentication is used:

#[tokio::test]
async fn reexecution_fails() -> anyhow::Result<()> {
    let mut builder = MockChain::builder();
    let account = builder.add_existing_mock_account(Auth::BasicAuth)?;
    let note = builder.add_p2id_note(
        ACCOUNT_ID_SENDER.try_into()?,
        account.id(),
        &[FungibleAsset::mock(3)],
        NoteType::Public,
    )?;
    let chain = builder.build()?;

    let tx = chain
        .build_tx_context(account.id(), &[note.id()], &[])?
        .build()?
        .execute()
        .await?;

    let _reexecuted_tx = chain
        .build_tx_context(account.id(), &[note.id()], &[])?
        .authenticator(None)
        .tx_inputs(tx.tx_inputs().clone())
        .build()?
        .execute()
        .await?;

    Ok(())
}

The _reexecuted_tx line fails with:

Error: failed to respond to signature requested since no authenticator is assigned to the host

The signature generated by the authenticator should be added to the tx inputs after execution, and so providing an authenticator should not be necessary (here passing None) when passing in the tx inputs from the already executed tx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rustIssues that affect or pull requests that update Rust code

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions