Skip to content

Commit 4c7c029

Browse files
committed
Removed test-infrastructure from doc comments
1 parent d51654c commit 4c7c029

File tree

1 file changed

+0
-114
lines changed

1 file changed

+0
-114
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>,

0 commit comments

Comments
 (0)