-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial changes to show base token - SQUASHED
- Loading branch information
1 parent
146e2d9
commit d8af700
Showing
73 changed files
with
507 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const L2_ETH_TOKEN_ADDRESS = "0x000000000000000000000000000000000000800a"; | ||
export const BASE_TOKEN_L2_ADDRESS = "0x000000000000000000000000000000000000800A"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import config from "../config"; | ||
|
||
jest.mock("./featureFlags", () => ({ | ||
feature1Enabled: true, | ||
feature2Enabled: false, | ||
|
@@ -20,6 +19,71 @@ describe("config", () => { | |
|
||
it("sets default values", () => { | ||
expect(config()).toEqual({ | ||
baseTokenData: { | ||
l2Address: "0x000000000000000000000000000000000000800A", | ||
l1Address: "0x0000000000000000000000000000000000000001", | ||
symbol: "ETH", | ||
name: "Ether", | ||
decimals: 18, | ||
// Fallback data in case ETH token is not in the DB | ||
iconURL: "https://assets.coingecko.com/coins/images/279/large/ethereum.png?1698873266", | ||
liquidity: 220000000000, | ||
usdPrice: 1800, | ||
}, | ||
NODE_ENV: "test", | ||
port: 3020, | ||
metrics: { | ||
port: 3005, | ||
collectDbConnectionPoolMetricsInterval: 10000, | ||
}, | ||
typeORM: { | ||
type: "postgres", | ||
url: "postgres://postgres:[email protected]:5432/block-explorer", | ||
poolSize: 300, | ||
extra: { | ||
idleTimeoutMillis: 60000, | ||
statement_timeout: 90000, | ||
}, | ||
synchronize: true, | ||
logging: false, | ||
autoLoadEntities: true, | ||
retryAttempts: 10, | ||
retryDelay: 3000, | ||
applicationName: "block-explorer-api", | ||
}, | ||
contractVerificationApiUrl: "http://127.0.0.1:3070", | ||
featureFlags: { | ||
feature1Enabled: true, | ||
feature2Enabled: false, | ||
}, | ||
gracefulShutdownTimeoutMs: 0, | ||
}); | ||
}); | ||
|
||
it("sets default values with base ERC20", () => { | ||
process.env = { | ||
BASE_TOKEN_SYMBOL: "MTTL", | ||
BASE_TOKEN_DECIMALS: "18", | ||
BASE_TOKEN_L1_ADDRESS: "0xSomeAddress", | ||
BASE_TOKEN_ICON_URL: "https://matter-labs.io", | ||
BASE_TOKEN_NAME: "MatterLabs", | ||
BASE_TOKEN_LIQUIDITY: "999999999999", | ||
BASE_TOKEN_USDPRICE: "19", | ||
NODE_ENV: "test", | ||
}; | ||
|
||
expect(config()).toEqual({ | ||
baseTokenData: { | ||
l2Address: "0x000000000000000000000000000000000000800A", | ||
l1Address: "0xSomeAddress", | ||
symbol: "MTTL", | ||
name: "MatterLabs", | ||
decimals: 18, | ||
// Fallback data in case ETH token is not in the DB | ||
iconURL: "https://matter-labs.io", | ||
liquidity: 999999999999, | ||
usdPrice: 19, | ||
}, | ||
NODE_ENV: "test", | ||
port: 3020, | ||
metrics: { | ||
|
@@ -28,7 +92,7 @@ describe("config", () => { | |
}, | ||
typeORM: { | ||
type: "postgres", | ||
url: "postgres://postgres:postgres@localhost:5432/block-explorer", | ||
url: "postgres://postgres:postgres@127.0.0.1:5432/block-explorer", | ||
poolSize: 300, | ||
extra: { | ||
idleTimeoutMillis: 60000, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.