-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: record instances that will be replaced so we can manage them
- Loading branch information
1 parent
6e25d9f
commit c883c39
Showing
12 changed files
with
191 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
restart-valueVow | ||
start-valueVow | ||
localchaintest-submission | ||
recorded-instances-submission |
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
11 changes: 11 additions & 0 deletions
11
a3p-integration/proposals/z:acceptance/recorded-retired.test.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,11 @@ | ||
import test from 'ava'; | ||
|
||
import { evalBundles } from '@agoric/synthetic-chain'; | ||
|
||
const SUBMISSION_DIR = 'recorded-instances-submission'; | ||
|
||
test(`recorded instances in u18`, async t => { | ||
const result = await evalBundles(SUBMISSION_DIR); | ||
console.log('recorded retired instance result:', result); | ||
t.pass('checked names'); | ||
}); |
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
73 changes: 73 additions & 0 deletions
73
packages/builders/scripts/testing/recorded-retired-instances.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,73 @@ | ||
import { makeTracer } from '@agoric/internal'; | ||
import { E } from '@endo/far'; | ||
|
||
const trace = makeTracer('RecordedRetired', true); | ||
|
||
/** | ||
* @param {BootstrapPowers & | ||
* PromiseSpaceOf<{ retiredContractInstances: MapStore<string, Instance>; | ||
* }> | ||
* } powers | ||
*/ | ||
export const testRecordedRetiredInstances = async ({ | ||
consume: { | ||
contractKits, | ||
// governedContractKits, | ||
retiredContractInstances: retiredContractInstancesP, | ||
}, | ||
}) => { | ||
trace('Start'); | ||
const retiredContractInstances = await retiredContractInstancesP; | ||
|
||
const auctionIDs = Array.from(retiredContractInstances.keys()).filter(k => | ||
k.startsWith('auction'), | ||
); | ||
assert(auctionIDs); | ||
assert(auctionIDs.length === 1); | ||
const auctionInstance = retiredContractInstances.get(auctionIDs[0]); | ||
trace({ auctionInstance }); | ||
// I don't know why it's neither in governedContractKits nor contractKits | ||
// assert(await E(governedContractKits).get(auctionInstance)); | ||
|
||
const committeeIDs = Array.from(retiredContractInstances.keys()).filter(k => | ||
k.startsWith('economicCommittee'), | ||
); | ||
assert(committeeIDs); | ||
assert(committeeIDs.length === 1); | ||
const committeeInstance = retiredContractInstances.get(committeeIDs[0]); | ||
assert(await E(contractKits).get(committeeInstance)); | ||
|
||
trace('done'); | ||
}; | ||
harden(testRecordedRetiredInstances); | ||
|
||
export const getManifestForRecordedRetiredInstances = () => { | ||
return { | ||
manifest: { | ||
[testRecordedRetiredInstances.name]: { | ||
consume: { | ||
contractKits: true, | ||
// governedContractKits: true, | ||
retiredContractInstances: true, | ||
}, | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async () => | ||
harden({ | ||
sourceSpec: | ||
'@agoric/builders/scripts/testing/recorded-retired-instances.js', | ||
getManifestCall: ['getManifestForRecordedRetiredInstances', {}], | ||
}); | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */ | ||
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('recorded-retired', 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
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
Oops, something went wrong.