From 5455fb4c1549d315deb0eb7ee4befb45409b401b Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Tue, 26 Mar 2024 15:28:44 -0500 Subject: [PATCH] A bit more logging in automatic staking script --- ethereum/scripts/automatic-staking.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ethereum/scripts/automatic-staking.js b/ethereum/scripts/automatic-staking.js index 5b25bed..250bfdb 100644 --- a/ethereum/scripts/automatic-staking.js +++ b/ethereum/scripts/automatic-staking.js @@ -120,15 +120,17 @@ const stakeEach = async (pools, amountPerPool) => { await Promise.all(promises); }; -async function main() { - await initialize(); - - validationPools.forEach((pool) => { - console.log(`pool ${pool.id.toString()}, ` +const printPool = (pool) => { + console.log(`pool ${pool.id.toString()}, ` + `status: ${getPoolStatus(pool)}, ` + `is valid: ${poolIsValid(pool)}, ` + `post content: ${pool.post?.content}`); - }); +}; + +async function main() { + await initialize(); + + validationPools.forEach(printPool); // Stake half of available reputation on any active pools const activePools = validationPools.filter(poolIsActive); @@ -139,8 +141,8 @@ async function main() { // Listen for new validation pools dao.on('ValidationPoolInitiated', async (poolIndex) => { - console.log(`pool ${poolIndex} started`); const pool = await fetchValidationPool(poolIndex); + printPool(pool); await fetchReputation(); if (!reputation) return; const amountToStake = reputation / BigInt(2);