Skip to content

fix: make getLinkedAgw parameters optional#419

Open
aproskill81 wants to merge 1 commit intoAbstract-Foundation:mainfrom
aproskill81:fix/get-linked-agw-optional-params
Open

fix: make getLinkedAgw parameters optional#419
aproskill81 wants to merge 1 commit intoAbstract-Foundation:mainfrom
aproskill81:fix/get-linked-agw-optional-params

Conversation

@aproskill81
Copy link
Copy Markdown

@aproskill81 aproskill81 commented Mar 25, 2026

The getLinkedAgw action already falls back to client.account?.address when no address is provided, but its signature still required a GetLinkedAgwParameters object.

This makes the second argument optional so consumers can call getLinkedAgw(client) directly, matching the existing behavior exposed through linkableWalletActions().getLinkedAgw() and reducing unnecessary boilerplate.

Changes

  • make parameters optional in getLinkedAgw
  • add a unit test covering direct action usage without parameters

Risk

Low. This is a small additive API improvement with no change to the existing fallback/error behavior.


PR-Codex overview

This PR introduces a default parameter for the getLinkedAgw function and adds a comprehensive test suite for it, ensuring that the function behaves correctly when parameters are omitted.

Detailed summary

  • Updated getLinkedAgw function to have a default value for parameters.
  • Added test cases in getLinkedAgw.test.ts to verify functionality.
  • Mocked readContract to simulate contract interactions.
  • Checked that getLinkedAgw uses the connected account when no parameters are provided.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 25, 2026

⚠️ No Changeset found

Latest commit: 791cb36

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 25, 2026

PR Summary

Low Risk
Low risk: this only relaxes the getLinkedAgw call signature to allow omitting the params object and adds a unit test; runtime behavior and validation paths remain the same.

Overview
getLinkedAgw now defaults its parameters argument to {}, allowing consumers to call getLinkedAgw(client) and rely on the existing fallback to client.account?.address.

Adds a unit test that mocks readContract and verifies the no-parameters call uses the connected account and returns the linked AGW address.

Written by Cursor Bugbot for commit 791cb36. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant