-
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.
test(coverage): api config with base token
- Loading branch information
1 parent
2af72cf
commit 0ac3a04
Showing
1 changed file
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,60 @@ describe("config", () => { | |
}); | ||
}); | ||
|
||
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: { | ||
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 replication DB config if replica set exists", () => { | ||
process.env.DATABASE_REPLICA_URL_0 = "DATABASE_REPLICA_URL_0"; | ||
process.env.DATABASE_REPLICA_URL_1 = "DATABASE_REPLICA_URL_1"; | ||
|