@@ -199,7 +199,7 @@ fn test_as_contract(#[case] version: ClarityVersion, #[case] _epoch: StacksEpoch
199
199
) ,
200
200
// multiple allowances
201
201
(
202
- "(as-contract? ((with-stx u1000) (with-ft .token \" foo\" u5000) (with-nft .token \" foo\" 0x01) (with-stacking u1000)) true)" ,
202
+ "(as-contract? ((with-stx u1000) (with-ft .token \" foo\" u5000) (with-nft .token \" foo\" (list 0x01) ) (with-stacking u1000)) true)" ,
203
203
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( )
204
204
) ,
205
205
// multiple body expressions
@@ -551,47 +551,47 @@ fn test_with_nft_allowance(#[case] version: ClarityVersion, #[case] _epoch: Stac
551
551
let good = [
552
552
// basic usage with shortcut contract principal
553
553
(
554
- r#"(restrict-assets? tx-sender ((with-nft .token "token-name" u1000)) true)"# ,
554
+ r#"(restrict-assets? tx-sender ((with-nft .token "token-name" (list u1000) )) true)"# ,
555
555
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
556
556
) ,
557
557
// full literal principal
558
558
(
559
- r#"(restrict-assets? tx-sender ((with-ft 'SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.token "token-name" u1000)) true)"# ,
559
+ r#"(restrict-assets? tx-sender ((with-ft 'SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.token "token-name" (list u1000) )) true)"# ,
560
560
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
561
561
) ,
562
562
// variable principal
563
563
(
564
- r#"(let ((contract .token)) (restrict-assets? tx-sender ((with-nft contract "token-name" u1000)) true))"# ,
564
+ r#"(let ((contract .token)) (restrict-assets? tx-sender ((with-nft contract "token-name" (list u1000) )) true))"# ,
565
565
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
566
566
) ,
567
567
// variable token name
568
568
(
569
- r#"(let ((name "token-name")) (restrict-assets? tx-sender ((with-nft .token name u1000)) true))"# ,
569
+ r#"(let ((name "token-name")) (restrict-assets? tx-sender ((with-nft .token name (list u1000) )) true))"# ,
570
570
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
571
571
) ,
572
572
// "*" token name
573
573
(
574
- r#"(restrict-assets? tx-sender ((with-nft .token "*" u1000)) true)"# ,
574
+ r#"(restrict-assets? tx-sender ((with-nft .token "*" (list u1000) )) true)"# ,
575
575
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
576
576
) ,
577
577
// empty token name
578
578
(
579
- r#"(restrict-assets? tx-sender ((with-nft .token "" u1000)) true)"# ,
579
+ r#"(restrict-assets? tx-sender ((with-nft .token "" (list u1000) )) true)"# ,
580
580
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
581
581
) ,
582
582
// string asset-id
583
583
(
584
- r#"(restrict-assets? tx-sender ((with-nft .token "token-name" "asset-123")) true)"# ,
584
+ r#"(restrict-assets? tx-sender ((with-nft .token "token-name" (list "asset-123") )) true)"# ,
585
585
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
586
586
) ,
587
587
// buffer asset-id
588
588
(
589
- r#"(restrict-assets? tx-sender ((with-nft .token "token-name" 0x0123456789)) true)"# ,
589
+ r#"(restrict-assets? tx-sender ((with-nft .token "token-name" (list 0x0123456789) )) true)"# ,
590
590
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
591
591
) ,
592
592
// variable asset-id
593
593
(
594
- r#"(let ((asset-id u123)) (restrict-assets? tx-sender ((with-nft .token "token-name" asset-id)) true))"# ,
594
+ r#"(let ((asset-id (list u123) )) (restrict-assets? tx-sender ((with-nft .token "token-name" asset-id)) true))"# ,
595
595
TypeSignature :: new_response ( TypeSignature :: BoolType , TypeSignature :: IntType ) . unwrap ( ) ,
596
596
) ,
597
597
] ;
@@ -614,20 +614,20 @@ fn test_with_nft_allowance(#[case] version: ClarityVersion, #[case] _epoch: Stac
614
614
) ,
615
615
// too many arguments
616
616
(
617
- r#"(restrict-assets? tx-sender ((with-nft .token "token-name" u123 u456)) true)"# ,
617
+ r#"(restrict-assets? tx-sender ((with-nft .token "token-name" (list u123) (list u456) )) true)"# ,
618
618
CheckErrors :: IncorrectArgumentCount ( 3 , 4 ) ,
619
619
) ,
620
620
// wrong type for contract-id - uint instead of principal
621
621
(
622
- r#"(restrict-assets? tx-sender ((with-nft u123 "token-name" u456)) true)"# ,
622
+ r#"(restrict-assets? tx-sender ((with-nft u123 "token-name" (list u456) )) true)"# ,
623
623
CheckErrors :: TypeError (
624
624
TypeSignature :: PrincipalType . into ( ) ,
625
625
TypeSignature :: UIntType . into ( ) ,
626
626
) ,
627
627
) ,
628
628
// wrong type for token-name - uint instead of string
629
629
(
630
- "(restrict-assets? tx-sender ((with-nft .token u123 u456)) true)" ,
630
+ "(restrict-assets? tx-sender ((with-nft .token u123 (list u456) )) true)" ,
631
631
CheckErrors :: TypeError (
632
632
TypeSignature :: new_string_ascii ( 128 ) . unwrap ( ) . into ( ) ,
633
633
TypeSignature :: UIntType . into ( ) ,
0 commit comments