From 44580c0b877dc813aa3a5d6c565f3b89a94f09f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= Date: Wed, 26 Jun 2024 23:01:03 +0300 Subject: [PATCH] chore: add implicit `BorshSchema` derive for `store::UnorderedMap` --- near-sdk/src/store/unordered_map/mod.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/near-sdk/src/store/unordered_map/mod.rs b/near-sdk/src/store/unordered_map/mod.rs index e0633b79d..04ff19349 100644 --- a/near-sdk/src/store/unordered_map/mod.rs +++ b/near-sdk/src/store/unordered_map/mod.rs @@ -90,18 +90,26 @@ use super::{FreeList, LookupMap, ERR_INCONSISTENT_STATE, ERR_NOT_EXIST}; since = "5.0.0", note = "Suboptimal iteration performance. See performance considerations doc for details." )] -#[derive(BorshDeserialize, BorshSerialize)] +#[near(inside_nearsdk)] pub struct UnorderedMap where K: BorshSerialize + Ord, V: BorshSerialize, H: ToKey, { - // ser/de is independent of `K` ser/de, `BorshSerialize`/`BorshDeserialize` bounds removed - #[borsh(bound(serialize = "", deserialize = ""))] + // ser/de is independent of `K` ser/de, `BorshSerialize`/`BorshDeserialize`/`BorshSchema` bounds removed + #[cfg_attr(not(feature = "abi"), borsh(bound(serialize = "", deserialize = "")))] + #[cfg_attr( + feature = "abi", + borsh(bound(serialize = "", deserialize = ""), schema(params = "")) + )] keys: FreeList, - // ser/de is independent of `K`, `V`, `H` ser/de, `BorshSerialize`/`BorshDeserialize` bounds removed - #[borsh(bound(serialize = "", deserialize = ""))] + // ser/de is independent of `K`, `V`, `H` ser/de, `BorshSerialize`/`BorshDeserialize`/`BorshSchema` bounds removed + #[cfg_attr(not(feature = "abi"), borsh(bound(serialize = "", deserialize = "")))] + #[cfg_attr( + feature = "abi", + borsh(bound(serialize = "", deserialize = ""), schema(params = "")) + )] values: LookupMap, H>, }