You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The declare_program! macro is panicking with the error below when used with a program that uses shared contexts across multiple instructions.
error[E0428]: the name `__cpi_client_accounts_shared_accounts` is defined multiple times
--> lib/my-crate/src/lib.rs:3:1
|
3 | declare_program!(external_program);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `__cpi_client_accounts_shared_accounts` redefined here
|
= note: `__cpi_client_accounts_shared_accounts` must be defined only once in the type namespace of this module
= note: this error originates in the macro `declare_program` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0428]: the name `__client_accounts_shared_accounts` is defined multiple times
--> lib/my-crate/src/lib.rs:3:1
|
3 | declare_program!(external_program);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `__client_accounts_shared_accounts` redefined here
|
= note: `__client_accounts_shared_accounts` must be defined only once in the type namespace of this module
= note: this error originates in the macro `declare_program` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0428`.
error: could not compile `my-crate` (lib) due to 2 previous errors
Came back to this and realized it only happens when running cargo build, so worth noting I'm attempting to use declare_program! in an off-chain program.
On this branch I was able to reproduce the error and edited the above to include the steps.
Description
The
declare_program!
macro is panicking with the error below when used with a program that uses shared contexts across multiple instructions.Steps to Reproduce
cd /tests/declare-program
cargo build
The text was updated successfully, but these errors were encountered: