Skip to content

Commit

Permalink
#40 updated agoric-sdk to community-dev branch and made the dapp …
Browse files Browse the repository at this point in the history
…work.
  • Loading branch information
anilhelvaci committed Dec 21, 2022
1 parent 0b25bb2 commit 124265a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions contract/src/governance/lendingPoolElectorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const start = (zcf) => {

const addQuestion = async (counterInstallation, questionSpec) => {
assertGovernedContextInitialized(governedContext);
const { publisher: outcomePublisher } = makePublishKit();

const { publicFacet, instance } = await startCounter(
zcf,
Expand All @@ -41,6 +42,7 @@ const start = (zcf) => {
counterInstallation,
allQuestions,
questionsPublisher,
outcomePublisher,
);

return { publicFacet, instance };
Expand Down
1 change: 0 additions & 1 deletion contract/src/lendingPool/lendingPool.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import '@agoric/zoe/exported.js';
import '@agoric/zoe/src/contracts/exported.js';

import { E } from '@endo/far';
import '@agoric/governance/src/exported.js';
import { AmountMath, AssetKind } from '@agoric/ertp';
import { makeTracer } from '@agoric/inter-protocol/src/makeTracer.js';
import { makeScalarMap } from '@agoric/store';
Expand Down
17 changes: 10 additions & 7 deletions contract/test/lendingPool/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { makeRatio } from '@agoric/zoe/src/contractSupport/index.js';
import { makeGovernedTerms } from '../../src/lendingPool/params.js';
import { setupAMMBootstrap } from '@agoric/inter-protocol/test/amm/vpool-xyk-amm/setup.js';
import { provideBundle } from '@agoric/inter-protocol/test/supports.js';
import { setupAmm, setupReserve, startEconomicCommittee } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
import { setupAmm, setupReserve } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
import { startEconomicCommittee } from '@agoric/inter-protocol/src/proposals/startEconCommittee.js';
import { makePriceManager } from '../../src/lendingPool/priceManager.js';
import { makeLendingPoolScenarioHelpers } from './lendingPoolScenrioHelpers.js';
import { makeLendingPoolAssertions } from './lendingPoolAssertions.js';
Expand Down Expand Up @@ -355,21 +356,23 @@ export const setupAmmAndElectorate = async (
counter: installation.consume.binaryVoteCounter,
});

const governorCreatorFacet = consume.ammGovernorCreatorFacet;
const {
creatorFacet: ammCreatorFacet,
instanceWithoutReserve: governedInstance,
governorCreatorFacet,
publicFacet: ammPublicFacet
} = await consume.ammKit;

const governorInstance = await instance.consume.ammGovernor;
const governorPublicFacet = await E(zoe).getPublicFacet(governorInstance);
const g = {
governorInstance,
governorPublicFacet,
governorCreatorFacet,
};
const governedInstance = E(governorPublicFacet).getGovernedContract();

/** @type { GovernedPublicFacet<XYKAMMPublicFacet> } */
// @ts-expect-error cast from unknown
const ammPublicFacet = await E(governorCreatorFacet).getPublicFacet();
const amm = {
ammCreatorFacet: await consume.ammCreatorFacet,
ammCreatorFacet,
ammPublicFacet,
instance: governedInstance,
};
Expand Down

0 comments on commit 124265a

Please sign in to comment.