forked from Superalgos/Superalgos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Secrets.js
44 lines (36 loc) · 1.22 KB
/
Secrets.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
exports.newSecrets = function newSecrets () {
let thisObject = {
initialize: initialize
}
return thisObject
function initialize() {
SA.secrets = {
signingAccountSecrets: {
array: [],
map: new Map()
},
apisSecrets: {
array: [],
map: new Map()
}
}
try {
SA.secrets.signingAccountSecrets.array = require('./My-Secrets/SigningAccountsSecrets.json').secrets
} catch (err) {
// Still have an empty array.
}
try {
SA.secrets.apisSecrets.array = require('./My-Secrets/ApisSecrets.json').secrets
} catch (err) {
// Still have an empty array.
}
for (let i = 0; i < SA.secrets.signingAccountSecrets.array.length; i++) {
let secret = SA.secrets.signingAccountSecrets.array[i]
SA.secrets.signingAccountSecrets.map.set(secret.nodeCodeName, secret)
}
for (let i = 0; i < SA.secrets.apisSecrets.array.length; i++) {
let secret = SA.secrets.apisSecrets.array[i]
SA.secrets.apisSecrets.map.set(secret.nodeCodeName, secret)
}
}
}