minor import script improvements
waiting for transactions and logging earlier for better debugging
This commit is contained in:
parent
1c097f37a6
commit
f71ff4ce9a
|
@ -6,6 +6,8 @@ async function main() {
|
|||
await kredits.init();
|
||||
|
||||
console.log(`Using Contribution at: ${kredits.Contribution.contract.address}`);
|
||||
const count = await kredits.Contribution.count;
|
||||
console.log(`Currently ${count} entries`);
|
||||
|
||||
try {
|
||||
const data = fs.readFileSync("./data/contributions.json");
|
||||
|
@ -28,11 +30,11 @@ async function main() {
|
|||
c.hashDigest, c.hashFunction, c.hashSize,
|
||||
confirmedAtBlock, c.vetoed
|
||||
);
|
||||
// await result.wait();
|
||||
console.log(`Added contribution #${contributionId}: ${result.hash}`);
|
||||
console.log(`Adding contribution #${contributionId}: ${result.hash}`);
|
||||
await result.wait();
|
||||
};
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@ async function main() {
|
|||
await kredits.init();
|
||||
|
||||
console.log(`Using Contributor at: ${kredits.Contributor.contract.address}`);
|
||||
|
||||
const count = await kredits.Contributor.count;
|
||||
console.log(`Currently ${count} entries`);
|
||||
try {
|
||||
const data = fs.readFileSync("./data/contributors.json");
|
||||
const contributors = JSON.parse(data);
|
||||
|
@ -22,11 +23,11 @@ async function main() {
|
|||
contributor.hashFunction,
|
||||
contributor.hashSize,
|
||||
);
|
||||
// await result.wait();
|
||||
console.log(`Added contributor #${contributorId}: ${result.hash}`);
|
||||
console.log(`Adding contributor #${contributorId}: ${result.hash}`);
|
||||
await result.wait();
|
||||
};
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ async function main() {
|
|||
await kredits.init();
|
||||
|
||||
console.log(`Using Contributor at: ${kredits.Contributor.contract.address}`);
|
||||
const count = await kredits.Contributors.count;
|
||||
console.log(`Currently ${count} entries`);
|
||||
|
||||
const table = new Table({
|
||||
head: ['ID', 'Account', 'Name', 'Core?', 'Balance', 'Kredits earned', 'Contributions count', 'IPFS']
|
||||
|
|
Loading…
Reference in New Issue