-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: repair KREAd contract on zoe upgrade
- Loading branch information
1 parent
e4cc97c
commit 84dd229
Showing
3 changed files
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { makeHelpers } from '@agoric/deploy-script-support'; | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async () => | ||
harden({ | ||
sourceSpec: '@agoric/vats/src/proposals/kread-proposal.js', | ||
getManifestCall: ['getManifestForKread'], | ||
}); | ||
|
||
export default async (homeP, endowments) => { | ||
const { writeCoreProposal } = await makeHelpers(homeP, endowments); | ||
await writeCoreProposal('revive-kread', 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { E } from '@endo/far'; | ||
|
||
/** | ||
* @param {BootstrapPowers & { | ||
* consume: { kreadKit: any }; | ||
* }} powers | ||
*/ | ||
export const repairKread = async ({ consume: { kreadKit: kreadKitP } }) => { | ||
console.log('repairSubscribers'); | ||
|
||
const kreadKit = await kreadKitP; | ||
const creatorFacet = kreadKit.creatorFacet; | ||
console.log(`KREAd creatorFacet`, creatorFacet); | ||
await E(creatorFacet).reviveMarketExitSubscribers(); | ||
console.log('KREAd subscribers were revived!'); | ||
}; | ||
|
||
export const getManifestForKread = _powers => ({ | ||
manifest: { | ||
[repairKread.name]: { | ||
consume: { kreadKit: true }, | ||
}, | ||
}, | ||
}); |