1

When running anchor test on my solana program it complains that the IDL is missing the metadata.address field. But when I add it, it disappears again after running anchor test. My program built fine.

Also, the field "metadata" gives an error: "Object literal may only specify known properties, and '"metadata"' does not exist in type LossHarvester"

I also tried adding it then running anchor deploy as per this post: Anchor IDL address missing from json

export const IDL: LossHarvester = {
  "version": "0.1.0",
  "name": "loss_harvester",
  "metadata": {
    "address": "[PROGRAM_PUB_KEY]"
  },
...rest of code

Beginning of my program:

#[program]
pub mod loss_harvester {
    use super::*;

    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {

Am I missing something here? Using anchor 0.29 with Solana 1.18.1. Something to note is that I started out with the hello-world template and renamed everything to loss-harvester.

2 Answers 2

1

SOLVED. I forgot to update the program name in one of the fields in Cargo.toml

-1

export const IDL: LossHarvester = { "version": "0.1.0", "name": "loss_harvester", "metadata": { "address": "[PROGRAM_PUB_KEY]" }, ...rest of code #[program] pub mod loss_harvester { use super::*;

pub fn initialize(ctx: Context<Initialize>) -> Result<()> {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.