File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
clarity/src/vm/ast/definition_sorter
stackslib/src/chainstate/tests Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ impl DefinitionSorter {
9090 let sorted_indexes = walker. get_sorted_dependencies ( & self . graph ) ;
9191
9292 if let Some ( deps) = walker. get_cycling_dependencies ( & self . graph , & sorted_indexes) {
93- let functions_names = deps
93+ let mut function_names = deps
9494 . into_iter ( )
9595 . filter_map ( |i| {
9696 let exp = & contract_ast. pre_expressions [ i] ;
@@ -99,7 +99,10 @@ impl DefinitionSorter {
9999 . map ( |i| i. 0 . to_string ( ) )
100100 . collect :: < Vec < _ > > ( ) ;
101101
102- let error = ParseError :: new ( ParseErrors :: CircularReference ( functions_names) ) ;
102+ // Sorting function names to make the error contents deterministic
103+ function_names. sort ( ) ;
104+
105+ let error = ParseError :: new ( ParseErrors :: CircularReference ( function_names) ) ;
103106 return Err ( error) ;
104107 }
105108
Original file line number Diff line number Diff line change 1717use clarity:: vm:: ast:: parser:: v2:: MAX_CONTRACT_NAME_LEN ;
1818use clarity:: vm:: ast:: stack_depth_checker:: AST_CALL_STACK_DEPTH_BUFFER ;
1919use clarity:: vm:: MAX_CALL_STACK_DEPTH ;
20-
2120#[ allow( unused_imports) ] // Just used for documentation purpose
2221use clarity:: vm:: { ast:: errors:: ParseErrors , representations:: ContractName } ;
22+
2323use crate :: chainstate:: tests:: consensus:: contract_deploy_consensus_test;
2424
2525/// ParserError: [`ParseErrors::ExpressionStackDepthTooDeep`]
You can’t perform that action at this time.
0 commit comments