Skip to content

Commit

Permalink
use decode value
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzhhuang committed Jul 5, 2024
1 parent c034d03 commit e4cf9ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sync/src/tasks/block_sync_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::tasks::continue_execute_absent_block::ContinueExecuteAbsentBlock;
use crate::tasks::{BlockConnectedEvent, BlockConnectedEventHandle, BlockFetcher, BlockLocalStore};
use crate::verified_rpc_client::RpcVerifyError;
use anyhow::{format_err, Context, Result};
use bcs_ext::BCSCodec;
use futures::future::BoxFuture;
use futures::FutureExt;
use network_api::PeerId;
Expand All @@ -17,6 +16,7 @@ use starcoin_chain::{verifier::BasicVerifier, BlockChain};
use starcoin_chain_api::{ChainReader, ChainType, ChainWriter, ConnectBlockError, ExecutedBlock};
use starcoin_config::G_CRATE_VERSION;
use starcoin_crypto::HashValue;
use starcoin_dag::consensusdb::schema::ValueCodec;
use starcoin_logger::prelude::*;
use starcoin_network_rpc_api::MAX_BLOCK_REQUEST_SIZE;
use starcoin_storage::db_storage::SchemaIterator;
Expand Down Expand Up @@ -480,7 +480,7 @@ where
.take(720)
.map(|result_block| match result_block {
anyhow::Result::Ok((_, data_raw)) => {
let dag_sync_block = DagSyncBlock::decode(&data_raw)?;
let dag_sync_block = DagSyncBlock::decode_value(&data_raw)?;
Ok(dag_sync_block.block.ok_or_else(|| {
format_err!("block in sync dag block should not be none!")
})?)
Expand Down

0 comments on commit e4cf9ed

Please sign in to comment.