Skip to content

Commit

Permalink
fix(orca.flows): validate offerArgs
Browse files Browse the repository at this point in the history
 - prune unused chainInfo
 - tidy up tracing/logging a bit
  • Loading branch information
dckc committed Aug 16, 2024
1 parent 5c4b9d2 commit f48c5af
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions contract/src/orca.flows.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @import {Transfer} from './orca.contract.js';
*/

import { M, mustMatch } from '@endo/patterns';
import { makeTracer } from './debug.js';

const trace = makeTracer('OrchFlows');
Expand All @@ -21,26 +22,17 @@ const trace = makeTracer('OrchFlows');
* @param {ZCFSeat} seat
* @param {{ chainName: string }} offerArgs
*/
export const makeAccount = async (orch, _ctx, seat, { chainName }) => {
const { give } = seat.getProposal();
export const makeAccount = async (orch, _ctx, seat, offerArgs) => {
trace('version 0.1.36');
trace('give');
trace(give);
trace('inside createAccounts');
trace('orch');
trace(orch);
trace('seat');
trace(seat);
trace(chainName);
mustMatch(offerArgs, M.splitRecord({ chainName: M.string() }));
const { chainName } = offerArgs;
trace('chainName', chainName);
seat.exit();
const chain = await orch.getChain(chainName);
trace('chain object');
trace(chain);
const info = await chain.getChainInfo();
trace('chain info', info);
const chainAccount = await chain.makeAccount();
console.log('chainAccount');
console.log(chainAccount);
trace('chainAccount', chainAccount);

return chainAccount.asContinuingOffer();
};
Expand Down

0 comments on commit f48c5af

Please sign in to comment.