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

Set balance to the double of stakingBond #1940

Merged
merged 2 commits into from
Jan 21, 2025
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
6 changes: 2 additions & 4 deletions javascript/packages/orchestrator/src/chainSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ export async function addBalances(specPath: string, nodes: Node[]) {
const balanceToAdd = stakingBond
? node.validator && node.balance > stakingBond
? node.balance
: stakingBond! + BigInt(1)
: stakingBond! * BigInt(2) // Double the balance we use for stake
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only need to add ED to staking bond, but this is also fine since staking bond should always be greater than ED.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Yes, set to the double is an easy fix.

: node.balance;

balanceMap[stashKey] = balanceToAdd;

const logLine = `👤 Added Balance ${
node.balance
} for ${decorators.green(node.name)} - ${decorators.magenta(stashKey)}`;
const logLine = `👤 Added Balance ${balanceToAdd} for ${decorators.green(node.name)} - ${decorators.magenta(stashKey)}`;
new CreateLogTable({
colWidths: [120],
doubleBorder: true,
Expand Down
Loading