From cd9d44e0dd74e54aab28d47133f31db9f29aebdf Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Sun, 11 Feb 2024 18:20:54 +0000 Subject: [PATCH] revert changes --- examples/versioned/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/versioned/src/lib.rs b/examples/versioned/src/lib.rs index 2b2e98603..c3019396e 100644 --- a/examples/versioned/src/lib.rs +++ b/examples/versioned/src/lib.rs @@ -1,5 +1,5 @@ use near_sdk::borsh::{BorshDeserialize, BorshSerialize}; -use near_sdk::store::FrangibleMap; +use near_sdk::store::UnorderedMap; use near_sdk::{env, log, near_bindgen, AccountId, NearToken}; /// An example of a versioned contract. This is a simple contract that tracks how much @@ -33,7 +33,7 @@ impl VersionedContract { } } - fn funders(&self) -> &FrangibleMap { + fn funders(&self) -> &UnorderedMap { match self { Self::V0(contract) => &contract.funders, Self::V1(contract) => &contract.funders, @@ -50,25 +50,25 @@ impl Default for VersionedContract { #[derive(BorshDeserialize, BorshSerialize)] #[borsh(crate = "near_sdk::borsh")] pub struct ContractV0 { - funders: FrangibleMap, + funders: UnorderedMap, } impl Default for ContractV0 { fn default() -> Self { - Self { funders: FrangibleMap::new(b"f") } + Self { funders: UnorderedMap::new(b"f") } } } #[derive(BorshDeserialize, BorshSerialize)] #[borsh(crate = "near_sdk::borsh")] pub struct Contract { - funders: FrangibleMap, + funders: UnorderedMap, nonce: u64, } impl Default for Contract { fn default() -> Self { - Self { funders: FrangibleMap::new(b"f"), nonce: 0 } + Self { funders: UnorderedMap::new(b"f"), nonce: 0 } } } @@ -133,7 +133,7 @@ mod tests { #[test] fn contract_v0_interactions() { let mut contract = { - let mut funders = FrangibleMap::new(b"f"); + let mut funders = UnorderedMap::new(b"f"); funders.insert(bob(), NearToken::from_yoctonear(8)); VersionedContract::V0(ContractV0 { funders }) };