Getting a build error when trying to upgrade a contract to 21.1.0-rc.1.
error: enum integer ProposalStatus must have `derive(Copy)`
--> contracts/governor/src/types.rs:121:10
|
121 | pub enum ProposalStatus {
| ^^^^^^^^^^^^^^
error[E0277]: the trait bound `ProposalStatus: TryFromVal<Env, soroban_sdk::Val>` is not satisfied
--> contracts/governor/src/types.rs:86:1
|
86 | #[contracttype]
| ^^^^^^^^^^^^^^^ the trait `TryFromVal<Env, soroban_sdk::Val>` is not implemented for `ProposalStatus`, which is required by `soroban_sdk::Val: TryIntoVal<_, _>`
|
= help: the following other types implement trait `TryFromVal<E, V>`:
<bool as TryFromVal<Env, bool>>
<bool as TryFromVal<E, soroban_sdk::Val>>
<i32 as TryFromVal<Env, i32>>
<i32 as TryFromVal<E, soroban_sdk::Val>>
<i64 as TryFromVal<Env, i64>>
<i64 as TryFromVal<E, soroban_sdk::Val>>
<i128 as TryFromVal<Env, i128>>
<i128 as TryFromVal<E, soroban_sdk::Val>>
and 295 others
= note: required for `soroban_sdk::Val` to implement `TryIntoVal<Env, ProposalStatus>`
= note: this error originates in the attribute macro `contracttype` (in Nightly builds, run with -Z macro-backtrace for more info)
Enum in question:
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[contracttype]
pub enum ProposalStatus {
/// The proposal exists and voting has not been closed
Open = 0,
/// The proposal was voted for. If the proposal is executable, the timelock begins once this state is reached.
Successful = 1,
/// The proposal was voted against
Defeated = 2,
/// The proposal did not reach quorum before the voting period ended, or was stalled out during the grace period.
Expired = 3,
/// The proposal has been executed
Executed = 4,
/// The proposal has been canceled
Canceled = 5,
}
This builds with 20.5.0. Any suggestions?