'Anchor,Solana -> failed to send transaction: Transaction simulation failed Custom Error 0x0
I am trying to build a simple coin flip game in solana.
I get this error: Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0
I followed some tutorials on how to use PDA's but couldn't find a report/workaround to an error as such.
Tests are running on localhost
I did some research and it might be that the account was already initialized ( maybe, no idea)
the part that is giving the error:
try {
await program.rpc.initialize(bump,
{
accounts: {
treasury: treasuryPda, // publickey for our new account
user: provider.wallet.publicKey,
systemProgram: SystemProgram.programId // just for Anchor reference
},
});
} catch (error) {
console.log("Transaction error: ", error);
console.log("blabla:", error.toString());
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|