Skip to content

Commit

Permalink
refactor: clean up VaultFactory exported types
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jul 22, 2022
1 parent 4163bf8 commit 72ceb6f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/inter-protocol/exported.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './src/runStake/types.js';
import './src/psm/types.js';
import './src/vaultFactory/types.js';
import './src/vpool-xyk-amm/types.js';
2 changes: 0 additions & 2 deletions packages/inter-protocol/src/exported.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/inter-protocol/src/proposals/econ-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CENTRAL_DENOM_NAME = 'urun';
* reserveCreatorFacet: import('../reserve/assetReserve.js').AssetReserveCreatorFacet,
* reserveGovernorCreatorFacet: GovernedContractFacetAccess<unknown>,
* runStakeCreatorFacet: import('../runStake/runStake.js').RunStakeCreator,
* vaultFactoryCreator: VaultFactory,
* vaultFactoryCreator: VaultFactoryCreatorFacet,
* vaultFactoryGovernorCreator: GovernedContractFacetAccess<unknown>,
* vaultFactoryVoteCreator: unknown,
* minInitialDebt: NatValue,
Expand Down
3 changes: 2 additions & 1 deletion packages/inter-protocol/src/vaultFactory/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @typedef {import('./vaultManager').CollateralManager} CollateralManager
* @typedef {import('../reserve/assetReserve.js').AssetReserveCreatorFacet} AssetReserveCreatorFacet
* @typedef {import('../reserve/assetReserve.js').AssetReservePublicFacet} AssetReservePublicFacet
* @typedef {import('./vaultFactory.js').VaultFactoryContract['publicFacet']} VaultFactoryPublicFacet
*/

/**
Expand Down Expand Up @@ -45,7 +46,7 @@
*/

/**
* @typedef {object} VaultFactory - the creator facet
* @typedef {object} VaultFactoryCreatorFacet
* @property {AddVaultType} addVaultType
* @property {() => Promise<Array<Collateral>>} getCollaterals
* @property {() => Allocation} getRewardAllocation
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 @@ -260,7 +260,7 @@ const watchGovernance = (govParams, vaultManager, oldInstall, oldTerms) => {
});
};

/** @type {import('@agoric/vat-data/src/types').FunctionsPlusContext<MethodContext, VaultFactory>} */
/** @type {import('@agoric/vat-data/src/types').FunctionsPlusContext<MethodContext, VaultFactoryCreatorFacet>} */
const machineBehavior = {
// TODO move this under governance #3924
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/inter-protocol/test/vaultFactory/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ const setupServices = async (
await startVaultFactory(space, { loanParams: loanTiming }, minInitialDebt);

const governorCreatorFacet = consume.vaultFactoryGovernorCreator;
/** @type {Promise<VaultFactory & LimitedCreatorFacet<any>>} */
/** @type {Promise<VaultFactoryCreatorFacet & LimitedCreatorFacet<any>>} */
const vaultFactoryCreatorFacet = /** @type { any } */ (
E(governorCreatorFacet).getCreatorFacet()
);
Expand All @@ -321,7 +321,7 @@ const setupServices = async (
rates,
);

/** @type {[any, VaultFactory, VFC['publicFacet'], VaultManager]} */
/** @type {[any, VaultFactoryCreatorFacet, VFC['publicFacet'], VaultManager]} */
// @ts-expect-error cast
const [governorInstance, vaultFactory, lender, aethVaultManager] =
await Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ const setupServices = async (
await startVaultFactory(space, { loanParams: loanTiming }, minInitialDebt);

const governorCreatorFacet = consume.vaultFactoryGovernorCreator;
/** @type {Promise<VaultFactory & LimitedCreatorFacet<VaultFactory>>} */
/** @type {Promise<VaultFactoryCreatorFacet & LimitedCreatorFacet<VaultFactoryCreatorFacet>>} */
const vaultFactoryCreatorFacetP = E(governorCreatorFacet).getCreatorFacet();
const reserveCreatorFacet = consume.reserveCreatorFacet;
const reserveFacets = { reserveCreatorFacet };
Expand All @@ -350,7 +350,7 @@ const setupServices = async (
'AEth',
rates,
);
/** @type {[any, VaultFactory, VFC['publicFacet'], VaultManager, PriceAuthority]} */
/** @type {[any, VaultFactoryCreatorFacet, VFC['publicFacet'], VaultManager, PriceAuthority]} */
// @ts-expect-error cast
const [
governorInstance,
Expand Down

0 comments on commit 72ceb6f

Please sign in to comment.