Is there a way have anchor check the correct program ID owner of an account depending on which cluster the program has been deployed to?
Currently I have to manually check both program IDs, the devnet and mainnet program IDs, to see whether the account has the correct owner.
There must be a built in solana or anchor way of switching between the program IDs at compile time?
let owner = *aggregator.owner;
if owner != SWITCHBOARD_V2_DEVNET && owner != SWITCHBOARD_V2_MAINNET {
return Err(error!(FeedErrorCode::InvalidSwitchboardAccount));
}