@gearbox-protocol/sdk 9.9.1 → 9.9.2
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.
|
@@ -228,22 +228,36 @@ class RedstoneUpdater extends import_base.SDKConstruct {
|
|
|
228
228
|
);
|
|
229
229
|
const parsed = import_protocol.RedstonePayload.parse((0, import_viem.toBytes)(`0x${dataPayload}`));
|
|
230
230
|
const packagesByDataFeedId = groupDataPackages(parsed.signedDataPackages);
|
|
231
|
-
|
|
231
|
+
const result = [];
|
|
232
|
+
for (const dataFeedId of dataFeedsIds) {
|
|
232
233
|
const signedDataPackages = packagesByDataFeedId[dataFeedId];
|
|
233
234
|
if (!signedDataPackages) {
|
|
235
|
+
if (this.#ignoreMissingFeeds) {
|
|
236
|
+
this.#logger?.warn(`cannot find data packages for ${dataFeedId}`);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
234
239
|
throw new Error(`cannot find data packages for ${dataFeedId}`);
|
|
235
240
|
}
|
|
236
241
|
if (signedDataPackages.length !== uniqueSignersCount) {
|
|
242
|
+
if (this.#ignoreMissingFeeds) {
|
|
243
|
+
this.#logger?.warn(
|
|
244
|
+
`got ${signedDataPackages.length} data packages for ${dataFeedId}, but expected ${uniqueSignersCount}`
|
|
245
|
+
);
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
237
248
|
throw new Error(
|
|
238
249
|
`got ${signedDataPackages.length} data packages for ${dataFeedId}, but expected ${uniqueSignersCount}`
|
|
239
250
|
);
|
|
240
251
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
252
|
+
result.push(
|
|
253
|
+
getCalldataWithTimestamp(
|
|
254
|
+
dataFeedId,
|
|
255
|
+
signedDataPackages,
|
|
256
|
+
wrapper.getUnsignedMetadata()
|
|
257
|
+
)
|
|
245
258
|
);
|
|
246
|
-
}
|
|
259
|
+
}
|
|
260
|
+
return result;
|
|
247
261
|
}
|
|
248
262
|
}
|
|
249
263
|
function groupDataPackages(signedDataPackages) {
|
|
@@ -206,22 +206,36 @@ class RedstoneUpdater extends SDKConstruct {
|
|
|
206
206
|
);
|
|
207
207
|
const parsed = RedstonePayload.parse(toBytes(`0x${dataPayload}`));
|
|
208
208
|
const packagesByDataFeedId = groupDataPackages(parsed.signedDataPackages);
|
|
209
|
-
|
|
209
|
+
const result = [];
|
|
210
|
+
for (const dataFeedId of dataFeedsIds) {
|
|
210
211
|
const signedDataPackages = packagesByDataFeedId[dataFeedId];
|
|
211
212
|
if (!signedDataPackages) {
|
|
213
|
+
if (this.#ignoreMissingFeeds) {
|
|
214
|
+
this.#logger?.warn(`cannot find data packages for ${dataFeedId}`);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
212
217
|
throw new Error(`cannot find data packages for ${dataFeedId}`);
|
|
213
218
|
}
|
|
214
219
|
if (signedDataPackages.length !== uniqueSignersCount) {
|
|
220
|
+
if (this.#ignoreMissingFeeds) {
|
|
221
|
+
this.#logger?.warn(
|
|
222
|
+
`got ${signedDataPackages.length} data packages for ${dataFeedId}, but expected ${uniqueSignersCount}`
|
|
223
|
+
);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
215
226
|
throw new Error(
|
|
216
227
|
`got ${signedDataPackages.length} data packages for ${dataFeedId}, but expected ${uniqueSignersCount}`
|
|
217
228
|
);
|
|
218
229
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
230
|
+
result.push(
|
|
231
|
+
getCalldataWithTimestamp(
|
|
232
|
+
dataFeedId,
|
|
233
|
+
signedDataPackages,
|
|
234
|
+
wrapper.getUnsignedMetadata()
|
|
235
|
+
)
|
|
223
236
|
);
|
|
224
|
-
}
|
|
237
|
+
}
|
|
238
|
+
return result;
|
|
225
239
|
}
|
|
226
240
|
}
|
|
227
241
|
function groupDataPackages(signedDataPackages) {
|