From d795805dc7c8551705f90af43354fb2d9f6b6848 Mon Sep 17 00:00:00 2001 From: Artsiom Shamsutdzinau Date: Tue, 7 Jan 2025 12:27:14 +0100 Subject: [PATCH] another fix for CU update --- packages/cli/package/src/lib/chain/offer/updateOffers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/cli/package/src/lib/chain/offer/updateOffers.ts b/packages/cli/package/src/lib/chain/offer/updateOffers.ts index 163570a00..aa00fbcf6 100644 --- a/packages/cli/package/src/lib/chain/offer/updateOffers.ts +++ b/packages/cli/package/src/lib/chain/offer/updateOffers.ts @@ -233,13 +233,13 @@ function populateUpdateOffersTxs(offersFoundOnChain: OnChainOffer[]) { const txs = ( await Promise.all([ + populateChangeResourceSupplyTx(offer), populateCUToRemoveTxs(offer, peersOnChain), populateCUToAddTxs(offer, peersOnChain), populatePaymentTokenTx(offer), populateChangeResourcePriceTx(offer), - populateChangeResourceSupplyTx(offer), populatePeerResourcesTxs(offer), ]) ).flat() satisfies Txs; @@ -460,7 +460,10 @@ async function createResourceSupplyUpdateTx( peerId: string, { resourceType, onChainResource, configuredResource }: ResourceSupplyUpdate, ) { - if (onChainResource.supply === configuredResource.supply) { + if ( + resourceType === "cpu" || // no need for changeResourceMaxSupplyV2. addComputeUnitsV2 is enough + onChainResource.supply === configuredResource.supply + ) { return null; }