Skip to content

Commit 270d7c1

Browse files
committed
Removed test-infrastructure from doc comments
1 parent d51654c commit 270d7c1

File tree

4 files changed

+1
-150
lines changed

4 files changed

+1
-150
lines changed

concordium-cis2/src/cis2_client.rs

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -129,31 +129,6 @@ impl Cis2Client {
129129
/// standard by another contract, it returns
130130
/// `Ok(SupportResult::SupportBy(Vec<ContractAddress>))`. If there is an
131131
/// error, it returns `Err`.
132-
///
133-
/// # Examples
134-
/// ```rust
135-
/// use concordium_cis2::*;
136-
/// use concordium_std::{test_infrastructure::*, *};
137-
/// let mut host = TestHost::new((), TestStateBuilder::new());
138-
/// host.setup_mock_entrypoint(
139-
/// ContractAddress::new(0, 0),
140-
/// OwnedEntrypointName::new_unchecked("supports".to_string()),
141-
/// MockFn::new_v1(|_, _, _, _| {
142-
/// Ok((false, SupportsQueryResponse {
143-
/// results: vec![SupportResult::Support],
144-
/// }))
145-
/// }),
146-
/// );
147-
///
148-
/// let client = Cis2Client::new(ContractAddress::new(0, 0));
149-
/// let res: Result<SupportResult, Cis2ClientError<()>> = client.supports_cis2(&host);
150-
/// assert!(res.is_ok());
151-
/// match res.unwrap() {
152-
/// SupportResult::NoSupport => fail!(),
153-
/// SupportResult::Support => (),
154-
/// SupportResult::SupportBy(_) => fail!(),
155-
/// }
156-
/// ```
157132
pub fn supports_cis2<State, E: Deserial>(
158133
&self,
159134
host: &impl HasHost<State>,
@@ -173,32 +148,6 @@ impl Cis2Client {
173148
/// operator of the given contract, it returns `Ok(true)`,
174149
/// else it returns `Ok(false)`.
175150
/// If there is an error, it returns `Err`.
176-
///
177-
/// # Examples
178-
/// ```rust
179-
/// use concordium_cis2::*;
180-
/// use concordium_std::{test_infrastructure::*, *};
181-
///
182-
/// let mut host = TestHost::new((), TestStateBuilder::new());
183-
/// host.setup_mock_entrypoint(
184-
/// ContractAddress::new(0, 0),
185-
/// OwnedEntrypointName::new_unchecked("operatorOf".to_string()),
186-
/// MockFn::new_v1(|_, _, _, _| {
187-
/// Ok((false, OperatorOfQueryResponse {
188-
/// 0: vec![true],
189-
/// }))
190-
/// }),
191-
/// );
192-
///
193-
/// let client = Cis2Client::new(ContractAddress::new(0, 0));
194-
/// let res: Result<bool, Cis2ClientError<()>> = client.operator_of(
195-
/// &mut host,
196-
/// Address::Account(AccountAddress([1; 32])),
197-
/// Address::Contract(ContractAddress::new(1, 0)),
198-
/// );
199-
///
200-
/// assert_eq!(res.unwrap(), true);
201-
/// ```
202151
pub fn operator_of<State, E: Deserial>(
203152
&self,
204153
host: &impl HasHost<State>,
@@ -221,25 +170,6 @@ impl Cis2Client {
221170
/// Calls the `balanceOf` entrypoint of the CIS2 contract to get the balance
222171
/// of the given owner for the given token. If the balance is returned,
223172
/// it returns `Ok(balance)`, else it returns `Err`.
224-
/// # Examples
225-
/// ```rust
226-
/// use concordium_cis2::*;
227-
/// use concordium_std::{test_infrastructure::*, *};
228-
/// let mut host = TestHost::new((), TestStateBuilder::new());
229-
/// host.setup_mock_entrypoint(
230-
/// ContractAddress::new(0, 0),
231-
/// OwnedEntrypointName::new_unchecked("balanceOf".to_string()),
232-
/// MockFn::new_v1(|_, _, _, _| {
233-
/// Ok((false, BalanceOfQueryResponse::<TokenAmountU8>(vec![1.into()])))
234-
/// }),
235-
/// );
236-
///
237-
/// let client = Cis2Client::new(ContractAddress::new(0, 0));
238-
/// let res: Result<TokenAmountU8, Cis2ClientError<()>> =
239-
/// client.balance_of(&host, TokenIdU8(1), Address::Account(AccountAddress([1; 32])));
240-
/// assert!(res.is_ok());
241-
/// assert_eq!(res.unwrap(), 1.into());
242-
/// ```
243173
pub fn balance_of<State, T: IsTokenId, A: IsTokenAmount, E: Deserial>(
244174
&self,
245175
host: &impl HasHost<State>,
@@ -265,29 +195,6 @@ impl Cis2Client {
265195
/// If the transfer is successful and the state is modified, it returns
266196
/// `Ok(true)`, else it returns `Ok(false)`. If there is an error, it
267197
/// returns `Err`.
268-
///
269-
/// # Examples
270-
/// ```rust
271-
/// use concordium_cis2::*;
272-
/// use concordium_std::{test_infrastructure::*, *};
273-
/// let mut host = TestHost::new((), TestStateBuilder::new());
274-
/// host.setup_mock_entrypoint(
275-
/// ContractAddress::new(0, 0),
276-
/// OwnedEntrypointName::new_unchecked("transfer".to_string()),
277-
/// MockFn::new_v1(|_, _, _, _| Ok((false, ()))),
278-
/// );
279-
///
280-
/// let client = Cis2Client::new(ContractAddress::new(0, 0));
281-
/// let res: Result<bool, Cis2ClientError<()>> = client.transfer(&mut host, Transfer {
282-
/// amount: TokenAmountU8(1),
283-
/// from: Address::Account(AccountAddress([1; 32])),
284-
/// to: Receiver::Account(AccountAddress([2; 32])),
285-
/// token_id: TokenIdU8(1),
286-
/// data: AdditionalData::empty(),
287-
/// });
288-
///
289-
/// assert!(res.is_ok());
290-
/// ```
291198
pub fn transfer<State, T: IsTokenId, A: IsTokenAmount, E: Deserial>(
292199
&self,
293200
host: &mut impl HasHost<State>,
@@ -304,27 +211,6 @@ impl Cis2Client {
304211
/// If the update is successful and the state is modified, it returns
305212
/// `Ok(true)`, else it returns `Ok(false)`. If there is an error, it
306213
/// returns `Err`.
307-
///
308-
/// # Examples
309-
/// ```rust
310-
/// use concordium_cis2::*;
311-
/// use concordium_std::{test_infrastructure::*, *};
312-
/// let mut host = TestHost::new((), TestStateBuilder::new());
313-
/// host.setup_mock_entrypoint(
314-
/// ContractAddress::new(0, 0),
315-
/// OwnedEntrypointName::new_unchecked("updateOperator".to_string()),
316-
/// MockFn::new_v1(|_, _, _, _| Ok((false, ()))),
317-
/// );
318-
///
319-
/// let client = Cis2Client::new(ContractAddress::new(0, 0));
320-
/// let res: Result<bool, Cis2ClientError<()>> = client.update_operator(
321-
/// &mut host,
322-
/// Address::Account(AccountAddress([1; 32])),
323-
/// OperatorUpdate::Add,
324-
/// );
325-
///
326-
/// assert!(res.is_ok());
327-
/// ```
328214
pub fn update_operator<State, E: Deserial>(
329215
&self,
330216
host: &mut impl HasHost<State>,

concordium-std/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,6 @@ pub use state_btree::*;
473473
pub use traits::*;
474474
pub use types::*;
475475

476-
#[deprecated(
477-
since = "8.1.0",
478-
note = "Deprecated in favor of [concordium-smart-contract-testing](https://docs.rs/concordium-smart-contract-testing)."
479-
)]
480-
pub mod test_infrastructure;
481-
482476
#[cfg(all(feature = "debug", not(feature = "std")))]
483477
pub use alloc::format;
484478
#[cfg(all(feature = "debug", feature = "std"))]

concordium-std/src/test_infrastructure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
//! ```
7070
7171
use self::trie::StateTrie;
72-
use crate::{boxed::Box, cell::RefCell, cmp, num, rc::Rc, *};
72+
use crate::{cell::RefCell, cmp, num, rc::Rc, *};
7373
use convert::TryInto;
7474
#[cfg(feature = "concordium-quickcheck")]
7575
use quickcheck::*;

concordium-std/src/types.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,6 @@ use core::{fmt, str::FromStr};
2323
/// New maps can be constructed using the
2424
/// [`new_map`][StateBuilder::new_map] method on the [`StateBuilder`].
2525
///
26-
///
27-
/// ```
28-
/// # use concordium_std::*;
29-
/// # use concordium_std::test_infrastructure::*;
30-
/// # let mut state_builder = TestStateBuilder::new();
31-
/// /// In an init method:
32-
/// let mut map1 = state_builder.new_map();
33-
/// # map1.insert(0u8, 1u8); // Specifies type of map.
34-
///
35-
/// # let mut host = TestHost::new((), state_builder);
36-
/// /// In a receive method:
37-
/// let mut map2 = host.state_builder().new_map();
38-
/// # map2.insert(0u16, 1u16);
39-
/// ```
40-
///
4126
/// ## Type parameters
4227
///
4328
/// The map `StateMap<K, V, S>` is parametrized by the type of _keys_ `K`, the
@@ -192,20 +177,6 @@ pub struct StateMapIterMut<'a, K, V, S: HasStateApi> {
192177
/// New sets can be constructed using the
193178
/// [`new_set`][StateBuilder::new_set] method on the [`StateBuilder`].
194179
///
195-
/// ```
196-
/// # use concordium_std::*;
197-
/// # use concordium_std::test_infrastructure::*;
198-
/// # let mut state_builder = TestStateBuilder::new();
199-
/// /// In an init method:
200-
/// let mut set1 = state_builder.new_set();
201-
/// # set1.insert(0u8); // Specifies type of set.
202-
///
203-
/// # let mut host = TestHost::new((), state_builder);
204-
/// /// In a receive method:
205-
/// let mut set2 = host.state_builder().new_set();
206-
/// # set2.insert(0u16);
207-
/// ```
208-
///
209180
/// ## Type parameters
210181
///
211182
/// The set `StateSet<T, S>` is parametrized by the type of _values_ `T`, and

0 commit comments

Comments
 (0)