Problem
ReinsuranceStats in contracts/insurance/src/types.rs was declared without the required ink!/scale derives:
error[E0277]: the trait bound `ReinsuranceStats: TypeInfo` is not satisfied
error[E0277]: the trait bound `Option<ReinsuranceStats>: Encode` is not satisfied
The struct is returned from an #[ink(message)] function, which requires Encode + Decode + TypeInfo. It is also stored in contract state, requiring StorageLayout.
Fix
Added scale::Encode, scale::Decode, ink::storage::traits::StorageLayout and #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] to ReinsuranceStats.
Affected file
contracts/insurance/src/types.rs
Problem
ReinsuranceStatsincontracts/insurance/src/types.rswas declared without the required ink!/scale derives:The struct is returned from an
#[ink(message)]function, which requiresEncode + Decode + TypeInfo. It is also stored in contract state, requiringStorageLayout.Fix
Added
scale::Encode, scale::Decode, ink::storage::traits::StorageLayoutand#[cfg_attr(feature = "std", derive(scale_info::TypeInfo))]toReinsuranceStats.Affected file
contracts/insurance/src/types.rs