Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Moonbase collator balance #766

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { generateKeyForNode as _generateKeyForNode } from "../keys";
import { ChainSpec, Node } from "../types";

// track 1st staking as default;
let paraStakingBond: number | undefined;
let paraStakingBond: bigint | undefined;

export type GenesisNodeKey = [string, string];

Expand Down Expand Up @@ -130,9 +130,18 @@ async function addParaCustom(specPath: string, node: Node) {

const { eth_account } = node.accounts;

const stakingBond = paraStakingBond || BigInt("1000000000000000000000");
const reservedBalance = BigInt("100000000000000000000");

// Ensure collator account has enough balance to bond and add candidate
runtimeConfig.balances.balances.push([
eth_account.address,
stakingBond + reservedBalance,
]);

runtimeConfig.parachainStaking.candidates.push([
eth_account.address,
paraStakingBond || 1000000000000,
stakingBond,
]);

writeChainSpec(specPath, chainSpec);
Expand Down