Skip to content

Conversation

@AryanGodara
Copy link
Member

@AryanGodara AryanGodara commented May 20, 2025

Description

Closes: HAPPY-552

Updated the boopFromTransaction function to use the provided account as a fallback when tx.from is not available. This ensures the function can handle transactions where the sender information might be missing.

I went through the surrounding code flow (from request handlers to utils inside iframe/src/requests). But I couldn't find any other thing which had to be tweaked, as there was no description for the linear issue, only title 😅

Toggle Checklist

Checklist

Basics

  • B1. I have applied the proper label & proper branch name (e.g. norswap/build-system-caching).
  • B2. This PR is not so big that it should be split & addresses only one concern.
  • B3. The PR targets the lowest branch it can (ideally master).

Reminder: PR review guidelines

Correctness

  • C1. Builds and passes tests.

  • C2. The code is properly parameterized & compatible with different environments (e.g. local,
    testnet, mainnet, standalone wallet, ...).

  • C3. I have manually tested my changes & connected features.

  • C4. I have performed a thorough self-review of my code after submitting the PR,
    and have updated the code & comments accordingly.

Architecture & Documentation

  • D1. I made it easy to reason locally about the code, by (1) using proper abstraction boundaries,
    (2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
  • D2. All public-facing APIs are documented in the docs.
    Public APIS and meaningful (non-local) internal APIs are properly documented in code comments.
  • D3. If appropriate, the general architecture of the code is documented in a code comment or
    in a Markdown document.
  • D4. An appropriate Changeset has been generated (and committed) with make changeset for
    breaking and meaningful changes in packages (not required for cleanups & refactors).

Copy link
Member Author

AryanGodara commented May 20, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@AryanGodara AryanGodara changed the title fix: fallback to provided account when tx.from is undefined in boop utility Use tx.from fallback to account in boopFromTransaction May 20, 2025
@AryanGodara AryanGodara changed the title Use tx.from fallback to account in boopFromTransaction Use tx.from fallback to account in boopFromTransaction in iframe sendBoop func May 20, 2025
@linear
Copy link

linear bot commented May 20, 2025

@AryanGodara AryanGodara marked this pull request as ready for review May 20, 2025 06:56
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 20, 2025

Deploying happychain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 44815eb
Status: ✅  Deploy successful!
Preview URL: https://465dd754.happychain.pages.dev
Branch Preview URL: https://aryan-txfrom-in-sendboop-opt.happychain.pages.dev

View logs

@AryanGodara AryanGodara requested a review from aodhgan May 20, 2025 06:56
@AryanGodara AryanGodara changed the base branch from aryan/leaderboard-auth to graphite-base/790 May 20, 2025 06:57
@AryanGodara AryanGodara force-pushed the aryan/txfrom-in-sendBoop-optional branch from 932198e to 22a646c Compare May 20, 2025 06:57
@AryanGodara AryanGodara changed the base branch from graphite-base/790 to master May 20, 2025 06:57
@AryanGodara AryanGodara force-pushed the aryan/txfrom-in-sendBoop-optional branch 2 times, most recently from d53296d to 0c759eb Compare May 21, 2025 10:13
dest: tx.to,
payer: zeroAddress, // happyPaymaster, // TODO need to fund paymaster
value: tx.value ? BigInt(tx.value) : 0n,
value: tx.value !== undefined ? (parseBigInt(tx.value) ?? 0n) : 0n,
Copy link
Collaborator

@norswap norswap May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of how parseBigInt (one of our utility function) works, all of these can be parseBigInt(thing) ?? fallback — I actually completely coincidentally made the change in the PR I'm working on, so this can stay like this.

@norswap norswap force-pushed the aryan/txfrom-in-sendBoop-optional branch from 77b0a49 to d1fd9e6 Compare May 22, 2025 00:24
@norswap norswap merged commit a742b95 into master May 22, 2025
3 checks passed
@norswap norswap deleted the aryan/txfrom-in-sendBoop-optional branch May 22, 2025 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants