1

我的 Anchor 程序给了我一个Transaction simulation failed: Error processing Instruction 1: custom program error: 0xa7在日志中没有任何用处的信息。

我什至如何开始调试呢?

4

1 回答 1

1

自定义程序错误 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然后查看它是否与您文件中的公钥匹配。

于 2021-12-26T03:36:12.930 回答