Start enumSet lookup at 1

This commit is contained in:
Jaco Greeff
2018-10-16 10:00:30 +02:00
parent a1871012e2
commit 4ff2b2dc8b
+2 -2
View File
@@ -31,10 +31,10 @@ export default class ApiCombined extends ApiCalls {
: new BN(0);
return this.combine(
Array(lastIndex.div(ENUMSET_SIZE).toNumber()).map((_, i): Observable<Array<AccountId> | undefined> =>
Array(lastIndex.div(ENUMSET_SIZE).toNumber() + 1).map((_, i) =>
this.getAccountEnumSet(i * ENUMSET_SIZE.toNumber())
),
(...all: Array<Array<AccountId> | undefined>) => {
(all: Array<Array<AccountId> | undefined> = []) => {
return all.reduce((result, list = [], outerIndex: number) => {
list.forEach((accountId, innerIndex) => {
const index = (outerIndex * ENUMSET_SIZE.toNumber()) + innerIndex;