Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix the documentation
  • Loading branch information
asiniscalchi committed Aug 7, 2023
commit 6e3ef854efe563256282aece6cf51f39a74d4585
16 changes: 6 additions & 10 deletions precompile/living-assets/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,26 +137,22 @@ mod helpers {
use fp_evm::{Log, PrecompileHandle};
use sp_core::{H160, H256};

/// Macro to define a precompile mock with custom closures for testing.
/// Macro to define a precompile mock for testing.
///
/// This macro creates mock implementations of the `CollectionManager` trait,
/// allowing you to test how your code interacts with the precompiled contracts.
/// You can define custom closures for the create_collection and owner_of_collection functions.
/// The mock type is named `Mock`, and the implementation uses the provided expressions.
///
/// # Arguments
///
/// * `$name`: An identifier to name the precompile mock type.
/// * `$create_collection_result`: A closure that takes `collection_id` and `who` and returns a `DispatchResult`.
/// * `$owner_of_collection_result`: A closure that takes `collection_id` and returns an `Option<AccountId>`.
/// * `$create_collection_result`: An expression that evaluates to a `Result<CollectionId, &'static str>`.
/// * `$owner_of_collection_result`: An expression that evaluates to an `Option<AccountId>`.
///
/// # Example
///
/// ```
/// impl_precompile_mock!(
/// MyMock,
/// |who| { Ok(0) },
/// |collection_id| { Some(H160::zero()) }
/// );
/// impl_precompile_mock_simple!(Mock, Ok(0), Some(H160::zero()));
/// ```
#[macro_export]
macro_rules! impl_precompile_mock {
Expand Down Expand Up @@ -188,7 +184,7 @@ mod helpers {
///
/// # Arguments
///
/// * `$create_collection_result`: An expression that evaluates to a `DispatchResult`.
/// * `$create_collection_result`: An expression that evaluates to a `Result`.
/// * `$owner_of_collection_result`: An expression that evaluates to an `Option<AccountId>`.
///
/// # Example
Expand Down