Skip to content

Commit 8770f3a

Browse files
authored
fix: add support for Parallel and Heiko (#1012)
* init heiko and parallel config * Update calc_bg.wasm * Revert "Update calc_bg.wasm" This reverts commit 37e5d64. * Update calc_fee.rs
1 parent 8164281 commit 8770f3a

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
2+
// This file is part of Substrate API Sidecar.
3+
//
4+
// Substrate API Sidecar is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
17+
import { ControllerConfig } from '../types/chains-config';
18+
import { initLRUCache } from './cache/lruCache';
19+
20+
/**
21+
* Controllers for Heiko collator
22+
*/
23+
export const heikoControllers: ControllerConfig = {
24+
controllers: [
25+
'AccountsAssets',
26+
'AccountsBalanceInfo',
27+
'AccountsValidate',
28+
'AccountsVestingInfo',
29+
'Blocks',
30+
'BlocksExtrinsics',
31+
'NodeNetwork',
32+
'NodeTransactionPool',
33+
'NodeVersion',
34+
'PalletsAssets',
35+
'PalletsStorage',
36+
'Paras',
37+
'RuntimeCode',
38+
'RuntimeMetadata',
39+
'RuntimeSpec',
40+
'TransactionDryRun',
41+
'TransactionFeeEstimate',
42+
'TransactionMaterial',
43+
'TransactionSubmit',
44+
],
45+
options: {
46+
finalizes: true,
47+
minCalcFeeRuntime: 1,
48+
blockStore: initLRUCache(),
49+
},
50+
};

src/chains-config/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ import { defaultControllers } from './defaultControllers';
2929
import { dockMainnetControllers } from './dockMainnetControllers';
3030
import { dockPoSMainnetControllers } from './dockPoSMainnetControllers';
3131
import { dockTestnetControllers } from './dockPoSTestnetControllers';
32+
import { heikoControllers } from './heikoControllers';
3233
import { karuraControllers } from './karuraControllers';
3334
import { kiltControllers } from './kiltControllers';
3435
import { kulupuControllers } from './kulupuControllers';
3536
import { kusamaControllers } from './kusamaControllers';
3637
import { mandalaControllers } from './mandalaControllers';
3738
import { mantaControllers } from './mantaControllers';
39+
import { parallelControllers } from './parallelControllers';
3840
import { polkadotControllers } from './polkadotControllers';
3941
import { polymeshControllers } from './polymeshControllers';
4042
import { shidenControllers } from './shidenControllers';
@@ -67,6 +69,8 @@ const specToControllerMap: { [x: string]: ControllerConfig } = {
6769
manta: mantaControllers,
6870
crust: crustControllers,
6971
bifrost: bifrostControllers,
72+
heiko: heikoControllers,
73+
parallel: parallelControllers,
7074
};
7175

7276
/**
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
2+
// This file is part of Substrate API Sidecar.
3+
//
4+
// Substrate API Sidecar is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// This program is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
17+
import { ControllerConfig } from '../types/chains-config';
18+
import { initLRUCache } from './cache/lruCache';
19+
20+
/**
21+
* Controllers for Parallel collator
22+
*/
23+
export const parallelControllers: ControllerConfig = {
24+
controllers: [
25+
'AccountsAssets',
26+
'AccountsBalanceInfo',
27+
'AccountsValidate',
28+
'AccountsVestingInfo',
29+
'Blocks',
30+
'BlocksExtrinsics',
31+
'NodeNetwork',
32+
'NodeTransactionPool',
33+
'NodeVersion',
34+
'PalletsAssets',
35+
'PalletsStorage',
36+
'Paras',
37+
'RuntimeCode',
38+
'RuntimeMetadata',
39+
'RuntimeSpec',
40+
'TransactionDryRun',
41+
'TransactionFeeEstimate',
42+
'TransactionMaterial',
43+
'TransactionSubmit',
44+
],
45+
options: {
46+
finalizes: true,
47+
minCalcFeeRuntime: 1,
48+
blockStore: initLRUCache(),
49+
},
50+
};

0 commit comments

Comments
 (0)