@gearbox-protocol/sdk 8.24.6 → 8.24.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -120,7 +120,10 @@ class PriceOracleBaseContract extends import_base.BaseContract {
|
|
|
120
120
|
const { to: priceFeed, callData, description } = tx.raw;
|
|
121
121
|
const [token, reserve] = this.findTokenForPriceFeed(priceFeed);
|
|
122
122
|
if (!token) {
|
|
123
|
+
const mains = this.mainPriceFeeds.values().map((v) => v.address);
|
|
124
|
+
const reserves = this.reservePriceFeeds.values().map((v) => v.address);
|
|
123
125
|
this.logger?.debug(
|
|
126
|
+
{ mainPriceFeeds: mains, reservePriceFeeds: reserves },
|
|
124
127
|
`skipping onDemandPriceUpdate ${description}): token not found for price feed ${priceFeed} in oracle ${this.address}`
|
|
125
128
|
);
|
|
126
129
|
continue;
|
|
@@ -319,12 +322,12 @@ class PriceOracleBaseContract extends import_base.BaseContract {
|
|
|
319
322
|
*/
|
|
320
323
|
findTokenForPriceFeed(priceFeed) {
|
|
321
324
|
for (const [token, pf] of this.mainPriceFeeds.entries()) {
|
|
322
|
-
if (pf.address
|
|
325
|
+
if ((0, import_utils.hexEq)(pf.address, priceFeed)) {
|
|
323
326
|
return [token, false];
|
|
324
327
|
}
|
|
325
328
|
}
|
|
326
329
|
for (const [token, pf] of this.reservePriceFeeds.entries()) {
|
|
327
|
-
if (pf.address
|
|
330
|
+
if ((0, import_utils.hexEq)(pf.address, priceFeed)) {
|
|
328
331
|
return [token, true];
|
|
329
332
|
}
|
|
330
333
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
isV300,
|
|
9
9
|
VERSION_RANGE_310
|
|
10
10
|
} from "../../constants/index.js";
|
|
11
|
-
import { AddressMap, formatBN } from "../../utils/index.js";
|
|
11
|
+
import { AddressMap, formatBN, hexEq } from "../../utils/index.js";
|
|
12
12
|
import { PriceFeedRef } from "../pricefeeds/index.js";
|
|
13
13
|
import PriceFeedAnswerMap from "./PriceFeedAnswerMap.js";
|
|
14
14
|
const ZERO_PRICE_FEED = stringToHex("PRICE_FEED::ZERO", { size: 32 });
|
|
@@ -91,7 +91,10 @@ class PriceOracleBaseContract extends BaseContract {
|
|
|
91
91
|
const { to: priceFeed, callData, description } = tx.raw;
|
|
92
92
|
const [token, reserve] = this.findTokenForPriceFeed(priceFeed);
|
|
93
93
|
if (!token) {
|
|
94
|
+
const mains = this.mainPriceFeeds.values().map((v) => v.address);
|
|
95
|
+
const reserves = this.reservePriceFeeds.values().map((v) => v.address);
|
|
94
96
|
this.logger?.debug(
|
|
97
|
+
{ mainPriceFeeds: mains, reservePriceFeeds: reserves },
|
|
95
98
|
`skipping onDemandPriceUpdate ${description}): token not found for price feed ${priceFeed} in oracle ${this.address}`
|
|
96
99
|
);
|
|
97
100
|
continue;
|
|
@@ -290,12 +293,12 @@ class PriceOracleBaseContract extends BaseContract {
|
|
|
290
293
|
*/
|
|
291
294
|
findTokenForPriceFeed(priceFeed) {
|
|
292
295
|
for (const [token, pf] of this.mainPriceFeeds.entries()) {
|
|
293
|
-
if (pf.address
|
|
296
|
+
if (hexEq(pf.address, priceFeed)) {
|
|
294
297
|
return [token, false];
|
|
295
298
|
}
|
|
296
299
|
}
|
|
297
300
|
for (const [token, pf] of this.reservePriceFeeds.entries()) {
|
|
298
|
-
if (pf.address
|
|
301
|
+
if (hexEq(pf.address, priceFeed)) {
|
|
299
302
|
return [token, true];
|
|
300
303
|
}
|
|
301
304
|
}
|