diff --git a/packages/inter-protocol/src/vaultFactory/vaultDirector.js b/packages/inter-protocol/src/vaultFactory/vaultDirector.js index fdfa8d2f9d9..56e0706f3f1 100644 --- a/packages/inter-protocol/src/vaultFactory/vaultDirector.js +++ b/packages/inter-protocol/src/vaultFactory/vaultDirector.js @@ -325,6 +325,7 @@ const prepareVaultDirector = ( getGovernedParams: M.callWhen({ collateralBrand: BrandShape }).returns( M.record(), ), + getDirectorGovernedParams: M.call().returns(M.promise()), getInvitationAmount: M.call(M.string()).returns(AmountShape), getPublicTopics: M.call().returns(TopicsRecordShape), }), @@ -492,7 +493,7 @@ const prepareVaultDirector = ( }, /** * Note this works only for a collateral manager. For the director use, - * `getElectorateSubscription` + * `getDirectorGovernedParams` * * @param {{ collateralBrand: Brand }} selector */ @@ -500,6 +501,9 @@ const prepareVaultDirector = ( // TODO use named getters of TypedParamManager return vaultParamManagers.get(collateralBrand).getParams(); }, + getDirectorGovernedParams() { + return directorParamManager.getParams(); + }, /** @param {string} name */ getInvitationAmount(name) { return directorParamManager.getInvitationAmount(name); diff --git a/packages/inter-protocol/test/vaultFactory/vaultFactory.test.js b/packages/inter-protocol/test/vaultFactory/vaultFactory.test.js index f285b00bd00..f7d8b8bc296 100644 --- a/packages/inter-protocol/test/vaultFactory/vaultFactory.test.js +++ b/packages/inter-protocol/test/vaultFactory/vaultFactory.test.js @@ -2049,4 +2049,39 @@ test('governance publisher', async t => { LiquidationPenalty: { type: 'ratio' }, MintFee: { type: 'ratio' }, }); + + const params = await E(vfPublic).getDirectorGovernedParams(); + t.like(params, { + ChargingPeriod: { type: 'nat', value: 2n }, + Electorate: { type: 'invitation' }, + MinInitialDebt: { type: 'amount' }, + RecordingPeriod: { type: 'nat' }, + ReferencedUI: { value: 'abracadabra' }, + ShortfallInvitation: { type: 'invitation' }, + }); +}); + +test('access to director params', async t => { + const { aeth } = t.context; + + t.context.referencedUi = 'hocus pocus'; + const services = await setupServices( + t, + [500n, 15n], + aeth.make(900n), + undefined, + undefined, + 500n, + ); + const { vfPublic } = services.vaultFactory; + + const params = await E(vfPublic).getDirectorGovernedParams(); + t.like(params, { + ChargingPeriod: { type: 'nat', value: 2n }, + Electorate: { type: 'invitation' }, + MinInitialDebt: { type: 'amount' }, + RecordingPeriod: { type: 'nat' }, + ReferencedUI: { value: 'hocus pocus' }, + ShortfallInvitation: { type: 'invitation' }, + }); });