Skip to content

Commit

Permalink
chore: publish PoolMetrics to child node
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Dec 10, 2024
1 parent 99682d4 commit e3d94c3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/fast-usdc/src/fast-usdc.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ export const meta = {
privateArgsShape: {
// @ts-expect-error TypedPattern not recognized as record
...OrchestrationPowersShape,
assetInfo: M.arrayOf([DenomShape, DenomDetailShape]),
chainInfo: M.recordOf(M.string(), CosmosChainInfoShape),
feeConfig: FeeConfigShape,
marshaller: M.remotable(),
chainInfo: M.recordOf(M.string(), CosmosChainInfoShape),
assetInfo: M.arrayOf([DenomShape, DenomDetailShape]),
poolMetricsNode: M.remotable(),
},
};
harden(meta);
Expand Down Expand Up @@ -86,10 +87,11 @@ const publishAddresses = (contractNode, addresses) => {
/**
* @param {ZCF<FastUsdcTerms>} zcf
* @param {OrchestrationPowers & {
* marshaller: Marshaller;
* feeConfig: FeeConfig;
* chainInfo: Record<string, CosmosChainInfo>;
* assetInfo: [Denom, DenomDetail & { brandKey?: string}][];
* chainInfo: Record<string, CosmosChainInfo>;
* feeConfig: FeeConfig;
* marshaller: Marshaller;
* poolMetricsNode: Remote<StorageNode>;
* }} privateArgs
* @param {Zone} zone
* @param {OrchestrationTools} tools
Expand Down Expand Up @@ -237,7 +239,7 @@ export const contract = async (zcf, privateArgs, zone, tools) => {
);

const poolKit = zone.makeOnce('Liquidity Pool kit', () =>
makeLiquidityPoolKit(shareMint, privateArgs.storageNode),
makeLiquidityPoolKit(shareMint, privateArgs.poolMetricsNode),
);

/** Chain, connection, and asset info can only be registered once */
Expand Down
3 changes: 3 additions & 0 deletions packages/fast-usdc/src/fast-usdc.start.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const publishDisplayInfo = async (brand, { board, chainStorage }) => {
};

const FEED_POLICY = 'feedPolicy';
const POOL_METRICS = 'poolMetrics';

/**
* @param {ERef<StorageNode>} node
Expand Down Expand Up @@ -175,13 +176,15 @@ export const startFastUSDC = async (
chainStorage,
},
);
const poolMetricsNode = await E(storageNode).makeChildNode(POOL_METRICS);

const privateArgs = await deeplyFulfilledObject(
harden({
agoricNames,
feeConfig,
localchain,
orchestrationService: cosmosInterchainService,
poolMetricsNode,
storageNode,
timerService,
marshaller,
Expand Down
1 change: 1 addition & 0 deletions packages/fast-usdc/test/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export const commonSetup = async (t: ExecutionContext<any>) => {
localchain,
orchestrationService: cosmosInterchainService,
storageNode: storage.rootNode,
poolMetricsNode: storage.rootNode.makeChildNode('poolMetrics'),
marshaller,
timerService: timer,
feeConfig: makeTestFeeConfig(usdc),
Expand Down

0 comments on commit e3d94c3

Please sign in to comment.