Skip to content

Commit

Permalink
fixup! test: bootstrap test for portfolio holder
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Jul 17, 2024
1 parent ca2df2c commit 92ac64b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
8 changes: 4 additions & 4 deletions packages/boot/test/bootstrapTests/orchestration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ test.serial('basic-flows - portfolio holder', async t => {
invitationSpec: {
source: 'continuing',
previousOffer: 'request-portfolio-acct',
invitationMakerName: 'Action',
invitationMakerName: 'MakeInvitation',
invitationArgs: [
'cosmoshub',
'Delegate',
Expand All @@ -386,7 +386,7 @@ test.serial('basic-flows - portfolio holder', async t => {
invitationSpec: {
source: 'continuing',
previousOffer: 'request-portfolio-acct',
invitationMakerName: 'Action',
invitationMakerName: 'MakeInvitation',
invitationArgs: [
'agoric',
'Delegate',
Expand All @@ -407,7 +407,7 @@ test.serial('basic-flows - portfolio holder', async t => {
invitationSpec: {
source: 'continuing',
previousOffer: 'request-portfolio-acct',
invitationMakerName: 'Action',
invitationMakerName: 'MakeInvitation',
invitationArgs: [
'cosmoshub',
'Delegate',
Expand All @@ -424,7 +424,7 @@ test.serial('basic-flows - portfolio holder', async t => {
invitationSpec: {
source: 'continuing',
previousOffer: 'request-portfolio-acct',
invitationMakerName: 'Action',
invitationMakerName: 'MakeInvitation',
invitationArgs: [
'agoric',
'Delegate',
Expand Down
24 changes: 11 additions & 13 deletions packages/orchestration/src/examples/basic-flows.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
*/
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
import { M, mustMatch } from '@endo/patterns';
import { provideOrchestration } from '../utils/start-helper.js';
import { withOrchestration } from '../utils/start-helper.js';
import { preparePortfolioHolder } from '../exos/portfolio-holder-kit.js';

/**
* @import {Baggage} from '@agoric/vat-data';
* @import {Zone} from '@agoric/zone';
* @import {OrchestrationAccount, Orchestrator} from '@agoric/orchestration';
* @import {ResolvedPublicTopic} from '@agoric/zoe/src/contractSupport/topics.js';
* @import {OrchestrationPowers} from '../utils/start-helper.js';
* @import {MakePortfolioHolder} from '../exos/portfolio-holder-kit.js';
* @import {OrchestrationTools} from '../utils/start-helper.js';
*/

/**
Expand All @@ -35,8 +36,8 @@ const makeOrchAccountHandler = async (orch, _ctx, seat, { chainName }) => {
/**
* Create accounts on multiple chains and return them in a single continuing
* offer with invitations makers for Delegate, WithdrawRewards, Transfer, etc.
* Calls to the underlying invitationMakers are proxied through the `Action`
* invitation maker.
* Calls to the underlying invitationMakers are proxied through the
* `MakeInvitation` invitation maker.
*
* @param {Orchestrator} orch
* @param {MakePortfolioHolder} makePortfolioHolder
Expand Down Expand Up @@ -81,16 +82,11 @@ const makePortfolioAcctHandler = async (
* @param {ZCF} zcf
* @param {OrchestrationPowers & {
* marshaller: Marshaller;
* }} privateArgs
* @param {Baggage} baggage
* }} _privateArgs
* @param {Zone} zone
* @param {OrchestrationTools} tools
*/
export const start = async (zcf, privateArgs, baggage) => {
const { orchestrate, vowTools, zone } = provideOrchestration(
zcf,
baggage,
privateArgs,
privateArgs.marshaller,
);
const contract = async (zcf, _privateArgs, zone, { orchestrate, vowTools }) => {
const makePortfolioHolder = preparePortfolioHolder(
zone.subZone('portfolio'),
vowTools,
Expand Down Expand Up @@ -133,4 +129,6 @@ export const start = async (zcf, privateArgs, baggage) => {
return { publicFacet };
};

export const start = withOrchestration(contract);

/** @typedef {typeof start} BasicFlowsSF */

0 comments on commit 92ac64b

Please sign in to comment.