mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 17:57:56 +00:00
Storage chains: indexing, renewals and reference counting (#8265)
* Transaction indexing * Tests and fixes * Fixed a comment * Style * Build * Style * Apply suggestions from code review Co-authored-by: cheme <emericchevalier.pro@gmail.com> * Code review suggestions * Add missing impl * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * impl JoinInput * Don't store empty slices * JoinInput operates on slices Co-authored-by: cheme <emericchevalier.pro@gmail.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -25,7 +25,6 @@ use std::io;
|
||||
use std::sync::Arc;
|
||||
use std::task::{Context, Poll};
|
||||
use cid::Version;
|
||||
use codec::Encode;
|
||||
use core::pin::Pin;
|
||||
use futures::Future;
|
||||
use futures::io::{AsyncRead, AsyncWrite};
|
||||
@@ -257,15 +256,15 @@ impl<B: BlockT> NetworkBehaviour for Bitswap<B> {
|
||||
}
|
||||
let mut hash = B::Hash::default();
|
||||
hash.as_mut().copy_from_slice(&cid.hash().digest()[0..32]);
|
||||
let extrinsic = match self.client.extrinsic(&hash) {
|
||||
let transaction = match self.client.indexed_transaction(&hash) {
|
||||
Ok(ex) => ex,
|
||||
Err(e) => {
|
||||
error!(target: LOG_TARGET, "Error retrieving extrinsic {}: {}", hash, e);
|
||||
error!(target: LOG_TARGET, "Error retrieving transaction {}: {}", hash, e);
|
||||
None
|
||||
}
|
||||
};
|
||||
match extrinsic {
|
||||
Some(extrinsic) => {
|
||||
match transaction {
|
||||
Some(transaction) => {
|
||||
trace!(target: LOG_TARGET, "Found CID {:?}, hash {:?}", cid, hash);
|
||||
if entry.want_type == WantType::Block as i32 {
|
||||
let prefix = Prefix {
|
||||
@@ -276,7 +275,7 @@ impl<B: BlockT> NetworkBehaviour for Bitswap<B> {
|
||||
};
|
||||
response.payload.push(MessageBlock {
|
||||
prefix: prefix.to_bytes(),
|
||||
data: extrinsic.encode(),
|
||||
data: transaction,
|
||||
});
|
||||
} else {
|
||||
response.block_presences.push(BlockPresence {
|
||||
|
||||
Reference in New Issue
Block a user