From c5f41a9508050a5c3c5783dbdb823427c9212f5a Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 7 Apr 2020 15:48:25 -0500 Subject: [PATCH] Fabo/fix old rewards script (#574) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * initial working state * working, this time is true ;-) * fix validator, comments * fix, cleanup * fix validator * update comment * Use coinReducer * cleanup * cleanup unused vars * cleanup * Flatten era rewards and then aggregate per valid * refactored * typo * uĆ¼dated polkadot * load rewards * steps towards storing the rewards * fix era format * fix validator in row needs to be address * fix gql query * format bug * some refactoring * fix missing await * correctly get api * push validator getter inside sources * added address to lunie reward internaly * add address correctly * fix variable naming * filter empty rewards * add height from rewards * added query past rewards script * calling main * missing imports * upsert to prevent conflicts * flatten rewards * fix too many labels issue * typo * write for each validator * await finishing * add validators correctly to the store * remove timing for rewards * correctly write validator and filter 0 * extract missing vals * query rewards for polkadot from db * run rewards getter in parallel * adjust get rewards script * add store caching * fix fs functions callbacks * fix stuff * fix more stuff. working * fix tests * missing change * remove caching logic again * one more cache removal * fix for bad arguments writing to the db * get db from store * fix wrong command in script * fix return type of getText Co-authored-by: mariopino Co-authored-by: Bitcoinera --- scripts/getOldPolkadotRewardEras.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/getOldPolkadotRewardEras.js b/scripts/getOldPolkadotRewardEras.js index 0d6686956c..05e451edae 100644 --- a/scripts/getOldPolkadotRewardEras.js +++ b/scripts/getOldPolkadotRewardEras.js @@ -32,7 +32,7 @@ async function main() { await Promise.all( delegators.map(async delegator => { - const rewards = await polkadotAPI.getRewards(delegator) + const rewards = await polkadotAPI.getRemoteRewards(delegator) const storableRewards = rewards ? rewards.filter(({ amount }) => amount > 0) : []