Skip to content

Commit

Permalink
chore: declare type for ParamGovernanceExoMakers
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Aug 24, 2023
1 parent e84855a commit bb53e6e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions packages/governance/src/contractGovernance/paramManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ export const buildParamGovernanceExoMakers = (zoe, baggage) => {
};
harden(buildParamGovernanceExoMakers);

/** @typedef {ReturnType<buildParamGovernanceExoMakers>} ParamGovernanceExoMakers */

/**
* @param {ParamManager<*>} paramManager
* @param {{[CONTRACT_ELECTORATE]: ParamValueTyped<'invitation'>}} governedParams
Expand All @@ -446,7 +448,7 @@ harden(assertElectorateMatches);
/**
* @param {import('@agoric/vat-data').Baggage} baggage
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<any>} recorderKit
* @param {any} makers
* @param {ParamGovernanceExoMakers} makers
* @param {ERef<ZoeService>} [zoe]
*/
export const makeParamManagerBuilder = (baggage, recorderKit, makers, zoe) => {
Expand Down Expand Up @@ -662,7 +664,7 @@ harden(makeParamManagerBuilder);
* @param {import('@agoric/vat-data').Baggage} baggage
* @param {T} spec
* @param {ZCF} zcf
* @param {any} makers
* @param {ParamGovernanceExoMakers} makers
* @returns {Promise<ParamManager<{[K in keyof T]: T[K][0]}>>}
*/
export const makeParamManager = (recorderKit, baggage, spec, zcf, makers) => {
Expand Down Expand Up @@ -703,7 +705,7 @@ harden(makeParamManager);
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<any>} recorderKit
* @param {import('@agoric/vat-data').Baggage} baggage
* @param {T} spec
* @param {any} makers
* @param {ParamGovernanceExoMakers} makers
* @returns {ParamManager<{[K in keyof T]: T[K][0]}>}
*/
export const makeParamManagerSync = (recorderKit, baggage, spec, makers) => {
Expand All @@ -727,7 +729,7 @@ harden(makeParamManagerSync);
* @param {import('@agoric/vat-data').Baggage} baggage
* @param {I} invitations invitation objects, which must come from privateArgs
* @param {M} paramTypesMap
* @param {any} makers
* @param {ParamGovernanceExoMakers} makers
* @returns {Promise<ParamManager<M & {[K in keyof I]: 'invitation'}>>}
*/
export const makeParamManagerFromTermsAndMakers = (
Expand Down
8 changes: 5 additions & 3 deletions packages/inter-protocol/src/vaultFactory/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ harden(makeVaultDirectorParams);
const zeroRatio = liquidationMargin =>
subtractRatios(liquidationMargin, liquidationMargin);

/** @typedef {import('@agoric/governance/src/contractGovernance/paramManager.js').ParamGovernanceExoMakers} ParamGovernanceExoMakers */

/**
* @param {import('@agoric/vat-data').Baggage} baggage
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<any>} recorderKit
* @param {VaultManagerParamValues} initial
* @param {any} paramMakerKit
* @param {ParamGovernanceExoMakers} paramMakerKit
*/
export const makeVaultParamManager = (
baggage,
Expand Down Expand Up @@ -210,7 +212,7 @@ export const provideVaultParamManagers = (baggage, makeRecorderKit) => {
* storageNode: StorageNode;
* govStorageNode: StorageNode;
* initialParamValues: VaultManagerParamValues;
* makers: any;
* makers: ParamGovernanceExoMakers;
* directorAccessors: {
* behavior: Record<string, Function>;
* guards: Record<string, import('@endo/patterns').Pattern>;
Expand Down Expand Up @@ -274,7 +276,7 @@ export const provideVaultParamManagers = (baggage, makeRecorderKit) => {
* @param {StorageNode} storageNode
* @param {StorageNode} govStorageNode
* @param {VaultManagerParamValues} initialParamValues
* @param {any} makers
* @param {ParamGovernanceExoMakers} makers
* @param {{
* behavior: Record<string, Function>;
* guards: Record<string, Pattern>;
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/src/vaultFactory/vaultDirector.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const shortfallInvitationKey = 'shortfallInvitation';
* @param {ERef<Marshaller>} marshaller
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeERecorderKit} makeERecorderKit
* @param {any} paramMakerKit
* @param {import('@agoric/governance/src/contractGovernance/paramManager.js').ParamGovernanceExoMakers} paramMakerKit
*/
const prepareVaultDirector = (
baggage,
Expand Down

0 comments on commit bb53e6e

Please sign in to comment.