Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix set_items
  • Loading branch information
rphmeier committed Feb 26, 2018
commit 38d0ff572d7cc2031dbb1911ff72e93a50ddfd9c
2 changes: 1 addition & 1 deletion polkadot/runtime/src/runtime/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub mod internal {
///
/// Called by `next_session` only.
pub fn set_authorities<'a, I: IntoIterator<Item=&'a SessionKey>>(authorities: I) {
AuthorityStorageVec::set_items::<I>(authorities);
AuthorityStorageVec::set_items(authorities);
}

/// Set a single authority by index.
Expand Down
8 changes: 4 additions & 4 deletions substrate/runtime-support/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ pub trait StorageVec {
{
let mut count: u32 = 0;

for (v, i) in items.into_iter().enumerate() {
for i in items.into_iter() {
put(&count.to_keyed_vec(Self::PREFIX), i);
count = count.checked_add(1).expect("exceeded runtime storage capacity");
put(&v.to_keyed_vec(Self::PREFIX), i);
}

Self::set_count(count);
Expand Down Expand Up @@ -282,9 +282,9 @@ pub mod unhashed {
{
let mut count: u32 = 0;

for (v, i) in items.into_iter().enumerate() {
for i in items.into_iter() {
put(&count.to_keyed_vec(Self::PREFIX), i);
count = count.checked_add(1).expect("exceeded runtime storage capacity");
put(&v.to_keyed_vec(Self::PREFIX), i);
}

Self::set_count(count);
Expand Down