diff --git a/substrate/frame/contracts/common/src/lib.rs b/substrate/frame/contracts/common/src/lib.rs index b587386949..7d99db42a2 100644 --- a/substrate/frame/contracts/common/src/lib.rs +++ b/substrate/frame/contracts/common/src/lib.rs @@ -151,11 +151,19 @@ pub struct InstantiateReturnValue { /// The result of succesfully uploading a contract. #[derive(PartialEq, Eq, Encode, Decode, RuntimeDebug)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +#[cfg_attr( + feature = "std", + serde( + rename_all = "camelCase", + bound(serialize = "CodeHash: Serialize, Balance: Copy + Into"), + bound(deserialize = "CodeHash: Deserialize<'de>, Balance: TryFrom") + ) +)] pub struct CodeUploadReturnValue { /// The key under which the new code is stored. pub code_hash: CodeHash, /// The deposit that was reserved at the caller. Is zero when the code already existed. + #[cfg_attr(feature = "std", serde(with = "as_hex"))] pub deposit: Balance, }