From d818720791f3e8c4111f61ac5a70656319785cad Mon Sep 17 00:00:00 2001 From: Jorge-Lopes Date: Thu, 28 Nov 2024 12:22:35 +0000 Subject: [PATCH] chore(provisionPool): update core-eval proposal to add governedParamOverrides to privateArgs rel: #10562 --- .../proposals/upgrade-provisionPool-proposal.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/vats/src/proposals/upgrade-provisionPool-proposal.js b/packages/vats/src/proposals/upgrade-provisionPool-proposal.js index 9d31c752607..39ae27df3fb 100644 --- a/packages/vats/src/proposals/upgrade-provisionPool-proposal.js +++ b/packages/vats/src/proposals/upgrade-provisionPool-proposal.js @@ -29,7 +29,7 @@ export const upgradeProvisionPool = async ( provisionPoolStartResultP, instancePrivateArgsP, ]); - const { adminFacet, instance } = provisionPoolStartResult; + const { adminFacet, instance, publicFacet } = provisionPoolStartResult; const [originalPrivateArgs, poserInvitation] = await Promise.all([ // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -38,9 +38,21 @@ export const upgradeProvisionPool = async ( E(electorateCreatorFacet).getPoserInvitation(), ]); + const readCurrentGovernedParams = async () => { + await null; + + const params = await E(publicFacet).getGovernedParams(); + return harden({ + PerAccountInitialAmount: params.PerAccountInitialAmount.value, + }); + }; + const governedParamOverrides = await readCurrentGovernedParams(); + console.log('governedParamOverrides: ', { governedParamOverrides }); + const newPrivateArgs = harden({ ...originalPrivateArgs, initialPoserInvitation: poserInvitation, + governedParamOverrides, }); const upgradeResult = await E(adminFacet).upgradeContract(