-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test orch flow upgrades by bridge message deferral (#9755)
refs: #9303 ## Description Tests restarting an orchestration flow while an IBC message is pending response. #9303 will be closed when this and #9719 have landed. ### Security Considerations none ### Scaling Considerations none ### Documentation Considerations none ### Testing Considerations per se ### Upgrade Considerations helps, no change
- Loading branch information
Showing
6 changed files
with
247 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
packages/builders/scripts/testing/restart-basic-flows.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/** | ||
* @file This is for use in tests. | ||
* Unlike most builder scripts, this one includes the proposal exports as well. | ||
*/ | ||
import { | ||
deeplyFulfilledObject, | ||
makeTracer, | ||
NonNullish, | ||
} from '@agoric/internal'; | ||
import { E } from '@endo/far'; | ||
|
||
/// <reference types="@agoric/vats/src/core/types-ambient"/> | ||
|
||
const trace = makeTracer('RestartBasicFlows', true); | ||
|
||
/** | ||
* @import {start as StartFn} from '@agoric/orchestration/src/examples/basic-flows.contract.js'; | ||
*/ | ||
|
||
/** | ||
* @param {BootstrapPowers} powers | ||
*/ | ||
export const restartBasicFlows = async ({ | ||
consume: { | ||
agoricNames, | ||
board, | ||
chainStorage, | ||
chainTimerService, | ||
cosmosInterchainService, | ||
localchain, | ||
|
||
contractKits, | ||
}, | ||
instance: instances, | ||
}) => { | ||
trace(restartBasicFlows.name); | ||
|
||
// @ts-expect-error unknown instance | ||
const instance = await instances.consume.basicFlows; | ||
trace('instance', instance); | ||
/** @type {StartedInstanceKit<StartFn>} */ | ||
const kit = /** @type {any} */ (await E(contractKits).get(instance)); | ||
|
||
const marshaller = await E(board).getReadonlyMarshaller(); | ||
|
||
const privateArgs = await deeplyFulfilledObject( | ||
harden({ | ||
agoricNames, | ||
localchain, | ||
marshaller, | ||
orchestrationService: cosmosInterchainService, | ||
storageNode: E(NonNullish(await chainStorage)).makeChildNode( | ||
'basicFlows', | ||
), | ||
timerService: chainTimerService, | ||
}), | ||
); | ||
|
||
await E(kit.adminFacet).restartContract(privateArgs); | ||
trace('done'); | ||
}; | ||
harden(restartBasicFlows); | ||
|
||
export const getManifest = () => { | ||
return { | ||
manifest: { | ||
[restartBasicFlows.name]: { | ||
consume: { | ||
agoricNames: true, | ||
board: true, | ||
chainStorage: true, | ||
chainTimerService: true, | ||
cosmosInterchainService: true, | ||
localchain: true, | ||
|
||
contractKits: true, | ||
}, | ||
instance: { | ||
consume: { basicFlows: true }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async () => | ||
harden({ | ||
// Somewhat unorthodox, source the exports from this builder module | ||
sourceSpec: '@agoric/builders/scripts/testing/restart-basic-flows.js', | ||
getManifestCall: [getManifest.name], | ||
}); | ||
|
||
export default async (homeP, endowments) => { | ||
// import dynamically so the module can work in CoreEval environment | ||
const dspModule = await import('@agoric/deploy-script-support'); | ||
const { makeHelpers } = dspModule; | ||
const { writeCoreEval } = await makeHelpers(homeP, endowments); | ||
await writeCoreEval(restartBasicFlows.name, defaultProposalBuilder); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters