prepare_fee_juice_on_l1

Function prepare_fee_juice_on_l1 

Source
pub async fn prepare_fee_juice_on_l1(
    eth_client: &EthClient,
    l1_addresses: &L1ContractAddresses,
    recipient: &AztecAddress,
) -> Result<FeeJuiceBridgeResult, Error>
Expand description

Mint Fee Juice on L1 and bridge it to L2 via the Fee Juice Portal.

Mirrors upstream GasBridgingTestHarness.prepareTokensOnL1():

  1. Queries getMintAmount() from the FeeAssetHandler
  2. Mints ERC-20 tokens on L1
  3. Approves the portal to spend them
  4. Calls depositToAztecPublic on the portal
  5. Parses the DepositToAztecPublic event for the message leaf index

Returns the claim data needed for FeeJuicePaymentMethodWithClaim.