bugDebugWriteResult

Result from debug shielded write

Result from a debug shielded write (.dwrite namespace).

Overview

DebugWriteResult is returned by .dwrite methods, providing both plaintext and encrypted views of the transaction along with the transaction hash. The transaction is broadcast (like .write), but you also get inspection data for debugging.

Definition

@dataclass(frozen=True)
class DebugWriteResult:
    """Result from a debug shielded write (dwrite).

    The transaction is broadcast (like .write), but the caller
    also gets both the plaintext and encrypted views for inspection.
    """
    plaintext_tx: PlaintextTx
    shielded_tx: UnsignedSeismicTx
    tx_hash: HexBytes

Fields

Field
Type
Description

plaintext_tx

Transaction parameters with unencrypted calldata

shielded_tx

Full unsigned TxSeismic with encrypted calldata

tx_hash

HexBytes

Transaction hash from eth_sendRawTransaction

Examples

Basic Usage

Wait for Receipt

Compare Plaintext vs Encrypted

Inspect Transaction Fields

Debug Encryption

Gas Analysis

Behavior

Transaction is Broadcast

Unlike a dry run, .dwrite actually broadcasts the transaction:

  • The shielded transaction (with encrypted data) is sent

  • The transaction is included in a block

  • State changes are applied

  • Gas is consumed

Both Views Provided

You get both perspectives:

  • Plaintext - What the function call looks like before encryption

  • Shielded - What actually got broadcast (with encrypted calldata)

This is useful for:

  • Debugging calldata encoding

  • Verifying encryption is working

  • Inspecting transaction parameters

  • Testing before production

Use Cases

Development and Testing

Debugging Encryption Issues

Auditing Transaction Parameters

Properties

  • Immutable - Cannot be modified after construction (frozen=True)

  • Transaction broadcast - The shielded tx is actually sent

  • Debug only - Use .write in production

Warnings

  • Real transactions - .dwrite consumes gas and changes state

  • Not a dry run - The transaction is actually broadcast

  • Use .write in production - .dwrite is for debugging only

  • Cost - Costs gas just like .write

Production Alternative

For production code, use .write instead:

The .write method returns just the transaction hash, without debug information.

Notes

  • Only available on shielded contracts with .dwrite namespace

  • The shielded_tx field is unsigned (signature not included)

  • The broadcast transaction includes the signature (added by SDK)

  • Useful for debugging but adds overhead

See Also

Last updated