Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai committed Oct 6, 2023
1 parent 16abae3 commit bd56e7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
19 changes: 6 additions & 13 deletions src/clients/bridges/BaseAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,20 +324,13 @@ export abstract class BaseAdapter {
): Promise<TransactionResponse> {
const { chainId, txnClient } = this;
const method = "deposit";
const formatFunc = createFormatFunction(2, 4, false, 18);
const mrkdwn =
`${createFormatFunction(
2,
4,
false,
18
)(toBN(value).toString())} Ether on chain ${chainId} was wrapped due to being over the threshold of ` +
`${createFormatFunction(2, 4, false, 18)(toBN(wrapThreshold).toString())} ETH.`;
const message = `${createFormatFunction(
2,
4,
false,
18
)(toBN(value).toString())} Eth wrapped on target chain ${chainId}🎁`;
`${formatFunc(
toBN(value).toString()
)} Ether on chain ${chainId} was wrapped due to being over the threshold of ` +
`${formatFunc(toBN(wrapThreshold).toString())} ETH.`;
const message = `${formatFunc(toBN(value).toString())} Eth wrapped on target chain ${chainId}🎁`;
if (simMode) {
const { succeed, reason } = (
await txnClient.simulate([{ contract: l2WEthContract, chainId, method, args: [], value, mrkdwn, message }])
Expand Down
4 changes: 2 additions & 2 deletions src/relayer/RelayerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ export class RelayerConfig extends CommonConfig {
this.inventoryConfig.wrapEtherThreshold = this.inventoryConfig.wrapEtherThreshold
? toBNWei(this.inventoryConfig.wrapEtherThreshold)
: toBNWei(1); // default to keeping 2 Eth on the target chains and wrapping the rest to WETH.
this.inventoryConfig.wrapEtherThresholdPerChain = this.inventoryConfig.wrapEtherThresholdPerChain ?? {};
this.inventoryConfig.wrapEtherThresholdPerChain ??= {};
this.inventoryConfig.wrapEtherTarget = this.inventoryConfig.wrapEtherTarget
? toBNWei(this.inventoryConfig.wrapEtherTarget)
: this.inventoryConfig.wrapEtherThreshold; // default to wrapping ETH to threshold, same as target.
this.inventoryConfig.wrapEtherTargetPerChain = this.inventoryConfig.wrapEtherTargetPerChain ?? {};
this.inventoryConfig.wrapEtherTargetPerChain ??= {};
assert(
this.inventoryConfig.wrapEtherThreshold.gte(this.inventoryConfig.wrapEtherTarget),
`default wrapEtherThreshold ${this.inventoryConfig.wrapEtherThreshold} must be >= default wrapEtherTarget ${this.inventoryConfig.wrapEtherTarget}}`
Expand Down

0 comments on commit bd56e7e

Please sign in to comment.