From facc58c5a83b6ea44bca2aa1273cb627d9a8787b Mon Sep 17 00:00:00 2001 From: Tarik Gul <47201679+TarikGul@users.noreply.github.com> Date: Mon, 1 Nov 2021 10:33:10 -0400 Subject: [PATCH] fix(e2e-tests): tests for staking-info endpoint (#742) * e2e tests for staking info * lint --- e2e-tests/endpoints/kusama/accounts/index.ts | 2 + .../kusama/accounts/staking-info/1500000.json | 18 +++ .../kusama/accounts/staking-info/3000000.json | 103 +++++++++++++++++ .../kusama/accounts/staking-info/5000000.json | 37 ++++++ .../kusama/accounts/staking-info/8000000.json | 101 ++++++++++++++++ .../kusama/accounts/staking-info/9500000.json | 100 ++++++++++++++++ .../kusama/accounts/staking-info/9894877.json | 103 +++++++++++++++++ .../kusama/accounts/staking-info/index.ts | 33 ++++++ .../endpoints/polkadot/accounts/index.ts | 2 + .../accounts/staking-info/1000000.json | 81 +++++++++++++ .../accounts/staking-info/3000000.json | 108 ++++++++++++++++++ .../accounts/staking-info/350000.json | 27 +++++ .../accounts/staking-info/6000000.json | 103 +++++++++++++++++ .../accounts/staking-info/7000000.json | 103 +++++++++++++++++ .../accounts/staking-info/7472552.json | 100 ++++++++++++++++ .../polkadot/accounts/staking-info/index.ts | 33 ++++++ e2e-tests/endpoints/westend/accounts/index.ts | 2 + .../accounts/staking-info/6000000.json | 103 +++++++++++++++++ .../accounts/staking-info/8041521.json | 103 +++++++++++++++++ .../westend/accounts/staking-info/index.ts | 13 +++ 20 files changed, 1275 insertions(+) create mode 100644 e2e-tests/endpoints/kusama/accounts/staking-info/1500000.json create mode 100644 e2e-tests/endpoints/kusama/accounts/staking-info/3000000.json create mode 100644 e2e-tests/endpoints/kusama/accounts/staking-info/5000000.json create mode 100644 e2e-tests/endpoints/kusama/accounts/staking-info/8000000.json create mode 100644 e2e-tests/endpoints/kusama/accounts/staking-info/9500000.json create mode 100644 e2e-tests/endpoints/kusama/accounts/staking-info/9894877.json create mode 100644 e2e-tests/endpoints/kusama/accounts/staking-info/index.ts create mode 100644 e2e-tests/endpoints/polkadot/accounts/staking-info/1000000.json create mode 100644 e2e-tests/endpoints/polkadot/accounts/staking-info/3000000.json create mode 100644 e2e-tests/endpoints/polkadot/accounts/staking-info/350000.json create mode 100644 e2e-tests/endpoints/polkadot/accounts/staking-info/6000000.json create mode 100644 e2e-tests/endpoints/polkadot/accounts/staking-info/7000000.json create mode 100644 e2e-tests/endpoints/polkadot/accounts/staking-info/7472552.json create mode 100644 e2e-tests/endpoints/polkadot/accounts/staking-info/index.ts create mode 100644 e2e-tests/endpoints/westend/accounts/staking-info/6000000.json create mode 100644 e2e-tests/endpoints/westend/accounts/staking-info/8041521.json create mode 100644 e2e-tests/endpoints/westend/accounts/staking-info/index.ts diff --git a/e2e-tests/endpoints/kusama/accounts/index.ts b/e2e-tests/endpoints/kusama/accounts/index.ts index 2c5151b9b..0e9a1f1b0 100644 --- a/e2e-tests/endpoints/kusama/accounts/index.ts +++ b/e2e-tests/endpoints/kusama/accounts/index.ts @@ -1,9 +1,11 @@ import { kusamaAccountBalanceEndpoints } from './balance-info'; +import { kusamaAccountStakingInfoEndpoints } from './staking-info'; import { kusamaAccountValidateEndpoints } from './validate'; import { kusamaAccountVestingInfoEndpoints } from './vesting-info'; export const kusamaAccountsEndpoints = [ ...kusamaAccountBalanceEndpoints, + ...kusamaAccountStakingInfoEndpoints, ...kusamaAccountVestingInfoEndpoints, ...kusamaAccountValidateEndpoints, ]; diff --git a/e2e-tests/endpoints/kusama/accounts/staking-info/1500000.json b/e2e-tests/endpoints/kusama/accounts/staking-info/1500000.json new file mode 100644 index 000000000..402a5866b --- /dev/null +++ b/e2e-tests/endpoints/kusama/accounts/staking-info/1500000.json @@ -0,0 +1,18 @@ +{ + "at": { + "hash": "0x9ab99465a0f2613ca4dde52b8545c664f9413d3fc0c73855f0c5d0afd5886239", + "height": "1500000" + }, + "controller": "HJ6cnbBrA1N4SXkrC58tTH3VB2KdvrdMpXbH8SAEAa46oQC", + "rewardDestination": { + "stash": null + }, + "numSlashingSpans": "3", + "staking": { + "stash": "HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK", + "total": "497576923500", + "active": "497576923500", + "unlocking": [], + "lastReward": "552" + } +} diff --git a/e2e-tests/endpoints/kusama/accounts/staking-info/3000000.json b/e2e-tests/endpoints/kusama/accounts/staking-info/3000000.json new file mode 100644 index 000000000..122f69bb0 --- /dev/null +++ b/e2e-tests/endpoints/kusama/accounts/staking-info/3000000.json @@ -0,0 +1,103 @@ +{ + "at": { + "hash": "0x5684300299fab954b2a5febd49e3d05712e78bdac7b734084c5079cb87625798", + "height": "3000000" + }, + "controller": "HJ6cnbBrA1N4SXkrC58tTH3VB2KdvrdMpXbH8SAEAa46oQC", + "rewardDestination": { + "stash": null + }, + "numSlashingSpans": "2", + "staking": { + "stash": "HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK", + "total": "497576923500", + "active": "497576923500", + "unlocking": [], + "claimedRewards": [ + "775", + "776", + "777", + "778", + "779", + "780", + "781", + "782", + "783", + "784", + "785", + "786", + "787", + "788", + "789", + "790", + "791", + "792", + "793", + "794", + "795", + "796", + "797", + "798", + "799", + "800", + "801", + "802", + "803", + "804", + "805", + "806", + "807", + "808", + "809", + "810", + "811", + "812", + "813", + "814", + "815", + "816", + "817", + "818", + "819", + "820", + "821", + "822", + "823", + "824", + "825", + "826", + "827", + "828", + "829", + "830", + "831", + "832", + "833", + "834", + "835", + "836", + "837", + "838", + "839", + "840", + "841", + "842", + "843", + "844", + "845", + "846", + "847", + "848", + "849", + "850", + "851", + "852", + "853", + "854", + "855", + "856", + "857", + "858" + ] + } +} diff --git a/e2e-tests/endpoints/kusama/accounts/staking-info/5000000.json b/e2e-tests/endpoints/kusama/accounts/staking-info/5000000.json new file mode 100644 index 000000000..6ce3adefb --- /dev/null +++ b/e2e-tests/endpoints/kusama/accounts/staking-info/5000000.json @@ -0,0 +1,37 @@ +{ + "at": { + "hash": "0xe360cc614f6de435a6e1e2598795aca7ca9dfc658b84ecf8e7139b89d7a161e3", + "height": "5000000" + }, + "controller": "HJ6cnbBrA1N4SXkrC58tTH3VB2KdvrdMpXbH8SAEAa46oQC", + "rewardDestination": { + "stash": null + }, + "numSlashingSpans": "2", + "staking": { + "stash": "HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK", + "total": "497576923500", + "active": "497576923500", + "unlocking": [], + "claimedRewards": [ + "1532", + "1533", + "1534", + "1535", + "1536", + "1537", + "1538", + "1539", + "1540", + "1541", + "1542", + "1543", + "1544", + "1545", + "1546", + "1547", + "1548", + "1549" + ] + } +} diff --git a/e2e-tests/endpoints/kusama/accounts/staking-info/8000000.json b/e2e-tests/endpoints/kusama/accounts/staking-info/8000000.json new file mode 100644 index 000000000..a8e2b8e7a --- /dev/null +++ b/e2e-tests/endpoints/kusama/accounts/staking-info/8000000.json @@ -0,0 +1,101 @@ +{ + "at": { + "hash": "0xe3a79b3c656f0d7d6b6b6c3105575b937f8324e6c1f36a27ab97b8f897cb2b8e", + "height": "8000000" + }, + "controller": "HJ6cnbBrA1N4SXkrC58tTH3VB2KdvrdMpXbH8SAEAa46oQC", + "rewardDestination": { + "stash": null + }, + "numSlashingSpans": "3", + "staking": { + "stash": "HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK", + "total": "497576923500", + "active": "497576923500", + "unlocking": [], + "claimedRewards": [ + "2314", + "2316", + "2317", + "2318", + "2319", + "2320", + "2321", + "2322", + "2323", + "2324", + "2325", + "2326", + "2327", + "2328", + "2329", + "2330", + "2331", + "2332", + "2333", + "2334", + "2335", + "2336", + "2337", + "2338", + "2339", + "2340", + "2341", + "2342", + "2343", + "2344", + "2345", + "2346", + "2347", + "2348", + "2349", + "2350", + "2351", + "2353", + "2354", + "2355", + "2356", + "2357", + "2358", + "2359", + "2360", + "2361", + "2362", + "2363", + "2364", + "2365", + "2366", + "2367", + "2368", + "2369", + "2370", + "2371", + "2372", + "2373", + "2374", + "2375", + "2376", + "2377", + "2378", + "2379", + "2380", + "2381", + "2382", + "2383", + "2384", + "2385", + "2386", + "2387", + "2388", + "2389", + "2390", + "2391", + "2392", + "2393", + "2394", + "2395", + "2396", + "2397" + ] + } +} diff --git a/e2e-tests/endpoints/kusama/accounts/staking-info/9500000.json b/e2e-tests/endpoints/kusama/accounts/staking-info/9500000.json new file mode 100644 index 000000000..0eabd1eaf --- /dev/null +++ b/e2e-tests/endpoints/kusama/accounts/staking-info/9500000.json @@ -0,0 +1,100 @@ +{ + "at": { + "hash": "0x10f81a4d78f2cd55d255a9c80b5d420315256a5af459f8a624be0bb31747563f", + "height": "9500000" + }, + "controller": "HJ6cnbBrA1N4SXkrC58tTH3VB2KdvrdMpXbH8SAEAa46oQC", + "rewardDestination": { + "stash": null + }, + "numSlashingSpans": "2", + "staking": { + "stash": "HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK", + "total": "497576923500", + "active": "497576923500", + "unlocking": [], + "claimedRewards": [ + "2734", + "2735", + "2736", + "2737", + "2738", + "2739", + "2740", + "2741", + "2742", + "2743", + "2745", + "2746", + "2747", + "2748", + "2749", + "2751", + "2752", + "2753", + "2754", + "2755", + "2756", + "2757", + "2758", + "2759", + "2760", + "2761", + "2762", + "2763", + "2764", + "2765", + "2766", + "2767", + "2768", + "2769", + "2770", + "2771", + "2772", + "2773", + "2774", + "2775", + "2776", + "2777", + "2778", + "2779", + "2780", + "2781", + "2782", + "2783", + "2784", + "2785", + "2786", + "2787", + "2788", + "2789", + "2790", + "2791", + "2792", + "2793", + "2794", + "2795", + "2796", + "2797", + "2798", + "2799", + "2800", + "2801", + "2802", + "2803", + "2804", + "2806", + "2807", + "2808", + "2809", + "2810", + "2811", + "2812", + "2813", + "2814", + "2815", + "2816", + "2817" + ] + } +} diff --git a/e2e-tests/endpoints/kusama/accounts/staking-info/9894877.json b/e2e-tests/endpoints/kusama/accounts/staking-info/9894877.json new file mode 100644 index 000000000..7854d887a --- /dev/null +++ b/e2e-tests/endpoints/kusama/accounts/staking-info/9894877.json @@ -0,0 +1,103 @@ +{ + "at": { + "hash": "0x6c820c44c7b473866ff1cd3770527c42a5905c18f1b26062b3eb71230cba3347", + "height": "9894877" + }, + "controller": "HJ6cnbBrA1N4SXkrC58tTH3VB2KdvrdMpXbH8SAEAa46oQC", + "rewardDestination": { + "stash": null + }, + "numSlashingSpans": "2", + "staking": { + "stash": "HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK", + "total": "497576923500", + "active": "497576923500", + "unlocking": [], + "claimedRewards": [ + "2845", + "2846", + "2847", + "2848", + "2849", + "2850", + "2851", + "2852", + "2853", + "2854", + "2855", + "2856", + "2857", + "2858", + "2859", + "2860", + "2861", + "2862", + "2863", + "2864", + "2865", + "2866", + "2867", + "2868", + "2869", + "2870", + "2871", + "2872", + "2873", + "2874", + "2875", + "2876", + "2877", + "2878", + "2879", + "2880", + "2881", + "2882", + "2883", + "2884", + "2885", + "2886", + "2887", + "2888", + "2889", + "2890", + "2891", + "2892", + "2893", + "2894", + "2895", + "2896", + "2897", + "2898", + "2899", + "2900", + "2901", + "2902", + "2903", + "2904", + "2905", + "2906", + "2907", + "2908", + "2909", + "2910", + "2911", + "2912", + "2913", + "2914", + "2915", + "2916", + "2917", + "2918", + "2919", + "2920", + "2921", + "2922", + "2923", + "2924", + "2925", + "2926", + "2927", + "2928" + ] + } +} diff --git a/e2e-tests/endpoints/kusama/accounts/staking-info/index.ts b/e2e-tests/endpoints/kusama/accounts/staking-info/index.ts new file mode 100644 index 000000000..34ccaef72 --- /dev/null +++ b/e2e-tests/endpoints/kusama/accounts/staking-info/index.ts @@ -0,0 +1,33 @@ +import accountsStakingInfo1500000 from './1500000.json'; +import accountsStakingInfo3000000 from './3000000.json'; +import accountsStakingInfo5000000 from './5000000.json'; +import accountsStakingInfo8000000 from './8000000.json'; +import accountsStakingInfo9500000 from './9500000.json'; +import accountsStakingInfo9894877 from './9894877.json'; + +export const kusamaAccountStakingInfoEndpoints = [ + [ + '/accounts/HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK/staking-info?at=1500000', + JSON.stringify(accountsStakingInfo1500000), + ], // v1054 + [ + '/accounts/HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK/staking-info?at=3000000', + JSON.stringify(accountsStakingInfo3000000), + ], // v2012 + [ + '/accounts/HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK/staking-info?at=5000000', + JSON.stringify(accountsStakingInfo5000000), + ], // v2026 + [ + '/accounts/HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK/staking-info?at=8000000', + JSON.stringify(accountsStakingInfo8000000), + ], // v9040 + [ + '/accounts/HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK/staking-info?at=9500000', + JSON.stringify(accountsStakingInfo9500000), + ], // v9090 + [ + '/accounts/HP8qJ8P4u4W2QgsJ8jzVuSsjfFTT6orQomFD6eTRSGEbiTK/staking-info?at=9894877', + JSON.stringify(accountsStakingInfo9894877), + ], // v9122 +]; diff --git a/e2e-tests/endpoints/polkadot/accounts/index.ts b/e2e-tests/endpoints/polkadot/accounts/index.ts index 5d17823d6..dc8201a0c 100644 --- a/e2e-tests/endpoints/polkadot/accounts/index.ts +++ b/e2e-tests/endpoints/polkadot/accounts/index.ts @@ -1,9 +1,11 @@ import { polkadotAccountBalanceEndpoints } from './balance-info'; +import { polkadotAccountStakingInfoEndpoints } from './staking-info'; import { polkadotAccountValidateEndpoints } from './validate'; import { polkadotAccountVestingInfoEndpoints } from './vesting-info'; export const polkadotAccountsEndpoints = [ ...polkadotAccountBalanceEndpoints, + ...polkadotAccountStakingInfoEndpoints, ...polkadotAccountVestingInfoEndpoints, ...polkadotAccountValidateEndpoints, ]; diff --git a/e2e-tests/endpoints/polkadot/accounts/staking-info/1000000.json b/e2e-tests/endpoints/polkadot/accounts/staking-info/1000000.json new file mode 100644 index 000000000..7afea7726 --- /dev/null +++ b/e2e-tests/endpoints/polkadot/accounts/staking-info/1000000.json @@ -0,0 +1,81 @@ +{ + "at": { + "hash": "0x490cd542b4a40ad743183c7d1088a4fe7b1edf21e50c850b86f29e389f31c5c1", + "height": "1000000" + }, + "controller": "14SPACEEpRuNmjaQFp5tDSv6kHjvDeSexdq9Hg62EJZW3EhA", + "rewardDestination": { + "staked": null + }, + "numSlashingSpans": "0", + "staking": { + "stash": "16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p", + "total": "146275200613711", + "active": "146275200613711", + "unlocking": [], + "claimedRewards": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "15", + "16", + "17", + "18", + "19", + "20", + "21", + "22", + "23", + "24", + "25", + "26", + "27", + "28", + "29", + "30", + "31", + "32", + "33", + "34", + "35", + "36", + "37", + "38", + "39", + "40", + "41", + "42", + "43", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "52", + "53", + "54", + "55", + "56", + "57", + "58", + "59", + "60", + "61", + "62" + ] + } +} diff --git a/e2e-tests/endpoints/polkadot/accounts/staking-info/3000000.json b/e2e-tests/endpoints/polkadot/accounts/staking-info/3000000.json new file mode 100644 index 000000000..38ada61b5 --- /dev/null +++ b/e2e-tests/endpoints/polkadot/accounts/staking-info/3000000.json @@ -0,0 +1,108 @@ +{ + "at": { + "hash": "0x657e61aa6d889c1e8bbb31315ddacd9d5b6ae797836ef3966ffab9d96ee16c15", + "height": "3000000" + }, + "controller": "14SPACEEpRuNmjaQFp5tDSv6kHjvDeSexdq9Hg62EJZW3EhA", + "rewardDestination": { + "stash": null + }, + "numSlashingSpans": "0", + "staking": { + "stash": "16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p", + "total": "155514320103496", + "active": "112964320103496", + "unlocking": [ + { + "value": "42550000000000", + "era": "221" + } + ], + "claimedRewards": [ + "119", + "120", + "121", + "122", + "123", + "124", + "125", + "126", + "127", + "128", + "129", + "130", + "131", + "132", + "133", + "134", + "135", + "136", + "137", + "138", + "139", + "140", + "141", + "142", + "143", + "144", + "145", + "146", + "147", + "148", + "149", + "150", + "151", + "152", + "153", + "154", + "155", + "156", + "157", + "158", + "159", + "160", + "161", + "162", + "163", + "164", + "165", + "166", + "167", + "168", + "169", + "170", + "171", + "172", + "173", + "174", + "175", + "176", + "177", + "178", + "179", + "180", + "181", + "182", + "183", + "184", + "185", + "186", + "187", + "188", + "189", + "190", + "191", + "192", + "193", + "194", + "195", + "196", + "197", + "198", + "199", + "200", + "201", + "202" + ] + } +} diff --git a/e2e-tests/endpoints/polkadot/accounts/staking-info/350000.json b/e2e-tests/endpoints/polkadot/accounts/staking-info/350000.json new file mode 100644 index 000000000..6b568b398 --- /dev/null +++ b/e2e-tests/endpoints/polkadot/accounts/staking-info/350000.json @@ -0,0 +1,27 @@ +{ + "at": { + "hash": "0xcb823ccd2b9b558998b00906a23bb98ee468eb9f3ecffcfb3c68c4358c634725", + "height": "350000" + }, + "controller": "14SPACEEpRuNmjaQFp5tDSv6kHjvDeSexdq9Hg62EJZW3EhA", + "rewardDestination": { + "staked": null + }, + "numSlashingSpans": "0", + "staking": { + "stash": "16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p", + "total": "138910737119627", + "active": "138910737119627", + "unlocking": [], + "claimedRewards": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8" + ] + } +} diff --git a/e2e-tests/endpoints/polkadot/accounts/staking-info/6000000.json b/e2e-tests/endpoints/polkadot/accounts/staking-info/6000000.json new file mode 100644 index 000000000..dfa0d7c6c --- /dev/null +++ b/e2e-tests/endpoints/polkadot/accounts/staking-info/6000000.json @@ -0,0 +1,103 @@ +{ + "at": { + "hash": "0x89f4608b568a05a89737bc826a32f8677f2646a5773312d7dee3a667458e5a98", + "height": "6000000" + }, + "controller": "14SPACEEpRuNmjaQFp5tDSv6kHjvDeSexdq9Hg62EJZW3EhA", + "rewardDestination": { + "staked": null + }, + "numSlashingSpans": "0", + "staking": { + "stash": "16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p", + "total": "155902410746517", + "active": "155902410746517", + "unlocking": [], + "claimedRewards": [ + "328", + "329", + "330", + "331", + "332", + "333", + "334", + "335", + "336", + "337", + "338", + "339", + "340", + "341", + "342", + "343", + "344", + "345", + "346", + "347", + "348", + "349", + "350", + "351", + "352", + "353", + "354", + "355", + "356", + "357", + "358", + "359", + "360", + "361", + "362", + "363", + "364", + "365", + "366", + "367", + "368", + "369", + "370", + "371", + "372", + "373", + "374", + "375", + "376", + "377", + "378", + "379", + "380", + "381", + "382", + "383", + "384", + "385", + "386", + "387", + "388", + "389", + "390", + "391", + "392", + "393", + "394", + "395", + "396", + "397", + "398", + "399", + "400", + "401", + "402", + "403", + "404", + "405", + "406", + "407", + "408", + "409", + "410", + "411" + ] + } +} diff --git a/e2e-tests/endpoints/polkadot/accounts/staking-info/7000000.json b/e2e-tests/endpoints/polkadot/accounts/staking-info/7000000.json new file mode 100644 index 000000000..eeb95c085 --- /dev/null +++ b/e2e-tests/endpoints/polkadot/accounts/staking-info/7000000.json @@ -0,0 +1,103 @@ +{ + "at": { + "hash": "0x4b34bd42835a084af0f441c5986d216b18a85abb4d03762096692e6f06365203", + "height": "7000000" + }, + "controller": "14SPACEEpRuNmjaQFp5tDSv6kHjvDeSexdq9Hg62EJZW3EhA", + "rewardDestination": { + "stash": null + }, + "numSlashingSpans": "0", + "staking": { + "stash": "16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p", + "total": "161445433495009", + "active": "161445433495009", + "unlocking": [], + "claimedRewards": [ + "397", + "398", + "399", + "400", + "401", + "402", + "403", + "404", + "405", + "406", + "407", + "408", + "409", + "410", + "411", + "412", + "413", + "414", + "415", + "416", + "417", + "418", + "419", + "420", + "421", + "422", + "423", + "424", + "425", + "426", + "427", + "428", + "429", + "430", + "431", + "432", + "433", + "434", + "435", + "436", + "437", + "438", + "439", + "440", + "441", + "442", + "443", + "444", + "445", + "446", + "447", + "448", + "449", + "450", + "451", + "452", + "453", + "454", + "455", + "456", + "457", + "458", + "459", + "460", + "461", + "462", + "463", + "464", + "465", + "466", + "467", + "468", + "469", + "470", + "471", + "472", + "473", + "474", + "475", + "476", + "477", + "478", + "479", + "480" + ] + } +} diff --git a/e2e-tests/endpoints/polkadot/accounts/staking-info/7472552.json b/e2e-tests/endpoints/polkadot/accounts/staking-info/7472552.json new file mode 100644 index 000000000..ad01553c6 --- /dev/null +++ b/e2e-tests/endpoints/polkadot/accounts/staking-info/7472552.json @@ -0,0 +1,100 @@ +{ + "at": { + "hash": "0x037fe3c557754f31243a1799aeba992580677eb46ade9b975eb8d3d2f5b2e37e", + "height": "7472552" + }, + "controller": "12juRYzpSEnKnXG9a3NmJrQueXzCZyLyuQngEESC4zjBBWrx", + "rewardDestination": { + "account": "12imiRFgMGpPPVRiXLhQixuk1jMeTrQbzSJcZ4Bj7a3idmWT" + }, + "numSlashingSpans": "0", + "staking": { + "stash": "13HtFCrxyz55KgkPWcnhHPwE8f8GmZrfXR3uC6jNrihGzmqz", + "total": "200000000000", + "active": "200000000000", + "unlocking": [], + "claimedRewards": [ + "430", + "431", + "432", + "433", + "434", + "435", + "436", + "437", + "438", + "439", + "440", + "441", + "442", + "443", + "444", + "445", + "446", + "447", + "448", + "449", + "450", + "451", + "452", + "453", + "454", + "455", + "456", + "457", + "458", + "459", + "460", + "461", + "462", + "463", + "464", + "465", + "466", + "467", + "468", + "469", + "470", + "471", + "472", + "473", + "474", + "475", + "476", + "477", + "478", + "479", + "480", + "481", + "482", + "483", + "484", + "485", + "486", + "487", + "488", + "492", + "493", + "494", + "495", + "496", + "497", + "498", + "499", + "500", + "501", + "502", + "503", + "504", + "505", + "506", + "507", + "508", + "509", + "510", + "511", + "512", + "513" + ] + } +} diff --git a/e2e-tests/endpoints/polkadot/accounts/staking-info/index.ts b/e2e-tests/endpoints/polkadot/accounts/staking-info/index.ts new file mode 100644 index 000000000..d8ab61e2a --- /dev/null +++ b/e2e-tests/endpoints/polkadot/accounts/staking-info/index.ts @@ -0,0 +1,33 @@ +import accountsStakingInfo350000 from './350000.json'; +import accountsStakingInfo1000000 from './1000000.json'; +import accountsStakingInfo3000000 from './3000000.json'; +import accountsStakingInfo6000000 from './6000000.json'; +import accountsStakingInfo7000000 from './7000000.json'; +import accountsStakingInfo7472552 from './7472552.json'; + +export const polkadotAccountStakingInfoEndpoints = [ + [ + '/accounts/16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p/staking-info?at=350000', + JSON.stringify(accountsStakingInfo350000), + ], // v11 + [ + '/accounts/16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p/staking-info?at=1000000', + JSON.stringify(accountsStakingInfo1000000), + ], // v17 + [ + '/accounts/16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p/staking-info?at=3000000', + JSON.stringify(accountsStakingInfo3000000), + ], // v26 + [ + '/accounts/16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p/staking-info?at=6000000', + JSON.stringify(accountsStakingInfo6000000), + ], // v9050 + [ + '/accounts/16SpacegeUTft9v3ts27CEC3tJaxgvE4uZeCctThFH3Vb24p/staking-info?at=7000000', + JSON.stringify(accountsStakingInfo7000000), + ], // v9090 + [ + '/accounts/13HtFCrxyz55KgkPWcnhHPwE8f8GmZrfXR3uC6jNrihGzmqz/staking-info?at=7472552', + JSON.stringify(accountsStakingInfo7472552), + ], // v9110 +]; diff --git a/e2e-tests/endpoints/westend/accounts/index.ts b/e2e-tests/endpoints/westend/accounts/index.ts index 23831d765..432f3cfc9 100644 --- a/e2e-tests/endpoints/westend/accounts/index.ts +++ b/e2e-tests/endpoints/westend/accounts/index.ts @@ -1,9 +1,11 @@ import { westendAccountBalanceEndpoints } from './balance-info'; +import { westendAccountStakingInfoEndpoints } from './staking-info'; import { westendAccountValidateEndpoints } from './validate'; import { westendAccountVestingInfoEndpoints } from './vesting-info'; export const westendAccountsEndpoints = [ ...westendAccountBalanceEndpoints, + ...westendAccountStakingInfoEndpoints, ...westendAccountVestingInfoEndpoints, ...westendAccountValidateEndpoints, ]; diff --git a/e2e-tests/endpoints/westend/accounts/staking-info/6000000.json b/e2e-tests/endpoints/westend/accounts/staking-info/6000000.json new file mode 100644 index 000000000..accabcf79 --- /dev/null +++ b/e2e-tests/endpoints/westend/accounts/staking-info/6000000.json @@ -0,0 +1,103 @@ +{ + "at": { + "hash": "0x906fdd056f990beb81705be460cc5107845faecc3149d99f70026ca3b996e70f", + "height": "6000000" + }, + "controller": "5HTSWhRgFNKDpR2PqYo2YhpwsMFXGSGfFABKojLxHGdMeM7A", + "rewardDestination": { + "staked": null + }, + "numSlashingSpans": "0", + "staking": { + "stash": "5Ek5JCnrRsyUGYNRaEvkufG1i1EUxEE9cytuWBBjA9oNZVsf", + "total": "10199950300000000", + "active": "10199950300000000", + "unlocking": [], + "claimedRewards": [ + "3526", + "3527", + "3528", + "3529", + "3530", + "3531", + "3532", + "3533", + "3534", + "3535", + "3536", + "3537", + "3538", + "3539", + "3540", + "3541", + "3542", + "3543", + "3544", + "3545", + "3546", + "3547", + "3548", + "3549", + "3550", + "3551", + "3552", + "3553", + "3554", + "3555", + "3556", + "3557", + "3558", + "3559", + "3560", + "3561", + "3562", + "3563", + "3564", + "3565", + "3566", + "3567", + "3568", + "3569", + "3570", + "3571", + "3572", + "3573", + "3574", + "3575", + "3576", + "3577", + "3578", + "3579", + "3580", + "3581", + "3582", + "3583", + "3584", + "3585", + "3586", + "3587", + "3588", + "3589", + "3590", + "3591", + "3592", + "3593", + "3594", + "3595", + "3596", + "3597", + "3598", + "3599", + "3600", + "3601", + "3602", + "3603", + "3604", + "3605", + "3606", + "3607", + "3608", + "3609" + ] + } +} diff --git a/e2e-tests/endpoints/westend/accounts/staking-info/8041521.json b/e2e-tests/endpoints/westend/accounts/staking-info/8041521.json new file mode 100644 index 000000000..a90f7d2ad --- /dev/null +++ b/e2e-tests/endpoints/westend/accounts/staking-info/8041521.json @@ -0,0 +1,103 @@ +{ + "at": { + "hash": "0xc4609f16b429004441579f7d202dd52972fa3fe71ce2e1714a38c885c457e72a", + "height": "8041521" + }, + "controller": "5EkARZVPmQe1w5gupk385JzhtNVFBUQrmx3CYFBJ3j3xQyJb", + "rewardDestination": { + "staked": null + }, + "numSlashingSpans": "0", + "staking": { + "stash": "5ENXqYmc5m6VLMm5i1mun832xAv2Qm9t3M4PWAFvvyCJLNoR", + "total": "42423015315073767", + "active": "42423015315073767", + "unlocking": [], + "claimedRewards": [ + "4219", + "4220", + "4221", + "4222", + "4223", + "4224", + "4225", + "4226", + "4227", + "4228", + "4229", + "4230", + "4231", + "4232", + "4233", + "4234", + "4235", + "4236", + "4237", + "4238", + "4239", + "4240", + "4241", + "4242", + "4243", + "4244", + "4245", + "4246", + "4247", + "4248", + "4249", + "4250", + "4251", + "4252", + "4253", + "4254", + "4255", + "4256", + "4257", + "4258", + "4259", + "4260", + "4261", + "4262", + "4263", + "4264", + "4265", + "4266", + "4267", + "4268", + "4269", + "4270", + "4271", + "4272", + "4273", + "4274", + "4275", + "4276", + "4277", + "4278", + "4279", + "4280", + "4281", + "4282", + "4283", + "4284", + "4285", + "4286", + "4287", + "4288", + "4289", + "4290", + "4291", + "4292", + "4293", + "4294", + "4295", + "4296", + "4297", + "4298", + "4299", + "4300", + "4301", + "4302" + ] + } +} diff --git a/e2e-tests/endpoints/westend/accounts/staking-info/index.ts b/e2e-tests/endpoints/westend/accounts/staking-info/index.ts new file mode 100644 index 000000000..2ea85265b --- /dev/null +++ b/e2e-tests/endpoints/westend/accounts/staking-info/index.ts @@ -0,0 +1,13 @@ +import accountsStakingInfo6000000 from './6000000.json'; +import accountsStakingInfo8041521 from './8041521.json'; + +export const westendAccountStakingInfoEndpoints = [ + [ + '/accounts/5Ek5JCnrRsyUGYNRaEvkufG1i1EUxEE9cytuWBBjA9oNZVsf/staking-info?at=6000000', + JSON.stringify(accountsStakingInfo6000000), + ], // v9033 + [ + '/accounts/5ENXqYmc5m6VLMm5i1mun832xAv2Qm9t3M4PWAFvvyCJLNoR/staking-info?at=8041521', + JSON.stringify(accountsStakingInfo8041521), + ], // v9122 +];