【发布时间】:2021-12-26 03:36:12
【问题描述】:
我的 Anchor 程序给了我一个Transaction simulation failed: Error processing Instruction 1: custom program error: 0xa7,日志中没有任何用处。
我什至如何开始调试呢?
【问题讨论】:
标签: anchor solana anchor-solana
我的 Anchor 程序给了我一个Transaction simulation failed: Error processing Instruction 1: custom program error: 0xa7,日志中没有任何用处。
我什至如何开始调试呢?
【问题讨论】:
标签: anchor solana anchor-solana
自定义程序错误 0xa7 是 Error: 167: The given account is not owned by the executing program.
如果您传入的帐户应该归某个程序所有,但实际上并非如此,则可能会发生这种情况。
如果您忘记将 declare_id!(/* ... */) 设置为您尝试点击的程序 ID,这可能会意外发生。
考虑记录您在 javascript 客户端中使用的程序 ID:
console.log(program.programId)
然后查看它是否与您的 target/idl/yourprogram.json 文件中的公钥匹配。
【讨论】: