Add .args to decoded StorageKeys (#2004)

* Add .args to decoded StorageKeys

* Small opts

* Formatting
This commit is contained in:
Jaco Greeff
2020-03-06 13:47:40 +01:00
committed by GitHub
parent 63c22414ce
commit adee447cd0
7 changed files with 121 additions and 27 deletions
@@ -20,10 +20,7 @@ function queryNextStakers (api: ApiInterfaceRx): Observable<AccountId[]> {
api.query.staking.erasStakers.entries(activeEra.addn(1))
),
map((entries): AccountId[] =>
// key is from concat with AccountId bytes right at the end
entries.map(([key]): AccountId =>
api.registry.createType('AccountId', key.toU8a().slice(-32))
)
entries.map(([key]): AccountId => key.args[1] as AccountId)
)
);
}