mirror of
https://github.com/tornadocash/tornado-relayer
synced 2024-02-02 15:04:06 +01:00
validate only selected network contract addresses
This commit is contained in:
parent
2ba1f53b4f
commit
0eca15e788
23
src/utils.js
23
src/utils.js
@ -11,18 +11,17 @@ const TOKENS = {
|
||||
}
|
||||
|
||||
const addressMap = new Map()
|
||||
for (const [key, value] of Object.entries(instances)) {
|
||||
const netId = Number(key.substring(5))
|
||||
for (const [currency, { instanceAddress, symbol, decimals }] of Object.entries(value)) {
|
||||
Object.entries(instanceAddress).forEach(([amount, address]) =>
|
||||
addressMap.set(`${netId}_${address}`, {
|
||||
currency,
|
||||
amount,
|
||||
symbol,
|
||||
decimals,
|
||||
}),
|
||||
)
|
||||
}
|
||||
const instance = instances[`netId${netId}`]
|
||||
|
||||
for (const [currency, { instanceAddress, symbol, decimals }] of Object.entries(instance)) {
|
||||
Object.entries(instanceAddress).forEach(([amount, address]) =>
|
||||
addressMap.set(`${netId}_${address}`, {
|
||||
currency,
|
||||
amount,
|
||||
symbol,
|
||||
decimals,
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
const sleep = ms => new Promise(res => setTimeout(res, ms))
|
||||
|
Loading…
Reference in New Issue
Block a user