Skip to content

Commit

Permalink
refactor: account kit exos
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 29, 2024
1 parent 6382c03 commit edf6c51
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/orchestration/src/examples/stakeAtom.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { makeDurableZone } from '@agoric/zone/durable.js';
import { V as E } from '@agoric/vat-data/vow.js';
import { M } from '@endo/patterns';
import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport';
import { prepareStakingAccountHolder } from '../contracts/stakingAccountHolder.js';
import { prepareStakingAccountKit } from '../exos/stakingAccountKit.js';

const trace = makeTracer('StakeAtom');
/**
Expand Down Expand Up @@ -41,7 +41,7 @@ export const start = async (zcf, privateArgs, baggage) => {

const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller);

const makeStakingAccountHolder = prepareStakingAccountHolder(
const makeStakingAccountKit = prepareStakingAccountKit(
baggage,
makeRecorderKit,
zcf,
Expand All @@ -54,7 +54,7 @@ export const start = async (zcf, privateArgs, baggage) => {
);
const accountAddress = await E(account).getAccountAddress();
trace('account address', accountAddress);
const { holder, invitationMakers } = makeStakingAccountHolder(
const { holder, invitationMakers } = makeStakingAccountKit(
account,
storageNode,
accountAddress,
Expand Down
6 changes: 3 additions & 3 deletions packages/orchestration/src/examples/stakeBld.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { M } from '@endo/patterns';
import { E } from '@endo/far';
import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/recorder.js';
import { atomicTransfer } from '@agoric/zoe/src/contractSupport/atomicTransfer.js';
import { prepareAccountHolder } from '../contracts/localchainAccountHolder.js';
import { prepareLocalchainAccountKit } from '../exos/localchainAccountKit.js';

const trace = makeTracer('StakeBld');

Expand All @@ -35,7 +35,7 @@ export const start = async (zcf, privateArgs, baggage) => {
baggage,
privateArgs.marshaller,
);
const makeAccountHolderKit = prepareAccountHolder(
const makeLocalchainAccountKit = prepareLocalchainAccountKit(
baggage,
makeRecorderKit,
zcf,
Expand All @@ -56,7 +56,7 @@ export const start = async (zcf, privateArgs, baggage) => {
await E(lcaSeatKit.userSeat).tryExit();
trace('awaiting payouts');
const payouts = await E(lcaSeatKit.userSeat).getPayouts();
const { holder, invitationMakers } = makeAccountHolderKit(
const { holder, invitationMakers } = makeLocalchainAccountKit(
account,
privateArgs.storageNode,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PUBLIC_TOPICS = {
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit
* @param {ZCF} zcf
*/
export const prepareAccountHolder = (baggage, makeRecorderKit, zcf) => {
export const prepareLocalchainAccountKit = (baggage, makeRecorderKit, zcf) => {
const makeAccountHolderKit = prepareExoClassKit(
baggage,
'Account Holder',
Expand Down Expand Up @@ -152,3 +152,4 @@ export const prepareAccountHolder = (baggage, makeRecorderKit, zcf) => {
);
return makeAccountHolderKit;
};
/** @typedef {ReturnType<ReturnType<typeof prepareLocalchainAccountKit>>} LocalchainAccountKit */
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const PUBLIC_TOPICS = {
* @param {MakeRecorderKit} makeRecorderKit
* @param {ZCF} zcf
*/
export const prepareStakingAccountHolder = (baggage, makeRecorderKit, zcf) => {
const makeAccountHolderKit = prepareExoClassKit(
export const prepareStakingAccountKit = (baggage, makeRecorderKit, zcf) => {
const makeStakingAccountKit = prepareExoClassKit(
baggage,
'Staking Account Holder',
{
Expand Down Expand Up @@ -193,5 +193,6 @@ export const prepareStakingAccountHolder = (baggage, makeRecorderKit, zcf) => {
},
},
);
return makeAccountHolderKit;
return makeStakingAccountKit;
};
/** @typedef {ReturnType<ReturnType<typeof prepareStakingAccountKit>>} StakingAccountKit */

0 comments on commit edf6c51

Please sign in to comment.