Skip to content

Commit

Permalink
proof_size: None
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Dec 21, 2022
1 parent 8ddaa2f commit fe5caf9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions frame/support/procedural/src/storage/storage_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
>::storage_value_final_key().to_vec(),
max_values: Some(1),
max_size: Some(max_size),
proof_size,
}
]
}
Expand Down
2 changes: 2 additions & 0 deletions frame/support/src/storage/types/double_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ where
.saturating_add(Value::max_encoded_len())
.saturated_into(),
),
proof_size: None,
}]
}
}
Expand All @@ -727,6 +728,7 @@ where
prefix: Self::final_prefix().to_vec(),
max_values: MaxValues::get(),
max_size: None,
proof_size: None,
}]
}
}
Expand Down
2 changes: 2 additions & 0 deletions frame/support/src/storage/types/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ where
.saturating_add(Value::max_encoded_len())
.saturated_into(),
),
proof_size: None,
}]
}
}
Expand All @@ -474,6 +475,7 @@ where
prefix: Self::final_prefix().to_vec(),
max_values: MaxValues::get(),
max_size: None,
proof_size: None,
}]
}
}
Expand Down
2 changes: 2 additions & 0 deletions frame/support/src/storage/types/nmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ where
.saturating_add(Value::max_encoded_len())
.saturated_into(),
),
proof_size: None,
}]
}
}
Expand All @@ -612,6 +613,7 @@ where
prefix: Self::final_prefix().to_vec(),
max_values: MaxValues::get(),
max_size: None,
proof_size: None,
}]
}
}
Expand Down
2 changes: 2 additions & 0 deletions frame/support/src/storage/types/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ where
prefix: Self::hashed_key().to_vec(),
max_values: Some(1),
max_size: Some(Value::max_encoded_len().saturated_into()),
proof_size: None,
}]
}
}
Expand All @@ -259,6 +260,7 @@ where
prefix: Self::hashed_key().to_vec(),
max_values: Some(1),
max_size: None,
proof_size: None,
}]
}
}
Expand Down
7 changes: 7 additions & 0 deletions frame/support/src/traits/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ pub struct StorageInfo {
pub max_values: Option<u32>,
/// The maximum size of key/values in the storage, or none if no maximum specified.
pub max_size: Option<u32>,
pub proof_size: Option<ProofSizeMode>,
}

#[derive(codec::Encode, codec::Decode, crate::RuntimeDebug, Eq, PartialEq, Clone)]
pub enum ProofSizeMode {
MaxEncodedLen,
Measured,
}

/// A trait to give information about storage.
Expand Down

0 comments on commit fe5caf9

Please sign in to comment.