Dynamically set AppIds

AppIds are used to lookup the actual contract addresses of each app.
Because of different registry names (open.aragonpm.eth vs. aragonpm.eth)
we have to use different ids in the local dev chain and in the
testnet/mainnet. To allow this we need to set the appids dynamically.

There is an open aragon issue to solve this and also allow to use
open.aragonpm.eth in the devchain by default.
https://github.com/aragon/aragen/issues/10
This commit is contained in:
2019-03-27 00:21:06 +01:00
parent 9cc237fbf4
commit f5973756c8
17 changed files with 78 additions and 48 deletions

View File

@@ -0,0 +1,8 @@
// help, give me a better name
const fs = require('fs');
module.exports = function (file, networkId, data) {
let content = JSON.parse(fs.readFileSync(file));
content[networkId] = data;
fs.writeFileSync(file, JSON.stringify(content));
}

View File

@@ -0,0 +1,11 @@
module.exports = function(web3) {
return new Promise((resolve, reject) => {
web3.version.getNetwork((err, network) => {
if (err) {
reject(err);
} else {
resolve(network);
}
})
})
}