Skip to content

Commit cd8a302

Browse files
committed
chore: ensure type-checking call is executed
This commit guarantees that the type-checking call is performed as expected, preventing potential issues with type validation.
1 parent 4b2140d commit cd8a302

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

clarity/src/vm/tests/assets.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ const FIRST_CLASS_TOKENS: &str = "(define-fungible-token stackaroos)
4242
(define-public (mint-after (block-to-release uint))
4343
(if (>= block-height block-to-release)
4444
(faucet)
45-
(err \"must be in the future\")))
45+
(err u100)))
4646
(define-public (burn (amount uint) (p principal))
4747
(ft-burn? stackaroos amount p))
48-
(begin (ft-mint? stackaroos u10000 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)
49-
(ft-mint? stackaroos u200 'SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G)
48+
(begin (is-ok (ft-mint? stackaroos u10000 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR))
49+
(is-ok (ft-mint? stackaroos u200 'SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G))
5050
(ft-mint? stackaroos u4 .tokens))";
5151

5252
const ASSET_NAMES: &str =
@@ -80,15 +80,15 @@ const ASSET_NAMES: &str =
8080
(nft-burn? names name p))
8181
(define-public (try-bad-transfers)
8282
(begin
83-
(contract-call? .tokens my-token-transfer burn-address u50000)
84-
(contract-call? .tokens my-token-transfer burn-address u1000)
85-
(contract-call? .tokens my-token-transfer burn-address u1)
83+
(is-ok (contract-call? .tokens my-token-transfer burn-address u50000))
84+
(is-ok (contract-call? .tokens my-token-transfer burn-address u1000))
85+
(is-ok (contract-call? .tokens my-token-transfer burn-address u1))
8686
(err u0)))
8787
(define-public (try-bad-transfers-but-ok)
8888
(begin
89-
(contract-call? .tokens my-token-transfer burn-address u50000)
90-
(contract-call? .tokens my-token-transfer burn-address u1000)
91-
(contract-call? .tokens my-token-transfer burn-address u1)
89+
(is-ok (contract-call? .tokens my-token-transfer burn-address u50000))
90+
(is-ok (contract-call? .tokens my-token-transfer burn-address u1000))
91+
(is-ok (contract-call? .tokens my-token-transfer burn-address u1))
9292
(ok 0)))
9393
(define-public (transfer (name int) (recipient principal))
9494
(let ((transfer-name-result (nft-transfer? names name tx-sender recipient))
@@ -97,7 +97,7 @@ const ASSET_NAMES: &str =
9797
(begin (unwrap! transfer-name-result transfer-name-result)
9898
(unwrap! token-to-contract-result token-to-contract-result)
9999
(unwrap! contract-to-burn-result contract-to-burn-result)
100-
(ok 0))))
100+
(ok true))))
101101
(define-public (register
102102
(recipient-principal principal)
103103
(name int)

0 commit comments

Comments
 (0)