Skip to content

Commit

Permalink
feat: Add weight for Dock mainnet (#511)
Browse files Browse the repository at this point in the history
* Add weight for Dock mainnet

Signed-off-by: lovesh <lovesh.bond@gmail.com>

* Set minCalcFeeRuntime for Dock testnet

Signed-off-by: lovesh <lovesh.bond@gmail.com>
  • Loading branch information
lovesh authored Apr 9, 2021
1 parent 6294925 commit 7b7451d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/chains-config/dockMainnetControllers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ControllerConfig } from '../types/chains-config';
import { getBlockWeight } from './metadata-consts';

/**
* Controllers for Dock's mainnet.
Expand Down Expand Up @@ -26,7 +27,7 @@ export const dockMainnetControllers: ControllerConfig = {
},
options: {
finalizes: true,
minCalcFeeRuntime: null,
blockWeightStore: {},
minCalcFeeRuntime: 1,
blockWeightStore: getBlockWeight('dock-main-runtime'),
},
};
2 changes: 1 addition & 1 deletion src/chains-config/dockTestnetControllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const dockTestnetControllers: ControllerConfig = {
},
options: {
finalizes: true,
minCalcFeeRuntime: null,
minCalcFeeRuntime: 1,
blockWeightStore: {},
},
};
27 changes: 27 additions & 0 deletions src/chains-config/metadata-consts/dockConsts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { MetadataConsts } from '../../types/chains-config';

export const dockMainnetDefinitions: MetadataConsts[] = [
{
runtimeVersions: [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
],
extrinsicBaseWeight: BigInt(125000000),
},
];
3 changes: 3 additions & 0 deletions src/chains-config/metadata-consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
MetadataConsts,
PerClassValue,
} from '../../types/chains-config';
import { dockMainnetDefinitions } from './dockConsts';
import { kusamaDefinitions } from './kusamaConsts';
import { polkadotDefinitions } from './polkadotConsts';
import { westendDefinitions } from './westendConsts';
Expand Down Expand Up @@ -72,6 +73,8 @@ export function getBlockWeight(specName: string): BlockWeightStore {
return generateBlockWeightStore(kusamaDefinitions);
case 'westend':
return generateBlockWeightStore(westendDefinitions);
case 'dock-main-runtime':
return generateBlockWeightStore(dockMainnetDefinitions);
default:
return {};
}
Expand Down

0 comments on commit 7b7451d

Please sign in to comment.