Commit 8c28605 sklppy88
committed
1 parent 130f512 commit 8c28605 Copy full SHA for 8c28605
File tree 1 file changed +8
-1
lines changed
yarn-project/foundation/src/abi
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -358,7 +358,14 @@ export const ContractArtifactSchema: ZodFor<ContractArtifact> = z.object({
358
358
aztecNrVersion : z . string ( ) . optional ( ) ,
359
359
functions : z . array ( FunctionArtifactSchema ) ,
360
360
outputs : z . object ( {
361
- structs : z . record ( z . array ( AbiTypeSchema ) ) ,
361
+ structs : z . record ( z . array ( AbiTypeSchema ) ) . transform ( structs => {
362
+ for ( const [ key , value ] of Object . entries ( structs ) ) {
363
+ if ( key === 'events' || key === 'functions' ) {
364
+ structs [ key ] = ( value as StructType [ ] ) . sort ( ( a , b ) => a . path > b . path ? - 1 : 1 ) ;
365
+ }
366
+ }
367
+ return structs ;
368
+ } ) ,
362
369
globals : z . record ( z . array ( AbiValueSchema ) ) ,
363
370
} ) ,
364
371
storageLayout : z . record ( z . object ( { slot : schemas . Fr } ) ) ,
You can’t perform that action at this time.
0 commit comments