Skip to content

Commit

Permalink
fix: add support for Parallel and Heiko (#1012)
Browse files Browse the repository at this point in the history
* init heiko and parallel config

* Update calc_bg.wasm

* Revert "Update calc_bg.wasm"

This reverts commit 37e5d64.

* Update calc_fee.rs
  • Loading branch information
mclyk authored Aug 8, 2022
1 parent 8164281 commit 8770f3a
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/chains-config/heikoControllers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { ControllerConfig } from '../types/chains-config';
import { initLRUCache } from './cache/lruCache';

/**
* Controllers for Heiko collator
*/
export const heikoControllers: ControllerConfig = {
controllers: [
'AccountsAssets',
'AccountsBalanceInfo',
'AccountsValidate',
'AccountsVestingInfo',
'Blocks',
'BlocksExtrinsics',
'NodeNetwork',
'NodeTransactionPool',
'NodeVersion',
'PalletsAssets',
'PalletsStorage',
'Paras',
'RuntimeCode',
'RuntimeMetadata',
'RuntimeSpec',
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionSubmit',
],
options: {
finalizes: true,
minCalcFeeRuntime: 1,
blockStore: initLRUCache(),
},
};
4 changes: 4 additions & 0 deletions src/chains-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ import { defaultControllers } from './defaultControllers';
import { dockMainnetControllers } from './dockMainnetControllers';
import { dockPoSMainnetControllers } from './dockPoSMainnetControllers';
import { dockTestnetControllers } from './dockPoSTestnetControllers';
import { heikoControllers } from './heikoControllers';
import { karuraControllers } from './karuraControllers';
import { kiltControllers } from './kiltControllers';
import { kulupuControllers } from './kulupuControllers';
import { kusamaControllers } from './kusamaControllers';
import { mandalaControllers } from './mandalaControllers';
import { mantaControllers } from './mantaControllers';
import { parallelControllers } from './parallelControllers';
import { polkadotControllers } from './polkadotControllers';
import { polymeshControllers } from './polymeshControllers';
import { shidenControllers } from './shidenControllers';
Expand Down Expand Up @@ -67,6 +69,8 @@ const specToControllerMap: { [x: string]: ControllerConfig } = {
manta: mantaControllers,
crust: crustControllers,
bifrost: bifrostControllers,
heiko: heikoControllers,
parallel: parallelControllers,
};

/**
Expand Down
50 changes: 50 additions & 0 deletions src/chains-config/parallelControllers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { ControllerConfig } from '../types/chains-config';
import { initLRUCache } from './cache/lruCache';

/**
* Controllers for Parallel collator
*/
export const parallelControllers: ControllerConfig = {
controllers: [
'AccountsAssets',
'AccountsBalanceInfo',
'AccountsValidate',
'AccountsVestingInfo',
'Blocks',
'BlocksExtrinsics',
'NodeNetwork',
'NodeTransactionPool',
'NodeVersion',
'PalletsAssets',
'PalletsStorage',
'Paras',
'RuntimeCode',
'RuntimeMetadata',
'RuntimeSpec',
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionSubmit',
],
options: {
finalizes: true,
minCalcFeeRuntime: 1,
blockStore: initLRUCache(),
},
};

0 comments on commit 8770f3a

Please sign in to comment.