Fix WalletConnect signing on iOS - #984
Merged
Merged
Conversation
ConnectionsStore.getConnection never requested accounts and built the wallet through a WalletRecord.mapToWallet() overload that hardcoded accounts: []. After WalletConnect moved into Core, rules::session_account resolves the signing account from that list, so every sign request failed with "wallet has no <chain> account" on every chain. Delete the accountless overload so a Wallet can only be built through WalletRecordInfo, which requires the accounts, and let the three call sites hold WalletRecordInfo instead of reassembling the pair by hand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signing anything through WalletConnect on iOS was failing — sign message, sign transaction and send transaction, on every chain.
The wallet handed to the signing code came without its accounts, so it could not tell which account to sign with.
Now the accounts are always loaded together with the wallet, and the shortcut that allowed building a wallet without them is gone.