Skip to content

Improve the WalletRegistry.getWalletPublicKey function#821

Open
r-czajkowski wants to merge 1 commit intomainfrom
improve-get-wallet-public-key
Open

Improve the WalletRegistry.getWalletPublicKey function#821
r-czajkowski wants to merge 1 commit intomainfrom
improve-get-wallet-public-key

Conversation

@r-czajkowski
Copy link
Copy Markdown
Contributor

@r-czajkowski r-czajkowski commented Jul 26, 2024

Cloese: #815

Skip retrying when the contract throws an error saying the wallet with the given ID has not been registered. There is no need to retry this request because the contract responds with the exact reason - the wallet does not exist. As Łukasz mentioned in #815 it happens because closed/terminated wallets are no longer in the contract state so, getWalletCompressedPublicKey throws while calling getWalletPublicKey.

Skip retrying when the contract throws an error saying the wallet with
the given ID has not been registered. There is no need to retry this
request because the contract responds with the exact reason - the wallet
does not exist.
@r-czajkowski r-czajkowski force-pushed the improve-get-wallet-public-key branch from 20f9087 to 3c1af2c Compare July 26, 2024 12:14
@r-czajkowski r-czajkowski changed the title Improve the WalletRegistry.getWalletPublicKey fn Improve the WalletRegistry.getWalletPublicKey function Jul 26, 2024
@r-czajkowski r-czajkowski added the 🔌 typescript TypeScript library label Jul 26, 2024
this._totalRetryAttempts,
undefined,
undefined,
skipRetryWhenMatched(["Wallet with the given ID has not been registered"])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure we can safely skip this error. We want to work around the problem in the redemption process, but the getWalletPublicKey function can be used in other processes as well.
If someone calls getWalletPublicKey right after a fresh wallet creation there is a chance that chain endpoint hasn't synced yet and the retry would be desirable here.

Maybe we should add an optional argument skipRetryWhenNotRegistered = false and use this variant only in the redemption process?

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

Labels

🔌 typescript TypeScript library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants