debug logs

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2024-01-10 19:05:06 +02:00
parent 46942f4437
commit 7fd3b15c05
2 changed files with 44 additions and 38 deletions
+42 -38
View File
@@ -490,47 +490,51 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for UnstableBackend<T> {
// guarantee that when we return here, the finalized block we report has been
// reported from chainHead_follow already.
let mut seen_blocks_sub = self.follow_handle.subscribe().events().filter_map(|ev| {
std::future::ready(match ev {
FollowEvent::Initialized(ev) => {
unsafe {
FIN_BLOCK = Some(format!("{:?}", ev.finalized_block_hash));
std::future::ready({
println!("EV: {:#?}", ev);
match ev {
FollowEvent::Initialized(ev) => {
unsafe {
FIN_BLOCK = Some(format!("{:?}", ev.finalized_block_hash));
}
None
}
None
}
FollowEvent::NewBlock(ev) => {
Some(SeenBlock::New((ev.block_hash, ev.parent_block_hash)))
}
FollowEvent::Finalized(ev) => {
unsafe {
PRUNED = Some(format!(" pruned {:?} {:?}", PRUNED, ev.pruned_block_hashes));
FollowEvent::NewBlock(ev) => {
Some(SeenBlock::New((ev.block_hash, ev.parent_block_hash)))
}
Some(SeenBlock::Finalized(ev.finalized_block_hashes))
FollowEvent::Finalized(ev) => {
unsafe {
PRUNED =
Some(format!(" pruned {:?} {:?}", PRUNED, ev.pruned_block_hashes));
}
Some(SeenBlock::Finalized(ev.finalized_block_hashes))
}
FollowEvent::BestBlockChanged(_) => {
Some(SeenBlock::Other(OtherEvent::BestBlockChanged))
}
FollowEvent::OperationBodyDone(_) => {
Some(SeenBlock::Other(OtherEvent::OperationBodyDone))
}
FollowEvent::OperationCallDone(_) => {
Some(SeenBlock::Other(OtherEvent::OperationCallDone))
}
FollowEvent::OperationStorageItems(_) => {
Some(SeenBlock::Other(OtherEvent::OperationStorageItems))
}
FollowEvent::OperationWaitingForContinue(_) => {
Some(SeenBlock::Other(OtherEvent::OperationWaitingForContinue))
}
FollowEvent::OperationStorageDone(_) => {
Some(SeenBlock::Other(OtherEvent::OperationStorageDone))
}
FollowEvent::OperationInaccessible(_) => {
Some(SeenBlock::Other(OtherEvent::OperationInaccessible))
}
FollowEvent::OperationError(_) => {
Some(SeenBlock::Other(OtherEvent::OperationError))
}
FollowEvent::Stop => Some(SeenBlock::Other(OtherEvent::Stop)),
}
FollowEvent::BestBlockChanged(_) => {
Some(SeenBlock::Other(OtherEvent::BestBlockChanged))
}
FollowEvent::OperationBodyDone(_) => {
Some(SeenBlock::Other(OtherEvent::OperationBodyDone))
}
FollowEvent::OperationCallDone(_) => {
Some(SeenBlock::Other(OtherEvent::OperationCallDone))
}
FollowEvent::OperationStorageItems(_) => {
Some(SeenBlock::Other(OtherEvent::OperationStorageItems))
}
FollowEvent::OperationWaitingForContinue(_) => {
Some(SeenBlock::Other(OtherEvent::OperationWaitingForContinue))
}
FollowEvent::OperationStorageDone(_) => {
Some(SeenBlock::Other(OtherEvent::OperationStorageDone))
}
FollowEvent::OperationInaccessible(_) => {
Some(SeenBlock::Other(OtherEvent::OperationInaccessible))
}
FollowEvent::OperationError(_) => {
Some(SeenBlock::Other(OtherEvent::OperationError))
}
FollowEvent::Stop => Some(SeenBlock::Other(OtherEvent::Stop)),
})
});
@@ -286,6 +286,8 @@ async fn decode_signed_extensions_from_blocks() {
.unwrap()
.tip();
println!("Second transaction\n\n");
let transaction2 = submit_transfer_extrinsic_and_get_it_back!(5678);
let extensions2 = transaction2.signed_extensions().unwrap();
let nonce2 = extensions2.nonce().unwrap();