Support sending and receiving multiple Justifications (#8266)

* client/network: support sending multiple justifications

* network: flag support for multiple justifications in protobuf request

* Update client/network/src/protocol.rs

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* network: update comment on protobuf field

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
Jon Häggblad
2021-04-28 12:59:50 +02:00
committed by GitHub
parent 1f02ec8ce4
commit d3d02d8851
7 changed files with 69 additions and 22 deletions
+7
View File
@@ -580,6 +580,11 @@ impl<B: BlockT> Protocol<B> {
} else {
None
},
justifications: if !block_data.justifications.is_empty() {
Some(DecodeAll::decode_all(&mut block_data.justifications.as_ref())?)
} else {
None
},
})
}).collect::<Result<Vec<_>, codec::Error>>();
@@ -908,6 +913,7 @@ impl<B: BlockT> Protocol<B> {
receipt: None,
message_queue: None,
justification: None,
justifications: None,
},
],
},
@@ -1123,6 +1129,7 @@ fn prepare_block_request<B: BlockT>(
to_block: request.to.map(|h| h.encode()).unwrap_or_default(),
direction: request.direction as i32,
max_blocks: request.max.unwrap_or(0),
support_multiple_justifications: true,
};
CustomMessageOutcome::BlockRequest {