Skip to content

fix(insurance): ReinsuranceStats missing Encode, Decode, TypeInfo, StorageLayout derives #435

@nanaf6203-bit

Description

@nanaf6203-bit

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

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions