for some reason affected accounts are not updated
@@ -181,7 +181,7 @@ impl PlasmaStateKeeper {
affected_accounts: FnvHashSet::default(),
};
- let mut affected_accounts: FnvHashSet<u32> = FnvHashSet::default();
+ let mut all_affected_senders: FnvHashSet<u32> = FnvHashSet::default();
while applied_transactions.len() < config::TRANSFER_BATCH_SIZE {
@@ -212,12 +212,20 @@ impl PlasmaStateKeeper {
println!("accepted transaction for account {}, nonce {}", tx.from, tx.nonce);
applied_transactions.push(tx);
response.included.push(pool_tx);
- affected_accounts.insert(next_from);
+
+ let inserted = all_affected_senders.insert(next_from);
+ if inserted {
+ println!("Inserted {} in all affected senders", next_from);
+ }
},
Err(error_type) => {
self.state.balance_tree.insert(tx.from, from);
self.state.balance_tree.insert(tx.to, to);
- affected_accounts.insert(next_from);
+
+ let inserted = all_affected_senders.insert(next_from);
+ if inserted {
+ println!("Inserted {} in all affected senders", next_from);
+ }
match error_type {
TransferApplicationError::InsufficientBalance => {
println!("insufficient balance");
@@ -240,8 +248,11 @@ impl PlasmaStateKeeper {
unimplemented!()
// TODO: implement padding
}
+ println!("Affected sender = {}", all_affected_senders.len());
+
+ response.affected_accounts = all_affected_senders;
- response.affected_accounts = affected_accounts;
+ println!("Added to response, affected accounts = {}", response.affected_accounts.len());
assert_eq!(applied_transactions.len(), response.included.len());
