Skip to content

Add entrypoint to query zswap inputs/outputs #7

@andrew-fleming

Description

@andrew-fleming

In order to check the zswap inputs and outputs, you currently have to use the old syntax of manually setting the circuit ctx within the wrapper and returning the ctx. To avoid this, there should be a way to view the zswap state from the simulator class. Otherwise, you have to do it like this:

  public unsafeMint(
    recipient: Either<ZswapCoinPublicKey, ContractAddress>,
    amount: bigint,
  ): CircuitResults<AccountPrivateState, CoinInfo> {
    // Using the older method for executing a call
    // in order to see the zswap details.
    // There should be a utility func(s) to make this easier
    // in the simulator package
    const res = this.contract.impureCircuits.unsafeMint(
      this.circuitContext,
      recipient,
      amount,
    );

    this.circuitContext = res.context;
    return res;
  }

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions