Since the new update, my dapp has broken. As expected, and instructed from the official channels I updated my code.
I am passing in a prop to call my mint function, and the error im receiving is traced back to the RpcClient.mjs file. I have adjusted the code to follow the instructions to use the returned value instead of the copy.
const prepared = await this.prepareTransaction(transaction, signers);
transaction = prepared.transaction;
signers = prepared.signers;
const defaultFeePayer = this.getDefaultFeePayer();
if (!transaction.feePayer && defaultFeePayer) {
transaction.feePayer = defaultFeePayer.publicKey;
signers = [defaultFeePayer, ...signers];
}
const signedTransaction = await this.signTransaction(transaction, signers); // Use a new variable to store the signed transaction
const rawTransaction = signedTransaction.serialize(); // Serialize the signed transaction instead of the original one
try {
return await this.metaplex.connection.sendRawTransaction(rawTransaction, sendOptions);
} catch (error) {
throw this.parseProgramError(error, signedTransaction); // Pass the signed transaction instead of the original one
}
}````
The error:
````xt-dev.js:20 Error: Signature verification failed
at Transaction.serialize (index.browser.esm.js:1854:1)
at RpcClient.sendTransaction (RpcClient.mjs:62:1)
at async RpcClient.sendAndConfirmTransaction (RpcClient.mjs:91:1)
at async Promise.all (:3000/index 0)
w````
dependencies
```` "@civic/solana-gateway-react": "^0.11.0",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.60",
"@metaplex-foundation/js": "^0.18.3",
"@metaplex-foundation/mpl-candy-guard": "^0.2.0",
"@solana/spl-token": "^0.3.7",
"@solana/wallet-adapter-base": "^0.9.22",
"@solana/wallet-adapter-react": "^0.15.32",
"@solana/wallet-adapter-react-ui": "^0.9.31",
"@solana/wallet-adapter-wallets": "^0.19.16",
"@solana/web3.js": "^1.66.2",
"canvas-confetti": "^1.4.0",
"next": "12.3.1",
"react": "18.2.0",
"react-countdown": "^2.3.2",
"react-dom": "18.2.0",
"styled-components": "^5.3.1"````
It seems that I've adjusted the code properly, but somewhere along the passing through to the front end Im having an error I cannot figure out. Maybe I'm looking in the wrong place?
Thanks in advance.