File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,22 @@ async function generateOpcodeAnalysis() {
7575 ( row ) => `${ row . contract_name } :${ row . transaction_name } ` ,
7676 )
7777
78- for ( const opcodes of Object . values ( byTransaction ) ) {
78+ // Sort entries by contract_id, then transaction_name
79+ const sortedEntries = Object . entries ( byTransaction ) . sort ( ( a , b ) => {
80+ const txA = a [ 1 ] ?. [ 0 ]
81+ const txB = b [ 1 ] ?. [ 0 ]
82+ if ( ! txA || ! txB ) return 0
83+
84+ // First sort by contract_id
85+ if ( txA . contract_id !== txB . contract_id ) {
86+ return txA . contract_id . localeCompare ( txB . contract_id )
87+ }
88+
89+ // Then by transaction_name
90+ return txA . transaction_name . localeCompare ( txB . transaction_name )
91+ } )
92+
93+ for ( const [ , opcodes ] of sortedEntries ) {
7994 if ( ! opcodes ) continue
8095
8196 const tx = opcodes [ 0 ]
You can’t perform that action at this time.
0 commit comments