Skip to content

Commit

Permalink
Make generated block proposals cancel each other out
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-ds committed Feb 5, 2025
1 parent 33bf983 commit 2fba85e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion linera-client/src/client_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,11 @@ where
fungible_application_id: Option<ApplicationId>,
) -> Vec<RpcMessage> {
let mut proposals = Vec::new();
let mut next_recipient = self.wallet.last_chain().unwrap().chain_id;
let mut next_recipient = *key_pairs
.iter()
.last()
.expect("There should be a last element")
.0;
let amount = Amount::from(1);
for (&chain_id, key_pair) in key_pairs {
let public_key = key_pair.public();
Expand Down
5 changes: 5 additions & 0 deletions linera-service/src/linera/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,11 @@ impl Runnable for Job {
transactions_per_block,
fungible_application_id,
} => {
assert!(num_chains > 0, "Number of chains must be greater than 0");
assert!(
transactions_per_block > 0,
"Number of transactions per block must be greater than 0"
);
let start = Instant::now();
// Below all block proposals are supposed to succeed without retries, we
// must make sure that all incoming payments have been accepted on-chain
Expand Down

0 comments on commit 2fba85e

Please sign in to comment.