@@ -34,9 +34,7 @@ export class PalletsStakingProgressService extends AbstractService {
34
34
* @param hash `BlockHash` to make call at
35
35
*/
36
36
async derivePalletStakingProgress ( hash : BlockHash ) : Promise < IPalletStakingProgress > {
37
- const { api, specName } = this ;
38
- const apiType = ApiPromiseRegistry . getTypeBySpecName ( specName ) ;
39
- const isApiAssetHub = apiType === 'assethub' ;
37
+ const { api } = this ;
40
38
const RCApiPromise = this . assetHubInfo . isAssetHub ? ApiPromiseRegistry . getApiByType ( 'relay' ) : null ;
41
39
42
40
if ( this . assetHubInfo . isAssetHub && ! RCApiPromise ?. length ) {
@@ -48,10 +46,9 @@ export class PalletsStakingProgressService extends AbstractService {
48
46
if ( historicApi . query . staking === undefined ) {
49
47
throw new Error ( 'Staking pallet not found for queried runtime' ) ;
50
48
}
51
- const sessionValidators =
52
- this . assetHubInfo . isAssetHub && isApiAssetHub
53
- ? RCApiPromise ! [ 0 ] . api . query . session . validators
54
- : historicApi . query . session . validators ;
49
+ const sessionValidators = this . assetHubInfo . isAssetHub
50
+ ? RCApiPromise ! [ 0 ] . api . query . session . validators
51
+ : historicApi . query . session . validators ;
55
52
56
53
if ( ! sessionValidators ) {
57
54
throw new Error ( 'Session pallet not found for queried runtime' ) ;
@@ -75,7 +72,7 @@ export class PalletsStakingProgressService extends AbstractService {
75
72
}
76
73
77
74
let deriveSessionAndEra ;
78
- if ( this . assetHubInfo . isAssetHub && this . assetHubInfo . isAssetHubMigrated && isApiAssetHub ) {
75
+ if ( this . assetHubInfo . isAssetHub && this . assetHubInfo . isAssetHubMigrated ) {
79
76
deriveSessionAndEra = this . deriveSessionAndEraProgressAssetHub ( historicApi , RCApiPromise ?. [ 0 ] . api ) ;
80
77
} else {
81
78
deriveSessionAndEra = this . deriveSessionAndEraProgress ( historicApi ) ;
0 commit comments