@@ -8,6 +8,9 @@ pub use signing::SigType;
8
8
9
9
use crate :: { Balance , EcdsaPublicKey , EcdsaSignature , Hash } ;
10
10
11
+ #[ cfg( doc) ]
12
+ use crate :: { http_get, http_post, http_put, debug, info, warn, error} ;
13
+
11
14
mod http_request;
12
15
pub mod signing;
13
16
@@ -116,15 +119,15 @@ pub trait PinkExt {
116
119
///
117
120
/// # Example
118
121
///
119
- /// ```
122
+ /// ```ignore
120
123
/// let request = HttpRequest::new("https://httpbin.org/get", "GET", Defualt::default(), Defualt::default());
121
124
/// let response = pink::ext().http_request(request);
122
125
/// ```
123
126
///
124
127
/// There are also some shortcut macros for this function:
125
- /// - [`crate:: http_get!`]
126
- /// - [`crate:: http_post!`]
127
- /// - [`crate:: http_put!`]
128
+ /// - [`http_get!`]
129
+ /// - [`http_post!`]
130
+ /// - [`http_put!`]
128
131
///
129
132
/// # Availability
130
133
/// any contract | query only
@@ -145,7 +148,7 @@ pub trait PinkExt {
145
148
///
146
149
/// # Example
147
150
///
148
- /// ```
151
+ /// ```ignore
149
152
/// let derived_key = pink::ext().derive_sr25519_key(b"some salt".into());
150
153
/// let message = b"Hello, world!";
151
154
/// let signature = pink::ext().sign(SigType::Sr25519, &key, message);
@@ -179,7 +182,7 @@ pub trait PinkExt {
179
182
///
180
183
/// # Example
181
184
///
182
- /// ```
185
+ /// ```ignore
183
186
/// let derived_key = pink::ext().derive_sr25519_key(b"some salt".into());
184
187
/// let message = b"Hello, world!";
185
188
/// let signature = pink::ext().sign(SigType::Sr25519, &key, message);
@@ -207,7 +210,7 @@ pub trait PinkExt {
207
210
///
208
211
/// # Example
209
212
///
210
- /// ```
213
+ /// ```ignore
211
214
/// let derived_key = pink::ext().derive_sr25519_key(b"some salt".into());
212
215
/// ```
213
216
///
@@ -231,7 +234,7 @@ pub trait PinkExt {
231
234
///
232
235
/// # Example
233
236
///
234
- /// ```
237
+ /// ```ignore
235
238
/// let derived_key = pink::ext().derive_sr25519_key(b"some salt".into());
236
239
/// let pubkey = pink::ext().get_public_key(SigType::Sr25519, &derived_key);
237
240
/// ```
@@ -273,7 +276,7 @@ pub trait PinkExt {
273
276
///
274
277
/// # Example
275
278
///
276
- /// ```
279
+ /// ```ignore
277
280
/// let key = b"my key";
278
281
/// let value = b"my value";
279
282
/// let result = pink::ext().cache_set(key, value);
@@ -295,7 +298,7 @@ pub trait PinkExt {
295
298
///
296
299
/// # Example
297
300
///
298
- /// ```
301
+ /// ```ignore
299
302
/// let key = b"my key";
300
303
/// let expire = 60; // 1 minute
301
304
/// pink::ext().cache_set_expiration(key, expire);
@@ -322,7 +325,7 @@ pub trait PinkExt {
322
325
///
323
326
/// # Example
324
327
///
325
- /// ```
328
+ /// ```ignore
326
329
/// let key = b"my key";
327
330
/// let value = pink::ext().cache_get(key);
328
331
/// ```
@@ -362,7 +365,7 @@ pub trait PinkExt {
362
365
///
363
366
/// # Example
364
367
///
365
- /// ```
368
+ /// ```ignore
366
369
/// let level = 1;
367
370
/// let message = "Hello, world!";
368
371
/// pink::ext().log(level, message);
@@ -371,10 +374,10 @@ pub trait PinkExt {
371
374
/// # Note
372
375
/// This is the low-level method for logging. It is recommended to use shortcuts macros below instead:
373
376
///
374
- /// - [`crate:: debug!`]
375
- /// - [`crate:: info!`]
376
- /// - [`crate:: warn!`]
377
- /// - [`crate:: error!`]
377
+ /// - [`debug!`]
378
+ /// - [`info!`]
379
+ /// - [`warn!`]
380
+ /// - [`error!`]
378
381
///
379
382
/// # Availability
380
383
/// any contract | query | transaction
@@ -400,7 +403,7 @@ pub trait PinkExt {
400
403
///
401
404
/// # Example
402
405
///
403
- /// ```
406
+ /// ```ignore
404
407
/// let length = 32;
405
408
/// let random_bytes = pink::ext().getrandom(length);
406
409
/// ```
@@ -418,6 +421,7 @@ pub trait PinkExt {
418
421
///
419
422
/// # Availability
420
423
/// any contract | query | transaction
424
+ #[ allow( clippy:: wrong_self_convention) ]
421
425
#[ ink( extension = 12 , handle_status = false ) ]
422
426
fn is_in_transaction ( ) -> bool ;
423
427
@@ -436,7 +440,7 @@ pub trait PinkExt {
436
440
///
437
441
/// # Example
438
442
///
439
- /// ```
443
+ /// ```ignore
440
444
/// let key = [0u8; 32]; // replace with actual key
441
445
/// let message_hash = Hash::zero(); // replace with actual hash
442
446
/// let signature = pink::ext().ecdsa_sign_prehashed(&key, message_hash);
@@ -463,7 +467,7 @@ pub trait PinkExt {
463
467
///
464
468
/// # Example
465
469
///
466
- /// ```
470
+ /// ```ignore
467
471
/// let signature = EcdsaSignature::default(); // replace with actual signature
468
472
/// let message_hash = Hash::zero(); // replace with actual hash
469
473
/// let pubkey = EcdsaPublicKey::default(); // replace with actual pubkey
@@ -525,7 +529,7 @@ pub trait PinkExt {
525
529
///
526
530
/// # Example
527
531
///
528
- /// ```
532
+ /// ```ignore
529
533
/// let current_millis = pink::ext().untrusted_millis_since_unix_epoch();
530
534
/// ```
531
535
///
@@ -542,7 +546,7 @@ pub trait PinkExt {
542
546
///
543
547
/// # Example
544
548
///
545
- /// ```
549
+ /// ```ignore
546
550
/// let code_hash = Hash::zero(); // replace with actual code hash
547
551
/// let exists = pink::ext().code_exists(code_hash, false);
548
552
/// ```
@@ -560,7 +564,7 @@ pub trait PinkExt {
560
564
///
561
565
/// # Example
562
566
///
563
- /// ```
567
+ /// ```ignore
564
568
/// let payer = AccountId::default(); // replace with actual payer id
565
569
/// let code_hash = pink::ext().import_latest_system_code(payer);
566
570
/// ```
@@ -578,7 +582,7 @@ pub trait PinkExt {
578
582
///
579
583
/// # Example
580
584
///
581
- /// ```
585
+ /// ```ignore
582
586
/// let (major, minor) = pink::ext().runtime_version();
583
587
/// ```
584
588
///
@@ -602,7 +606,7 @@ pub trait PinkExt {
602
606
///
603
607
/// # Example
604
608
///
605
- /// ```
609
+ /// ```ignore
606
610
/// let requests = vec![
607
611
/// HttpRequest::new("https://httpbin.org/get",
608
612
/// "GET",
0 commit comments