Closed ivnsch closed 1 year ago
I happened to send a transaction group with one already signed tx:
{ txn: Buffer.from(signedTxMsgPack).toString("base64"), message: "", signers: [], }
The wallet returns this error:
Error: Signing Error: Network mismatch between dApp and Wallet. For example, Wallet is connected to TestNet and dApp connected to MainNet (or vice versa).
I dug a bit in the code, the problem seems to be that the incorrect payload is managed as a WCTransaction with no parsed details (WCTransactionDetail is nil). Later, there's a validation of the transaction list: https://github.com/algorand/algorand-wallet/blob/master/ios/Classes/Utility/WalletConnect/Transaction/WCTransactionValidator.swift#L32 where it validates first the network, and this: https://github.com/algorand/algorand-wallet/blob/master/ios/Classes/Models/WalletConnect/Transaction/WCTransaction.swift#L205 return false.
WCTransaction
WCTransactionDetail
nil
It could make sense to validate first WCTransactionDetail, or reject invalid transactions directly when parsing.
Thanks for this detailed feedback. cc @sakkaras
We've reviewed this case and confirmed that we are now properly handling this case.
I happened to send a transaction group with one already signed tx:
The wallet returns this error:
I dug a bit in the code, the problem seems to be that the incorrect payload is managed as a
WCTransaction
with no parsed details (WCTransactionDetail
isnil
). Later, there's a validation of the transaction list: https://github.com/algorand/algorand-wallet/blob/master/ios/Classes/Utility/WalletConnect/Transaction/WCTransactionValidator.swift#L32 where it validates first the network, and this: https://github.com/algorand/algorand-wallet/blob/master/ios/Classes/Models/WalletConnect/Transaction/WCTransaction.swift#L205 return false.It could make sense to validate first
WCTransactionDetail
, or reject invalid transactions directly when parsing.