@@ -58,7 +58,7 @@ function minimal(overrides?: Record<string, unknown>): Contract {
5858 target : 'postgres' ,
5959 roots : { } ,
6060 models : { } ,
61- storage : { storageHash : coreHash ( 'sha256:stub' ) } ,
61+ storage : { storageHash : coreHash ( 'sha256:stub' ) , namespaces : { } } ,
6262 extensionPacks : { } ,
6363 capabilities : { } ,
6464 meta : { } ,
@@ -131,7 +131,7 @@ describe('canonicalizeContractToObject', () => {
131131
132132 it ( 'includes storageHash when provided inside storage' , ( ) => {
133133 const result = canonicalizeContractToObject (
134- minimal ( { storage : { storageHash : 'sha256:abc' } } ) ,
134+ minimal ( { storage : { storageHash : 'sha256:abc' , namespaces : { } } } ) ,
135135 ) ;
136136 expect ( drill ( result , 'storage' ) [ 'storageHash' ] ) . toBe ( 'sha256:abc' ) ;
137137 } ) ;
@@ -142,7 +142,9 @@ describe('canonicalizeContractToObject', () => {
142142 } ) ;
143143
144144 it ( 'keeps storageHash inside storage' , ( ) => {
145- const result = canonicalizeContractToObject ( minimal ( { storage : { storageHash : 'sha256:s' } } ) ) ;
145+ const result = canonicalizeContractToObject (
146+ minimal ( { storage : { storageHash : 'sha256:s' , namespaces : { } } } ) ,
147+ ) ;
146148 expect ( result ) . not . toHaveProperty ( 'storageHash' ) ;
147149 expect ( drill ( result , 'storage' ) [ 'storageHash' ] ) . toBe ( 'sha256:s' ) ;
148150 } ) ;
@@ -471,7 +473,7 @@ describe('index and unique sorting', () => {
471473
472474 it ( 'handles storage without namespaces (no-op)' , ( ) => {
473475 const result = canonicalizeContractToObject (
474- minimal ( { storage : { storageHash : 'sha256:stub' } } ) ,
476+ minimal ( { storage : { storageHash : 'sha256:stub' , namespaces : { } } } ) ,
475477 ) ;
476478 expect ( result [ 'storage' ] ) . toBeDefined ( ) ;
477479 } ) ;
@@ -597,7 +599,7 @@ describe('canonicalizeContract', () => {
597599
598600 it ( 'produces identical output as JSON.stringify of canonicalizeContractToObject' , ( ) => {
599601 const input = minimal ( {
600- storage : { storageHash : 'sha256:test' } ,
602+ storage : { storageHash : 'sha256:test' , namespaces : { } } ,
601603 profileHash : 'sha256:profile' ,
602604 } ) ;
603605 const objResult = canonicalizeContractToObject ( input ) ;
@@ -684,7 +686,11 @@ describe('typeParams preservation', () => {
684686 it ( 'strips empty storage.types[].typeParams without shouldPreserveEmpty hook' , ( ) => {
685687 const result = canonicalizeContractToObject (
686688 minimal ( {
687- storage : { storageHash : 'sha256:stub' , types : { MyType : { typeParams : { } } } } ,
689+ storage : {
690+ storageHash : 'sha256:stub' ,
691+ namespaces : { } ,
692+ types : { MyType : { typeParams : { } } } ,
693+ } ,
688694 } ) ,
689695 ) ;
690696 const myType = drill ( result , 'storage' , 'types' , 'MyType' ) ;
0 commit comments