Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
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
Fix compact npos solution edge count calculation
This edge count is used for weighing, and it is somewhat trivial to review and verify that the current implementation was ignoring `votes16` field of the struct. As reminder, the struct is like this: 
```rust

struct Compact {
  votes1: ... ,
  votes2: ..., 
  ...,
  votes16: ...,
}
```

I already will fix this in #7007, but since it might take a while, this one can go in asap and make it to the very next runtime.
  • Loading branch information
kianenigma authored Sep 3, 2020
commit a8f91d181f75cc7988c7452ecd3b64f5e5a00445
2 changes: 1 addition & 1 deletion primitives/npos-elections/compact/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn struct_def(
)
}).collect::<TokenStream2>();

let edge_count_impl = (1..count).map(|c| {
let edge_count_impl = (1..=count).map(|c| {
let field_name = field_name_for(c);
quote!(
all_edges = all_edges.saturating_add(
Expand Down