From 7fd3b15c057a127c66896f75465042d9c02335c7 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Wed, 10 Jan 2024 19:05:06 +0200 Subject: [PATCH] debug logs Signed-off-by: Alexandru Vasile --- subxt/src/backend/unstable/mod.rs | 80 ++++++++++--------- .../src/full_client/blocks/mod.rs | 2 + 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/subxt/src/backend/unstable/mod.rs b/subxt/src/backend/unstable/mod.rs index 04ab4bcea5..c2c3e704f4 100644 --- a/subxt/src/backend/unstable/mod.rs +++ b/subxt/src/backend/unstable/mod.rs @@ -490,47 +490,51 @@ impl Backend for UnstableBackend { // 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)), }) }); diff --git a/testing/integration-tests/src/full_client/blocks/mod.rs b/testing/integration-tests/src/full_client/blocks/mod.rs index efba9f0a14..3acdc1f19e 100644 --- a/testing/integration-tests/src/full_client/blocks/mod.rs +++ b/testing/integration-tests/src/full_client/blocks/mod.rs @@ -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();