Skip to content

Commit

Permalink
another fix for CU update
Browse files Browse the repository at this point in the history
  • Loading branch information
shamsartem committed Jan 7, 2025
1 parent 4e2afa2 commit d795805
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/cli/package/src/lib/chain/offer/updateOffers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d795805

Please sign in to comment.