mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
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: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
First start two validators that will run for the relay chain:
|
First start two validators that will run for the relay chain:
|
||||||
```sh
|
```sh
|
||||||
cargo run --features=real-overseer --release -- -d alice --chain rococo-local --validator --alice --port 50551
|
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:
|
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> {
|
) -> Box<dyn Fn(Hash, &ValidationData) -> Pin<Box<dyn Future<Output = Option<Collation>> + Send>> + Send + Sync> {
|
||||||
let state = self.state.clone();
|
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[..])
|
let parent = HeadData::decode(&mut &validation_data.persisted.parent_head.0[..])
|
||||||
.expect("Decodes parent head");
|
.expect("Decodes parent head");
|
||||||
|
|
||||||
let (block_data, head_data) = state.lock().unwrap().advance(parent);
|
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 {
|
let collation = Collation {
|
||||||
upward_messages: Vec::new(),
|
upward_messages: Vec::new(),
|
||||||
new_validation_code: None,
|
new_validation_code: None,
|
||||||
|
|||||||
Reference in New Issue
Block a user