test(fba): retain parent proof across isolated fragment contexts
This commit is contained in:
@@ -294,18 +294,20 @@ test('DELIVERY evidence failure still restores and restoration drift is a blocki
|
||||
test('F40 hook faults only first signature, captures whole inventory and always cleans failed signing',async()=>{
|
||||
const calls=[],restoration={restored:true,healthy:true,proxyStopped:true}
|
||||
const inventory={scope:{...deliveryScope,warehouseId:'9',coverage:'CUSTOMER_WAREHOUSE_COMPLETE'},balances:[],positions:[],ledger:[]}
|
||||
const context={context:{f40DeliveryEventFaultExecutor:{prepare:async s=>{assert.deepEqual(s,deliveryScope);calls.push('prepare')},
|
||||
const parentProof={}
|
||||
const context={context:{f40RootFulfillmentProof:parentProof,f40DeliveryEventFaultExecutor:{prepare:async s=>{assert.deepEqual(s,deliveryScope);calls.push('prepare')},
|
||||
readProof:async()=>{calls.push('proof');return {...deliveryProof(),restored:true,restoration}},cleanup:async()=>{calls.push('cleanup');return restoration}},
|
||||
f40ReadOnlyInventoryEvidence:async s=>{assert.equal(s.warehouseId,'9');calls.push('inventory');return structuredClone(inventory)}},createdResources:{phase5RootFulfillment:{}}}
|
||||
f40ReadOnlyInventoryEvidence:async s=>{assert.equal(s.warehouseId,'9');calls.push('inventory');return structuredClone(inventory)}},createdResources:{phase3OrderSplitting:{}}}
|
||||
assert.equal(await withDeliveryEventRecovery(context,deliveryScope,'9',0,async()=>{calls.push('sign');return 'signed'}),'signed')
|
||||
assert.deepEqual(calls,['inventory','prepare','sign','proof','inventory','cleanup'])
|
||||
assert.equal(context.createdResources.phase5RootFulfillment.deliveryEventRecovery.status,'VERIFIED')
|
||||
assert.equal(parentProof.deliveryEventRecovery.status,'VERIFIED')
|
||||
assert.equal(context.createdResources.phase5RootFulfillment,undefined)
|
||||
await withDeliveryEventRecovery(context,deliveryScope,'9',1,async()=>calls.push('second'))
|
||||
assert.equal(calls.at(-1),'second')
|
||||
context.createdResources.phase5RootFulfillment={}
|
||||
context.context.f40RootFulfillmentProof={}
|
||||
await assert.rejects(withDeliveryEventRecovery(context,deliveryScope,'9',0,async()=>{throw Error('sign failed')}),/sign failed/)
|
||||
assert.equal(calls.at(-1),'cleanup')
|
||||
assert.equal(context.createdResources.phase5RootFulfillment.deliveryEventRecovery.restored,true)
|
||||
assert.equal(context.context.f40RootFulfillmentProof.deliveryEventRecovery.restored,true)
|
||||
})
|
||||
test('Python DELIVERY SQL uses actual payload, original Lastleg retry, and Order database without inventory queries',()=>{
|
||||
const result=spawnSync('python',['-c',String.raw`
|
||||
|
||||
Reference in New Issue
Block a user