@@ -59,7 +59,7 @@ pub const TEST_BURN_STATE_DB_AST_PRECHECK: UnitTestBurnStateDB = UnitTestBurnSta
59
59
const SIMPLE_TOKENS : & str = "(define-map tokens { account: principal } { balance: uint })
60
60
(define-read-only (my-get-token-balance (account principal))
61
61
(default-to u0 (get balance (map-get? tokens (tuple (account account))))))
62
- (define-read-only (explode (account principal))
62
+ (define-private (explode (account principal))
63
63
(map-delete tokens (tuple (account account))))
64
64
(define-private (token-credit! (account principal) (amount uint))
65
65
(if (<= amount u0)
@@ -84,8 +84,8 @@ const SIMPLE_TOKENS: &str = "(define-map tokens { account: principal } { balance
84
84
(if (>= block-height block-to-release)
85
85
(faucet)
86
86
(err \" must be in the future\" )))
87
- (begin (token-credit! 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR u10000)
88
- (token-credit! 'SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G u200)
87
+ (begin (try! ( token-credit! 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR u10000) )
88
+ (try! ( token-credit! 'SM2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQVX8X0G u200) )
89
89
(token-credit! .tokens u4))" ;
90
90
91
91
/// Since setup_block is not called, we need to manually increment the tenure
@@ -112,9 +112,6 @@ fn new_block<'a, 'b>(
112
112
block
113
113
}
114
114
115
- // Test not valid for clarity-wasm runtime
116
- // Contracts would error in the static analysis pass.
117
- #[ cfg( not( feature = "clarity-wasm" ) ) ]
118
115
#[ apply( test_clarity_versions) ]
119
116
fn test_simple_token_system ( #[ case] version : ClarityVersion , #[ case] epoch : StacksEpochId ) {
120
117
if epoch < StacksEpochId :: Epoch2_05 || version > ClarityVersion :: Clarity2 {
@@ -467,9 +464,6 @@ where
467
464
f ( & mut owned_env, version)
468
465
}
469
466
470
- // Test not valid for clarity-wasm runtime
471
- // Contracts would error in the static analysis pass.
472
- #[ cfg( not( feature = "clarity-wasm" ) ) ]
473
467
#[ apply( test_clarity_versions) ]
474
468
fn test_simple_naming_system ( #[ case] version : ClarityVersion , #[ case] epoch : StacksEpochId ) {
475
469
with_versioned_memory_environment ( inner_test_simple_naming_system, version, false ) ;
@@ -543,16 +537,30 @@ fn inner_test_simple_naming_system(owned_env: &mut OwnedEnvironment, version: Cl
543
537
ClarityVersion :: Clarity1 ,
544
538
) ;
545
539
540
+ let mut store = MemoryBackingStore :: new ( ) ;
541
+ let mut analysis_db = store. as_analysis_db ( ) ;
542
+ analysis_db. begin ( ) ;
543
+
546
544
{
547
545
let mut env = owned_env. get_exec_environment ( None , None , & placeholder_context) ;
548
546
549
547
let contract_identifier = QualifiedContractIdentifier :: local ( "tokens" ) . unwrap ( ) ;
550
- env. initialize_contract ( contract_identifier, tokens_contract, ASTRules :: PrecheckSize )
551
- . unwrap ( ) ;
548
+ env. initialize_contract_with_db (
549
+ contract_identifier,
550
+ tokens_contract,
551
+ ASTRules :: PrecheckSize ,
552
+ & mut analysis_db,
553
+ )
554
+ . unwrap ( ) ;
552
555
553
556
let contract_identifier = QualifiedContractIdentifier :: local ( "names" ) . unwrap ( ) ;
554
- env. initialize_contract ( contract_identifier, names_contract, ASTRules :: PrecheckSize )
555
- . unwrap ( ) ;
557
+ env. initialize_contract_with_db (
558
+ contract_identifier,
559
+ names_contract,
560
+ ASTRules :: PrecheckSize ,
561
+ & mut analysis_db,
562
+ )
563
+ . unwrap ( ) ;
556
564
}
557
565
558
566
{
0 commit comments