Skip to content

Commit

Permalink
fix: check signedDataPackages size
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Aug 27, 2024
1 parent 22f609b commit 1b900f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/RedstoneServiceV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,12 @@ export class RedstoneServiceV3 {
const { dataFeedId, originalToken, reserve, token } = t;
const signedDataPackages = packagesByDataFeedId[dataFeedId];
if (!signedDataPackages) {
throw new Error(`cannot find data package for ${dataFeedId}`);
throw new Error(`cannot find data packages for ${dataFeedId}`);
}
if (signedDataPackages.length !== uniqueSignersCount) {
throw new Error(
`got ${signedDataPackages.length} data packages for ${dataFeedId}, but expected ${uniqueSignersCount}`,
);
}
const calldataWithTs = getCalldataWithTimestamp(
signedDataPackages,
Expand Down

0 comments on commit 1b900f9

Please sign in to comment.