Open Luca-Poggi opened 4 years ago
As the error message shows, the U256
type does not implement the Metadata
trait.
(Here are all types that implement the Metadata
trait)
If you want to use U256
type in smart contract written with ink!
, please implement the U256
type and implement the Metadata
trait for it by yourself.
Hi, I'm coding and testing smartcontracts. I want to test a smartcontract using
U256
.lib.rs
file is:Cargo.toml
file is:cargo-contract contract build
command --> NO ERROR -->wasm
file is generated correctlycargo-contract contract generate-metadata
command --> I get the following ERROR:primitive_types::U256: type_metadata::type_def::HasTypeDef
is not satisfied --> lib.rs:8:1type_metadata::type_def::HasTypeDef
is not implemented forprimitive_types::U256
ink_abi::specs::TypeSpec::with_name_segs
error: aborting due to 2 previous errors
For more information about this error, try
rustc --explain E0277
. error: could not compilebig_number
.