Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jan 16, 2025
1 parent df8751e commit 4ee91c5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class FeeJuicePaymentMethodWithClaim extends FeeJuicePaymentMethod {
isStatic: false,
args: [
this.sender.toField(),
this.claim.claimAmount,
new Fr(this.claim.claimAmount),
this.claim.claimSecret,
new Fr(this.claim.messageLeafIndex),
],
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/aztec.js/src/utils/portal_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type L2Claim = {
};

/** L1 to L2 message info that corresponds to an amount to claim. */
export type L2AmountClaim = L2Claim & { /** Amount to claim */ claimAmount: Fr };
export type L2AmountClaim = L2Claim & { /** Amount to claim */ claimAmount: bigint };

/** L1 to L2 message info that corresponds to an amount to claim with associated recipient. */
export type L2AmountClaimWithRecipient = L2AmountClaim & {
Expand Down Expand Up @@ -173,7 +173,7 @@ export class L1FeeJuicePortalManager {
);

return {
claimAmount: new Fr(amount),
claimAmount: amount,
claimSecret,
claimSecretHash,
messageHash: log.args.key,
Expand Down Expand Up @@ -264,7 +264,7 @@ export class L1ToL2TokenPortalManager {
);

return {
claimAmount: new Fr(amount),
claimAmount: amount,
claimSecret,
claimSecretHash,
messageHash: log.args.key,
Expand Down Expand Up @@ -306,7 +306,7 @@ export class L1ToL2TokenPortalManager {
);

return {
claimAmount: new Fr(amount),
claimAmount: amount,
claimSecret,
claimSecretHash,
recipient: to,
Expand Down
5 changes: 4 additions & 1 deletion yarn-project/cli-wallet/src/utils/options/fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ export function parsePaymentMethod(
log(`Using Fee Juice for fee payments with claim for ${claimAmount} tokens`);
const { FeeJuicePaymentMethodWithClaim } = await import('@aztec/aztec.js/fee');
return new FeeJuicePaymentMethodWithClaim(sender.getAddress(), {
claimAmount: typeof claimAmount === 'string' ? Fr.fromHexString(claimAmount) : new Fr(claimAmount),
claimAmount: (typeof claimAmount === 'string'
? Fr.fromHexString(claimAmount)
: new Fr(claimAmount)
).toBigInt(),
claimSecret: Fr.fromHexString(claimSecret),
messageLeafIndex: BigInt(messageLeafIndex),
});
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/devnet/e2e_smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('End-to-end tests for devnet', () => {
.deploy({
fee: {
paymentMethod: new FeeJuicePaymentMethodWithClaim(l2Account.getAddress(), {
claimAmount: Fr.fromHexString(claimAmount),
claimAmount: Fr.fromHexString(claimAmount).toBigInt(),
claimSecret: Fr.fromHexString(claimSecret.value),
messageLeafIndex: BigInt(messageLeafIndex),
}),
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export const uniswapL1L2TestSuite = (
// 6. claim dai on L2
logger.info('Consuming messages to mint dai on L2');
await daiCrossChainHarness.consumeMessageOnAztecAndMintPrivately({
claimAmount: new Fr(daiAmountToBridge),
claimAmount: daiAmountToBridge,
claimSecret: secretForDepositingSwappedDai,
messageLeafIndex: tokenOutMsgIndex,
recipient: ownerAddress,
Expand Down

0 comments on commit 4ee91c5

Please sign in to comment.