Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Mateuszradomski/l2b 2977 invert should not rely on configjson (#94)
Browse files Browse the repository at this point in the history
* Make the config optional

* changeset

* ylff
  • Loading branch information
mateuszradomski authored Nov 6, 2023
1 parent f68d5a4 commit be127de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/discovery/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @l2beat/discovery

## 0.23.0

### Minor Changes

- runInversion now has config optional

## 0.22.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/discovery/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@l2beat/discovery",
"description": "L2Beat discovery - engine & tooling utilized for keeping an eye on L2s",
"version": "0.22.0",
"version": "0.23.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
Expand Down
6 changes: 4 additions & 2 deletions packages/discovery/src/inversion/runInversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function runInversion(

export function calculateInversion(
discovery: DiscoveryOutput,
config: DiscoveryConfig,
config?: DiscoveryConfig,
): InvertedAddresses {
const addresses = new Map<string, AddressDetails>()

Expand All @@ -79,7 +79,9 @@ export function calculateInversion(
details = {
name:
discovery.contracts.find((x) => x.address.toString() === address)
?.name ?? config.names[address],
?.name ??
config?.names[address] ??
address,
address,
roles: [],
}
Expand Down

0 comments on commit be127de

Please sign in to comment.