Tested with:
Solana 18 (checked with 0.18.2, 0.18.10, and 0.18.14)
Anchor 0.29.0
Loading programs with Anchor.toml
with an address like this:
## Wormhole Core Bridge
[[test.validator.clone]]
address = "worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"
Attempting to call any instruction in the test on it will result in the following error after running tests with anchor test
:
Transaction simulation failed: This program may not be used for executing instructions.
--
It used to work fine; I have an older program built with 0.16.19 (and Anchor 0.29.0) which correctly loaded the programs.
A workaround for this is to manually download and load the program. Anchor.toml
must be changed to:
[[test.genesis]]
address = "worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth"
program = "mainnet_core_bridge.so"
Notes:
worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth
is the Wormhole core bridge. It is owned by BPF Upgradeable Loader
(Solscan link). According to Anchor docs, it should load properly.
This could be related to: Changes to runtime's LoadedPrograms between 1.17.6 and versions after in the ProgramTest context
The workaround is not a long-term solution has anybody been able to make it work with simple cloning [[test.validator.clone]]
?
--
Edit1:
Same issue with other programs like mpl token metadata
(metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s
)