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: update simple_node #2787
Merged
Merged
fix: update simple_node #2787
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
joske
force-pushed
the
fix/simple_node
branch
from
October 20, 2023 08:36
e8fbdf0
to
7a5e48d
Compare
howardwu
reviewed
Oct 22, 2023
joske
force-pushed
the
fix/simple_node
branch
from
October 23, 2023 07:19
9682944
to
06834b6
Compare
joske
force-pushed
the
fix/simple_node
branch
2 times, most recently
from
October 26, 2023 05:47
8172aa0
to
41579f2
Compare
joske
force-pushed
the
fix/simple_node
branch
2 times, most recently
from
November 2, 2023 10:23
8bc18ef
to
471b7a5
Compare
joske
force-pushed
the
fix/simple_node
branch
from
November 20, 2023 10:25
471b7a5
to
d4122b0
Compare
howardwu
reviewed
Mar 13, 2024
node/bft/examples/simple_node.rs
Outdated
Comment on lines
135
to
145
// Initialize the translucent ledger service. | ||
let gen_key = account.private_key(); | ||
let public_balance_per_validator = | ||
(1_500_000_000_000_000 - (num_nodes as u64) * 1_000_000_000_000) / (num_nodes as u64); | ||
let mut balances = IndexMap::<Address<CurrentNetwork>, u64>::new(); | ||
for address in committee.members().keys() { | ||
balances.insert(*address, public_balance_per_validator); | ||
} | ||
let mut rng = TestRng::default(); | ||
let gen_ledger = genesis_ledger(*gen_key, committee.clone(), balances.clone(), &mut rng); | ||
let ledger = Arc::new(TranslucentLedgerService::new(gen_ledger)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be abstracted and cleaned up?
howardwu
reviewed
Mar 13, 2024
node/bft/examples/simple_node.rs
Outdated
Comment on lines
181
to
190
let gen_key = account.private_key(); | ||
let public_balance_per_validator = | ||
(1_500_000_000_000_000 - (num_nodes as u64) * 1_000_000_000_000) / (num_nodes as u64); | ||
let mut balances = IndexMap::<Address<CurrentNetwork>, u64>::new(); | ||
for address in committee.members().keys() { | ||
balances.insert(*address, public_balance_per_validator); | ||
} | ||
let mut rng = TestRng::default(); | ||
let gen_ledger = genesis_ledger(*gen_key, committee.clone(), balances.clone(), &mut rng); | ||
let ledger = Arc::new(TranslucentLedgerService::new(gen_ledger)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be abstracted and cleaned up?
howardwu
approved these changes
Mar 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make simple_node work again.
Credit: @ljedrz