Resolve correct module for council derive (#5851)

* Resolve correct module for council derive

* remove console
This commit is contained in:
Tarik Gul
2024-04-15 23:41:40 +03:00
committed by GitHub
parent 8ab79958f0
commit 5b3f18e6fd
+4 -1
View File
@@ -67,8 +67,11 @@ function getModules (api: DeriveApi): [string, string | null] {
: api.query.elections
? 'elections'
: null;
// In some cases council here can refer to `generalCouncil` depending on what the chain specific override is.
// Therefore, we check to see if it exists in the query field. If it does not we default to `council`.
const resolvedCouncil = api.query[council] ? council : 'council';
return [council, elections];
return [resolvedCouncil, elections];
}
function queryAll (api: DeriveApi, council: string, elections: string): Observable<[AccountId32[], Candidate[], Member[], Member[]]> {