From e8f6de2aaf1fa5457f4a31bcaa7a742e4634eeb8 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Sun, 1 Dec 2024 22:22:10 -0600 Subject: [PATCH] fix(agoric-cli): use readPublished consistently in agops oracle --- packages/agoric-cli/src/commands/oracle.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/agoric-cli/src/commands/oracle.js b/packages/agoric-cli/src/commands/oracle.js index 9b72a1f8595..2882cef094a 100644 --- a/packages/agoric-cli/src/commands/oracle.js +++ b/packages/agoric-cli/src/commands/oracle.js @@ -207,11 +207,10 @@ export const makeOracleCommand = (logger, io = {}) => { s => s.split('.'), ) .action(async opts => { - const { readLatestHead, lookupPriceAggregatorInstance } = - await rpcTools(); + const { readPublished, lookupPriceAggregatorInstance } = await rpcTools(); const instance = lookupPriceAggregatorInstance(opts.pair); - const offerId = await findOracleCap(instance, opts.from, readLatestHead); + const offerId = await findOracleCap(instance, opts.from, readPublished); if (!offerId) { console.error('No continuing ids found'); } @@ -272,8 +271,12 @@ export const makeOracleCommand = (logger, io = {}) => { * }} */ { pair, keys, price }, ) => { - const { readLatestHead, networkConfig, lookupPriceAggregatorInstance } = - await rpcTools(); + const { + readLatestHead, + readPublished, + networkConfig, + lookupPriceAggregatorInstance, + } = await rpcTools(); const wutil = await makeWalletUtils({ fetch, delay }, networkConfig); const unitPrice = scaleDecimals(price); @@ -338,7 +341,7 @@ export const makeOracleCommand = (logger, io = {}) => { adminOfferIds[from] = await findOracleCap( instance, from, - readLatestHead, + readPublished, ); if (!adminOfferIds[from]) { console.error(