Skip to content

Commit

Permalink
refactor: Simplify inventory client parsing
Browse files Browse the repository at this point in the history
This helps to drop an UMA dependency, and is arguably nicer because it
doesn't corce the js Object to and from a string type.
  • Loading branch information
pxrl committed Oct 2, 2023
1 parent 2da16b5 commit 5d3e486
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/relayer/RelayerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export class RelayerConfig extends CommonConfig {
this.slowDepositors = SLOW_DEPOSITORS
? JSON.parse(SLOW_DEPOSITORS).map((depositor) => ethers.utils.getAddress(depositor))
: [];
this.inventoryConfig = RELAYER_INVENTORY_CONFIG ? JSON.parse(RELAYER_INVENTORY_CONFIG) : {};
this.inventoryConfig = JSON.parse(
RELAYER_INVENTORY_CONFIG.replace(/0x[a-fA-F0-9]{40}/g, ethers.utils.getAddress)

Check warning on line 69 in src/relayer/RelayerConfig.ts

View workflow job for this annotation

GitHub Actions / Lint (16)

Delete `⏎·····`
?? "{}"
);
this.minRelayerFeePct = toBNWei(MIN_RELAYER_FEE_PCT || Constants.RELAYER_MIN_FEE_PCT);

if (Object.keys(this.inventoryConfig).length > 0) {
Expand Down

0 comments on commit 5d3e486

Please sign in to comment.