Skip to content

Commit 31994ec

Browse files
committed
polish
Signed-off-by: Ihor Farion <ihor@umaproject.org>
1 parent b4ea123 commit 31994ec

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/adapter/bridges/OFTBridge.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class OFTBridge extends BaseBridgeAdapter {
116116
const cap = ethers.utils.parseEther("0.01");
117117

118118
if (BigNumber.from(feeStruct.nativeFee).gt(cap)) {
119-
throw "queried OFT nativeFee is to high. Can't pay that much for a bridge";
119+
throw `can't go over fee cap (${feeStruct.nativeFee} > ${cap})`;
120120
} else {
121121
this.logMessage("feeCap check", { feeCap: cap.toString(), message: "fee is okay" });
122122
}
@@ -171,12 +171,8 @@ export class OFTBridge extends BaseBridgeAdapter {
171171
eventConfig
172172
);
173173

174-
// Filter events by destination eid. Notice that we can't filter in the query directly
175-
// because eid is not an indexed parameter
176-
const destinationEid = this.dstChainEid;
177-
const events = allEvents.filter((event) => {
178-
return event.args.dstEid === destinationEid;
179-
});
174+
// Filter events by destination eid
175+
const events = allEvents.filter(({ args }) => args.dstEid === this.dstChainEid);
180176

181177
return {
182178
[this.dstTokenAddress]: events.map((event) =>

0 commit comments

Comments
 (0)