@@ -36,7 +36,9 @@ describe('sheafify', () => {
3636 } ,
3737 ] ;
3838
39- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( { lift } ) ;
39+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
40+ lift,
41+ } ) ;
4042 expect ( await E ( wallet ) . getBalance ( 'alice' ) ) . toBe ( 42 ) ;
4143 expect ( liftCalled ) . toBe ( false ) ;
4244 } ) ;
@@ -55,7 +57,7 @@ describe('sheafify', () => {
5557 } ,
5658 ] ;
5759
58- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
60+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
5961 lift : async ( _germs ) => Promise . resolve ( 0 ) ,
6062 } ) ;
6163 await expect ( E ( wallet ) . getBalance ( 'bob' ) ) . rejects . toThrow (
@@ -99,7 +101,7 @@ describe('sheafify', () => {
99101 } ,
100102 ] ;
101103
102- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
104+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
103105 lift : argmin ,
104106 } ) ;
105107 // argmin picks cost=1 section which returns 42
@@ -131,7 +133,7 @@ describe('sheafify', () => {
131133 } ,
132134 ] ;
133135
134- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
136+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
135137 lift : async ( _germs ) => Promise . resolve ( 0 ) ,
136138 } ) ;
137139 const guard = wallet [ GET_INTERFACE_GUARD ] ( ) ;
@@ -167,7 +169,7 @@ describe('sheafify', () => {
167169 } ,
168170 ] ;
169171
170- let wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
172+ let wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
171173 lift : argmin ,
172174 } ) ;
173175 expect ( await E ( wallet ) . getBalance ( 'alice' ) ) . toBe ( 100 ) ;
@@ -189,7 +191,7 @@ describe('sheafify', () => {
189191 ) as unknown as Section ,
190192 metadata : { cost : 1 } ,
191193 } ) ;
192- wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
194+ wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
193195 lift : argmin ,
194196 } ) ;
195197
@@ -215,7 +217,7 @@ describe('sheafify', () => {
215217 { exo : exo as unknown as Section , metadata : { cost : 1 } } ,
216218 ] ;
217219
218- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
220+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
219221 lift : async ( _germs ) => Promise . resolve ( 0 ) ,
220222 } ) ;
221223 expect ( await E ( wallet ) . getBalance ( 'alice' ) ) . toBe ( 42 ) ;
@@ -247,7 +249,7 @@ describe('sheafify', () => {
247249 } ,
248250 ] ;
249251
250- let wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
252+ let wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
251253 lift : argmin ,
252254 } ) ;
253255 expect ( await E ( wallet ) . getBalance ( 'alice' ) ) . toBe ( 100 ) ;
@@ -267,7 +269,7 @@ describe('sheafify', () => {
267269 } ,
268270 ) ;
269271 sections . push ( { exo : exo as unknown as Section , metadata : { cost : 1 } } ) ;
270- wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
272+ wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
271273 lift : argmin ,
272274 } ) ;
273275
@@ -293,7 +295,7 @@ describe('sheafify', () => {
293295 { exo : exo as unknown as Section , metadata : { cost : 1 } } ,
294296 ] ;
295297
296- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
298+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
297299 lift : async ( _germs ) => Promise . resolve ( 0 ) ,
298300 } ) ;
299301 const guard = wallet [ GET_INTERFACE_GUARD ] ( ) ;
@@ -337,7 +339,7 @@ describe('sheafify', () => {
337339 } ,
338340 ] ;
339341
340- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
342+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
341343 lift : spy ,
342344 } ) ;
343345 await E ( wallet ) . getBalance ( 'alice' ) ;
@@ -387,7 +389,7 @@ describe('sheafify', () => {
387389 } ,
388390 ] ;
389391
390- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
392+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
391393 lift : spy ,
392394 } ) ;
393395 await E ( wallet ) . getBalance ( 'alice' ) ;
@@ -424,7 +426,7 @@ describe('sheafify', () => {
424426 } ,
425427 ] ;
426428
427- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
429+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
428430 lift : async ( _germs ) => {
429431 liftCalled = true ;
430432 return Promise . resolve ( 0 ) ;
@@ -470,7 +472,7 @@ describe('sheafify', () => {
470472 { exo : exo as unknown as Section , metadata : { cost : 1 } } ,
471473 ] ;
472474
473- const wallet = sheafify ( { name : 'Wallet' , sections } ) . getSection ( {
475+ const wallet = sheafify ( { name : 'Wallet' , sections } ) . getGlobalSection ( {
474476 lift : argmin ,
475477 } ) ;
476478 // argmin picks the exo section (cost=1)
@@ -496,7 +498,7 @@ describe('sheafify', () => {
496498 ] ;
497499
498500 const sheaf = sheafify ( { name : 'Wallet' , sections } ) ;
499- const wallet = sheaf . getSection ( {
501+ const wallet = sheaf . getGlobalSection ( {
500502 lift : async ( ) => Promise . resolve ( 0 ) ,
501503 } ) ;
502504
@@ -528,7 +530,7 @@ describe('sheafify', () => {
528530 ] ;
529531
530532 const sheaf = sheafify ( { name : 'Wallet' , sections } ) ;
531- const wallet = sheaf . getSection ( {
533+ const wallet = sheaf . getGlobalSection ( {
532534 lift : async ( ) => Promise . resolve ( 0 ) ,
533535 } ) ;
534536
@@ -560,7 +562,7 @@ describe('sheafify', () => {
560562 // No sections granted yet
561563 expect ( sheaf . getExported ( ) ) . toBeUndefined ( ) ;
562564
563- sheaf . getSection ( { lift : async ( ) => Promise . resolve ( 0 ) } ) ;
565+ sheaf . getGlobalSection ( { lift : async ( ) => Promise . resolve ( 0 ) } ) ;
564566
565567 const exported = sheaf . getExported ( ) ;
566568 expect ( exported ) . toBeDefined ( ) ;
@@ -583,7 +585,7 @@ describe('sheafify', () => {
583585 ] ;
584586
585587 const sheaf = sheafify ( { name : 'Wallet' , sections } ) ;
586- sheaf . getSection ( { lift : async ( ) => Promise . resolve ( 0 ) } ) ;
588+ sheaf . getGlobalSection ( { lift : async ( ) => Promise . resolve ( 0 ) } ) ;
587589
588590 expect ( sheaf . getExported ( ) ) . toBeDefined ( ) ;
589591
0 commit comments