Merge branch 'master' into feature/kredits-formatter
This commit is contained in:
@@ -26,7 +26,7 @@ module.exports = async function(callback) {
|
||||
kind: await prompt('Kind (default person): ', {default: 'person'}),
|
||||
url: await prompt('URL: '),
|
||||
github_username: await prompt('GitHub username: '),
|
||||
github_uid: await prompt('GitHub UID: '),
|
||||
github_uid: parseInt(await prompt('GitHub UID: ')),
|
||||
wiki_username: await prompt('Wiki username: '),
|
||||
};
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ module.exports = async function(callback) {
|
||||
let blockNumber = await kredits.provider.getBlockNumber();
|
||||
let contributions = await kredits.Contribution.all();
|
||||
|
||||
console.log(`Current block number: ${blockNumber}`);
|
||||
contributions.forEach((c) => {
|
||||
const confirmed = c.confirmedAtBlock <= blockNumber;
|
||||
|
||||
@@ -30,7 +31,7 @@ module.exports = async function(callback) {
|
||||
c.contributorId,
|
||||
`${c.description}`,
|
||||
c.amount.toString(),
|
||||
confirmed,
|
||||
`${confirmed} (${c.confirmedAtBlock})`,
|
||||
c.vetoed,
|
||||
c.claimed,
|
||||
c.ipfsHash
|
||||
@@ -38,6 +39,9 @@ module.exports = async function(callback) {
|
||||
});
|
||||
|
||||
console.log(table.toString());
|
||||
|
||||
let totalContributionBalances = await kredits.Contribution.functions.totalCount(true);
|
||||
console.log(`Total confirmed balance: ${totalContributionBalances}`);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
@@ -15,12 +15,16 @@ module.exports = async function(callback) {
|
||||
|
||||
console.log(`Using Contributor at: ${kredits.Contributor.contract.address}`);
|
||||
|
||||
|
||||
const table = new Table({
|
||||
head: ['ID', 'Account', 'Name', 'Core?', 'Balance', 'IPFS']
|
||||
head: ['ID', 'Account', 'Name', 'Core?', 'Balance', 'Kredits earned', 'Contributions count', 'IPFS']
|
||||
})
|
||||
|
||||
let contributors = await kredits.Contributor.all()
|
||||
try {
|
||||
const contributors = await kredits.Contributor.all()
|
||||
} catch(e) {
|
||||
callback(e);
|
||||
return;
|
||||
}
|
||||
|
||||
contributors.forEach((c) => {
|
||||
table.push([
|
||||
@@ -28,11 +32,15 @@ module.exports = async function(callback) {
|
||||
c.account,
|
||||
`${c.name}`,
|
||||
c.isCore,
|
||||
c.balanceInt,
|
||||
c.balanceInt.toString(),
|
||||
c.totalKreditsEarned.toString(),
|
||||
c.contributionsCount.toString(),
|
||||
c.ipfsHash
|
||||
])
|
||||
})
|
||||
|
||||
console.log(table.toString())
|
||||
|
||||
callback()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user