clean contracts.js and error handling
This commit is contained in:
parent
9ac98f6909
commit
16ab77ef1a
|
@ -103,22 +103,12 @@ module.exports = {
|
||||||
LiquidPledging: {
|
LiquidPledging: {
|
||||||
instanceOf: 'LiquidPledgingMock'
|
instanceOf: 'LiquidPledgingMock'
|
||||||
},
|
},
|
||||||
RecoveryVault: {},
|
|
||||||
LPFactory: {
|
|
||||||
args: ['$LPVault', '$LiquidPledging'],
|
|
||||||
},
|
|
||||||
// contracts for testing
|
// contracts for testing
|
||||||
StandardToken: {},
|
StandardToken: {}
|
||||||
Kernel: {
|
|
||||||
file: "@aragon/os/contracts/kernel/Kernel.sol"
|
|
||||||
},
|
|
||||||
ACL: {
|
|
||||||
file: "@aragon/os/contracts/acl/ACL.sol"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
afterDeploy: async (deps) => {
|
afterDeploy: async (deps) => {
|
||||||
await deps.contracts.LiquidPledging.methods.initialize(deps.contracts.LPVault.options.address).send({gas: 1000000});
|
await deps.contracts.LiquidPledging.methods.initialize(deps.contracts.LPVault.options.address).send({gas: 1000000, from: deps.web3.eth.defaultAccount});
|
||||||
await deps.contracts.LPVault.methods.initialize(deps.contracts.LiquidPledging.options.address).send({gas: 1000000});
|
await deps.contracts.LPVault.methods.initialize(deps.contracts.LiquidPledging.options.address).send({gas: 1000000, from: deps.web3.eth.defaultAccount});
|
||||||
}
|
}
|
||||||
|
|
||||||
// afterDeploy: [
|
// afterDeploy: [
|
||||||
|
|
|
@ -68,22 +68,26 @@ class Actions {
|
||||||
}
|
}
|
||||||
|
|
||||||
async listProjects() {
|
async listProjects() {
|
||||||
let numProjects = await LiquidPledging.methods.numberOfPledgeAdmins().call();
|
try {
|
||||||
|
let numProjects = await this.contracts.LiquidPledging.methods.numberOfPledgeAdmins().call();
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
head: ['Id', 'Name', 'URL', 'ParentProject', 'Status', 'Commit Time', 'Owner', 'Plugin']
|
head: ['Id', 'Name', 'URL', 'ParentProject', 'Status', 'Commit Time', 'Owner', 'Plugin']
|
||||||
});
|
});
|
||||||
|
|
||||||
for(let i = 1; i <= numProjects; i++){
|
for(let i = 1; i <= numProjects; i++){
|
||||||
const pledge = await LiquidPledging.methods.getPledgeAdmin(i).call();
|
const pledge = await this.contracts.LiquidPledging.methods.getPledgeAdmin(i).call();
|
||||||
if(pledge.adminType !== '2') continue;
|
if(pledge.adminType !== '2') continue;
|
||||||
|
|
||||||
table.push(
|
table.push(
|
||||||
[i, pledge.name, pledge.url, pledge.parentProject, pledge.canceled ? 'Canceled' : 'Active', pledge.commitTime, pledge.addr, pledge.plugin]
|
[i, pledge.name, pledge.url, pledge.parentProject, pledge.canceled ? 'Canceled' : 'Active', pledge.commitTime, pledge.addr, pledge.plugin]
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(table.toString());
|
||||||
|
} catch(error){
|
||||||
|
console.log("Couldn't obtain the list of projects: ", error.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(table.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addGiver(params) {
|
addGiver(params) {
|
||||||
|
|
Loading…
Reference in New Issue