@@ -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
@@ -537,16 +537,30 @@ fn inner_test_simple_naming_system(owned_env: &mut OwnedEnvironment, version: Cl
537
537
ClarityVersion :: Clarity1 ,
538
538
) ;
539
539
540
+ let mut store = MemoryBackingStore :: new ( ) ;
541
+ let mut analysis_db = store. as_analysis_db ( ) ;
542
+ analysis_db. begin ( ) ;
543
+
540
544
{
541
545
let mut env = owned_env. get_exec_environment ( None , None , & placeholder_context) ;
542
546
543
547
let contract_identifier = QualifiedContractIdentifier :: local ( "tokens" ) . unwrap ( ) ;
544
- env. initialize_contract ( contract_identifier, tokens_contract, ASTRules :: PrecheckSize )
545
- . unwrap ( ) ;
548
+ env. initialize_contract_with_db (
549
+ contract_identifier,
550
+ tokens_contract,
551
+ ASTRules :: PrecheckSize ,
552
+ & mut analysis_db,
553
+ )
554
+ . unwrap ( ) ;
546
555
547
556
let contract_identifier = QualifiedContractIdentifier :: local ( "names" ) . unwrap ( ) ;
548
- env. initialize_contract ( contract_identifier, names_contract, ASTRules :: PrecheckSize )
549
- . unwrap ( ) ;
557
+ env. initialize_contract_with_db (
558
+ contract_identifier,
559
+ names_contract,
560
+ ASTRules :: PrecheckSize ,
561
+ & mut analysis_db,
562
+ )
563
+ . unwrap ( ) ;
550
564
}
551
565
552
566
{
0 commit comments