Skip to content

Conversation

@rohan-agarwal-coinbase
Copy link
Contributor

@rohan-agarwal-coinbase rohan-agarwal-coinbase commented Sep 6, 2024

What changed? Why?

Updates getDefaultAddress and getAddress to fetch addresses if it is not loaded/cached, which occurs right when creating a new wallet.

This PR tightens the interfaces for both functions. getDefaultAddress no longer returns undefined and throws an error. getAddress now returns a Promise<WalletAddress> instead of Address since it calls listAddresses. This is backward-incompatible

Testing

Updated unit tests. I also wrote and ran a test script locally that succeeds to get the default address after fetching a wallet, which was earlier failing.

Qualified Impact

Getting addresses has changed with new side effects, and the interfaces have changed in an backward-incompatible way so fixing issues would require client-side changes.

@cb-heimdall
Copy link

cb-heimdall commented Sep 6, 2024

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@rohan-agarwal-coinbase rohan-agarwal-coinbase changed the base branch from master to v0.4.0 September 6, 2024 16:48
@rohan-agarwal-coinbase rohan-agarwal-coinbase marked this pull request as ready for review September 6, 2024 21:21
@John-peterson-coinbase
Copy link
Contributor

Since this is a breaking change, we will need to update README.md examples, the quickstarts in ./quickstart-template, and CDP docs

@rohan-agarwal-coinbase
Copy link
Contributor Author

Since this is a breaking change, we will need to update README.md examples, the quickstarts in ./quickstart-template, and CDP docs

thanks @John-peterson-coinbase i updated the PR:

  • updated changelog
  • Updated README and quickstart templates that used getDefaultAddress
  • I also deleted some no longer useful tests, which dropped the jest coverage, so i modified jest config thresholds

Will update the CDP docs next

@rohan-agarwal-coinbase rohan-agarwal-coinbase merged commit 98687bf into v0.4.0 Sep 6, 2024
@rohan-agarwal-coinbase rohan-agarwal-coinbase deleted the rohan/default-address-fix branch September 6, 2024 23:39
rohan-agarwal-coinbase added a commit that referenced this pull request Sep 7, 2024
* Remove yarn.lock file since we use npm to build (#218)
* Update getDefaultAddress and getAddress to fetch addresses if not loaded (#217)
* Bump package to 0.4.0 to prepare for release (#224)

---------

Co-authored-by: Howard Xie <howard.xie@coinbase.com>
Co-authored-by: cb-howardatcb <86798563+howard-at-cb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants