Skip to content

Commit

Permalink
refactor: rename src methods with 'run'
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jun 14, 2022
1 parent da79f40 commit 02a836b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/governance/test/unitTests/test-paramGovernance.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const setUpZoeForTest = async setJig => {
*
* @typedef {object} TestContext
* @property {ZCF} zcf
* @property {IssuerRecord} runIssuerRecord
* @property {IssuerRecord} mintedIssuerRecord
* @property {IssuerRecord} govIssuerRecord
*/

Expand Down
10 changes: 5 additions & 5 deletions packages/run-protocol/src/runStake/runStakeKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const helperBehavior = {
* @param {MethodContext} context
* @param {ZCFSeat} seat
*/
getRunAllocated: ({ state }, seat) =>
getDebtAllocated: ({ state }, seat) =>
seat.getAmountAllocated(KW.Debt, state.debtBrand),
/**
* @param {MethodContext} context
Expand Down Expand Up @@ -235,11 +235,11 @@ const helperBehavior = {
/**
* @param {MethodContext} context
*/
assertVaultHoldsNoRun: ({ state, facets }) => {
assertVaultHoldsNoDebt: ({ state, facets }) => {
const { vaultSeat } = state;
const { helper } = facets;
assert(
AmountMath.isEmpty(helper.getRunAllocated(vaultSeat)),
AmountMath.isEmpty(helper.getDebtAllocated(vaultSeat)),
X`Vault should be empty of debt`,
);
},
Expand Down Expand Up @@ -315,7 +315,7 @@ const helperBehavior = {

manager.burnDebt(give, vaultSeat);

helper.assertVaultHoldsNoRun();
helper.assertVaultHoldsNoDebt();

void helper.updateUiState();
clientSeat.exit();
Expand Down Expand Up @@ -358,7 +358,7 @@ const helperBehavior = {
state.open = false;
helper.updateDebtSnapshot(AmountMath.makeEmpty(debtBrand));
void helper.updateUiState();
helper.assertVaultHoldsNoRun();
helper.assertVaultHoldsNoDebt();
seat.exit();

return 'Your RUNstake is closed; thank you for your business.';
Expand Down
10 changes: 5 additions & 5 deletions packages/run-protocol/src/vaultFactory/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ const helperBehavior = {
*/
getCollateralAllocated: ({ facets }, seat) =>
seat.getAmountAllocated('Collateral', facets.helper.collateralBrand()),
getRunAllocated: ({ facets }, seat) =>
getDebtAllocated: ({ facets }, seat) =>
seat.getAmountAllocated('Minted', facets.helper.debtBrand()),

assertVaultHoldsNoRun: ({ state, facets }) => {
assertVaultHoldsNoDebt: ({ state, facets }) => {
const { vaultSeat } = state;
assert(
AmountMath.isEmpty(facets.helper.getRunAllocated(vaultSeat)),
AmountMath.isEmpty(facets.helper.getDebtAllocated(vaultSeat)),
X`Vault should be empty of Minted`,
);
},
Expand Down Expand Up @@ -404,7 +404,7 @@ const helperBehavior = {
helper.updateDebtSnapshot(helper.emptyDebt());
helper.updateUiState();

helper.assertVaultHoldsNoRun();
helper.assertVaultHoldsNoDebt();
vaultSeat.exit();

state.manager.handleBalanceChange(
Expand Down Expand Up @@ -522,7 +522,7 @@ const helperBehavior = {
// parent needs to know about the change in debt
helper.updateDebtAccounting(normalizedDebtPre, collateralPre, newDebt);
state.manager.burnAndRecord(giveMinted, vaultSeat);
helper.assertVaultHoldsNoRun();
helper.assertVaultHoldsNoDebt();

helper.updateUiState();
clientSeat.exit();
Expand Down
2 changes: 1 addition & 1 deletion packages/run-protocol/src/vaultFactory/vaultFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const start = async (zcf, privateArgs) => {
privateArgs;
const debtMint = await zcf.registerFeeMint('Minted', feeMintAccess);
zcf.setTestJig(() => ({
runIssuerRecord: debtMint.getIssuerRecord(),
mintedIssuerRecord: debtMint.getIssuerRecord(),
}));

const {
Expand Down

0 comments on commit 02a836b

Please sign in to comment.