mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
StatementDistributionMessage::get_metadata is a footgun and should be removed (#5101)
* remove get_metadata method * cargo fmt * add get_metadata function in test * cargo fmt * Update node/network/statement-distribution/src/tests.rs Co-authored-by: Robert Habermeier <rphmeier@gmail.com> * update * update Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
@@ -332,19 +332,6 @@ pub mod v1 {
|
||||
}
|
||||
|
||||
impl StatementDistributionMessage {
|
||||
/// Get meta data of the given `StatementDistributionMessage`.
|
||||
pub fn get_metadata(&self) -> StatementMetadata {
|
||||
match self {
|
||||
Self::Statement(relay_parent, statement) => StatementMetadata {
|
||||
relay_parent: *relay_parent,
|
||||
candidate_hash: statement.unchecked_payload().candidate_hash(),
|
||||
signed_by: statement.unchecked_validator_index(),
|
||||
signature: statement.unchecked_signature().clone(),
|
||||
},
|
||||
Self::LargeStatement(metadata) => metadata.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get fingerprint describing the contained statement uniquely.
|
||||
pub fn get_fingerprint(&self) -> (CompactStatement, ValidatorIndex) {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user