File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1656,6 +1656,7 @@ pub mod test {
1656
1656
use std:: { fs, io, thread} ;
1657
1657
1658
1658
use clarity:: boot_util:: boot_code_id;
1659
+ use clarity:: vm:: ast:: parser:: v1:: CONTRACT_MAX_NAME_LENGTH ;
1659
1660
use clarity:: vm:: ast:: ASTRules ;
1660
1661
use clarity:: vm:: costs:: ExecutionCost ;
1661
1662
use clarity:: vm:: database:: STXBalance ;
@@ -2403,7 +2404,17 @@ pub mod test {
2403
2404
let smart_contract = TransactionPayload :: SmartContract (
2404
2405
TransactionSmartContract {
2405
2406
name : ContractName :: try_from (
2406
- conf. test_name . replace ( "::" , "-" ) . to_string ( ) ,
2407
+ conf. test_name
2408
+ . replace ( "::" , "-" )
2409
+ . to_string ( )
2410
+ . chars ( )
2411
+ // ensure auto-generated contract names are not too long
2412
+ . skip (
2413
+ conf. test_name
2414
+ . len ( )
2415
+ . saturating_sub ( CONTRACT_MAX_NAME_LENGTH ) ,
2416
+ )
2417
+ . collect :: < String > ( ) ,
2407
2418
)
2408
2419
. expect ( "FATAL: invalid boot-code contract name" ) ,
2409
2420
code_body : StacksString :: from_str ( & conf. setup_code )
You can’t perform that action at this time.
0 commit comments