Skip to content

Commit

Permalink
fix: Fixed compilation errors after Rust 1.80 latest stable release (#…
Browse files Browse the repository at this point in the history
…1227)

Co-authored-by: lauchaves <lauchavesmendez@gmail.comA>
  • Loading branch information
lauchaves and lauchaves committed Jul 31, 2024
1 parent 219a4fc commit 1a25837
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions examples/fungible-token/tests/workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ async fn test_storage_deposit_minimal_deposit() -> anyhow::Result<()> {
contract.view_account().await?.balance.saturating_sub(contract_balance_before_deposit);
// contract receives a gas rewards for the function call, so the difference should be slightly more than minimal_deposit
assert!(contract_balance_diff > minimal_deposit);
// adjust the upper limit of the assertion to be more flexible for small variations in the gas reward received
assert!(
contract_balance_diff
< minimal_deposit.saturating_add(NearToken::from_yoctonear(30_000_000_000_000_000_000))
< minimal_deposit.saturating_add(NearToken::from_yoctonear(50_000_000_000_000_000_000))
);

Ok(())
Expand Down Expand Up @@ -245,7 +246,7 @@ async fn test_storage_deposit_refunds_excessive_deposit() -> anyhow::Result<()>
assert!(contract_balance_diff > minimal_deposit);
assert!(
contract_balance_diff
< minimal_deposit.saturating_add(NearToken::from_yoctonear(30_000_000_000_000_000_000))
< minimal_deposit.saturating_add(NearToken::from_yoctonear(50_000_000_000_000_000_000))
);

Ok(())
Expand Down
16 changes: 8 additions & 8 deletions near-sdk/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,30 @@
//! Maps:
//!
//! - [`LookupMap`]: Wrapper around key-value storage interactions, similar to
//! [`UnorderedMap`]/[`std::collections::HashMap`] except that keys are not persisted and cannot be
//! iterated over.
//! [`UnorderedMap`]/[`std::collections::HashMap`] except that keys are not persisted and cannot be
//! iterated over.
//!
//! - [`UnorderedMap`]: Storage version of [`std::collections::HashMap`]. No ordering
//! guarantees.
//! guarantees.
//!
//! - [`TreeMap`](TreeMap) (`unstable`): Storage version of [`std::collections::BTreeMap`]. Ordered by key,
//! which comes at the cost of more expensive lookups and iteration.
//! which comes at the cost of more expensive lookups and iteration.
//!
//! Sets:
//!
//! - [`LookupSet`]: Non-iterable storage version of [`std::collections::HashSet`].
//!
//! - [`UnorderedSet`]: Analogous to [`std::collections::HashSet`], and is an iterable
//! version of [`LookupSet`] and persisted to storage.
//! version of [`LookupSet`] and persisted to storage.
//!
//! Basic Types:
//!
//! - [`Lazy<T>`](Lazy): Lazily loaded type that can be used in place of a type `T`.
//! Will only be loaded when interacted with and will persist on [`Drop`].
//! Will only be loaded when interacted with and will persist on [`Drop`].
//!
//! - [`LazyOption<T>`](LazyOption): Lazily loaded, optional type that can be used in
//! place of a type [`Option<T>`](Option). Will only be loaded when interacted with and will
//! persist on [`Drop`].
//! place of a type [`Option<T>`](Option). Will only be loaded when interacted with and will
//! persist on [`Drop`].

#[cfg(feature = "unstable")]
mod lazy;
Expand Down
10 changes: 5 additions & 5 deletions near-sdk/src/test_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ pub use context::{accounts, testing_env_with_promise_results, VMContextBuilder};
/// There are five parameters that can be accepted to configure the interface with a
/// [`MockedBlockchain`], in this order:
/// - `context`: [`VMContext`] which contains some core information about
/// the blockchain and message data which can be used from the smart contract.
/// the blockchain and message data which can be used from the smart contract.
/// - `config` (optional): [`vm::Config`] which contains some additional information
/// about the VM to configure parameters not directly related to the transaction being executed.
/// about the VM to configure parameters not directly related to the transaction being executed.
/// - `fee_config`(optional): [`RuntimeFeesConfig`] which configures the
/// fees for execution and storage of transactions.
/// fees for execution and storage of transactions.
/// - `validators`(optional): a [`HashMap`]<[`AccountId`], [`Balance`]> mocking the
/// current validators of the blockchain.
/// current validators of the blockchain.
/// - `promise_results`(optional): a [`Vec`] of [`PromiseResult`] which mocks the results
/// of callback calls during the execution.
/// of callback calls during the execution.
///
/// Any argument not included will use the default implementation of each.
///
Expand Down

0 comments on commit 1a25837

Please sign in to comment.