Skip to content

Commit

Permalink
Fixes clearAuthorities in chainspec when staking genesis is defined (
Browse files Browse the repository at this point in the history
…#1711)

* fixes staking chainspec

* Fix nix hash

* Set 'stakingBond' IFF there is at least one

* Trigger Build

---------

Co-authored-by: gpestana <gpestana@users.noreply.github.com>
Co-authored-by: Javier Viola <javier@parity.io>
Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 6, 2024
1 parent 42c4a80 commit 7632580
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions javascript/packages/orchestrator/src/chainSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ export function clearAuthorities(specPath: string) {
if (runtimeConfig?.collatorSelection)
runtimeConfig.collatorSelection.invulnerables = [];

// Clear staking
// clear staking
if (runtimeConfig?.staking) {
stakingBond = BigInt(runtimeConfig.staking.stakers[0][2]);
// Set `stakingBond` IFF there is at least one
if (runtimeConfig.staking.stakers[0])
stakingBond = BigInt(runtimeConfig.staking.stakers[0][2]);

runtimeConfig.staking.stakers = [];
runtimeConfig.staking.invulnerables = [];
runtimeConfig.staking.validatorCount = 0;
Expand Down

0 comments on commit 7632580

Please sign in to comment.