Skip to content

Commit

Permalink
Fabo/fix old rewards script (#574)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Bitcoinera <[email protected]>
  • Loading branch information
3 people authored Apr 7, 2020
1 parent 5e57c7e commit c5f41a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/getOldPolkadotRewardEras.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
: []
Expand Down

0 comments on commit c5f41a9

Please sign in to comment.