Unverified Commit 765d3915 authored by Sergey Pepyakin's avatar Sergey Pepyakin Committed by GitHub
Browse files

adder collator updates (#1904)



* Fix adder collator README

* Add trivial logging to show that collator collates

* Update parachain/test-parachains/adder/collator/src/lib.rs
Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
parent 0363cc63
Pipeline #112992 passed with stages
in 19 minutes and 9 seconds
......@@ -3,7 +3,7 @@
First start two validators that will run for the relay chain:
```sh
cargo run --features=real-overseer --release -- -d alice --chain rococo-local --validator --alice --port 50551
cargo run --features=real-overseer --release -- -d bob --chain rococo-local --validator --alice --port 50552
cargo run --features=real-overseer --release -- -d bob --chain rococo-local --validator --bob --port 50552
```
Next start the collator that will collate for the adder parachain:
......
......@@ -100,12 +100,18 @@ impl Collator {
) -> Box<dyn Fn(Hash, &ValidationData) -> Pin<Box<dyn Future<Output = Option<Collation>> + Send>> + Send + Sync> {
let state = self.state.clone();
Box::new(move |_, validation_data| {
Box::new(move |relay_parent, validation_data| {
let parent = HeadData::decode(&mut &validation_data.persisted.parent_head.0[..])
.expect("Decodes parent head");
let (block_data, head_data) = state.lock().unwrap().advance(parent);
log::info!(
"created a new collation on relay-parent({}): {:?}",
relay_parent,
block_data,
);
let collation = Collation {
upward_messages: Vec::new(),
new_validation_code: None,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment