@@ -129,31 +129,6 @@ impl Cis2Client {
129
129
/// standard by another contract, it returns
130
130
/// `Ok(SupportResult::SupportBy(Vec<ContractAddress>))`. If there is an
131
131
/// 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
- /// ```
157
132
pub fn supports_cis2 < State , E : Deserial > (
158
133
& self ,
159
134
host : & impl HasHost < State > ,
@@ -173,32 +148,6 @@ impl Cis2Client {
173
148
/// operator of the given contract, it returns `Ok(true)`,
174
149
/// else it returns `Ok(false)`.
175
150
/// 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
- /// ```
202
151
pub fn operator_of < State , E : Deserial > (
203
152
& self ,
204
153
host : & impl HasHost < State > ,
@@ -221,25 +170,6 @@ impl Cis2Client {
221
170
/// Calls the `balanceOf` entrypoint of the CIS2 contract to get the balance
222
171
/// of the given owner for the given token. If the balance is returned,
223
172
/// 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
- /// ```
243
173
pub fn balance_of < State , T : IsTokenId , A : IsTokenAmount , E : Deserial > (
244
174
& self ,
245
175
host : & impl HasHost < State > ,
@@ -265,29 +195,6 @@ impl Cis2Client {
265
195
/// If the transfer is successful and the state is modified, it returns
266
196
/// `Ok(true)`, else it returns `Ok(false)`. If there is an error, it
267
197
/// 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
- /// ```
291
198
pub fn transfer < State , T : IsTokenId , A : IsTokenAmount , E : Deserial > (
292
199
& self ,
293
200
host : & mut impl HasHost < State > ,
@@ -304,27 +211,6 @@ impl Cis2Client {
304
211
/// If the update is successful and the state is modified, it returns
305
212
/// `Ok(true)`, else it returns `Ok(false)`. If there is an error, it
306
213
/// 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
- /// ```
328
214
pub fn update_operator < State , E : Deserial > (
329
215
& self ,
330
216
host : & mut impl HasHost < State > ,
0 commit comments