Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pallet-epico/runtime-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ sp_api::decl_runtime_apis! {
/// Get best effort estimation for a gas price.
fn gas_price() -> U256;

/// Returns pallet-epico's configured safe finality depth.
fn safe_finality_depth() -> u8;

/// Retrieves the timestamp for the current block.
fn block_timestamp() -> U256;

Expand Down
14 changes: 2 additions & 12 deletions rpc/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,8 @@ where

if offchain_status == OffchainStatus::Untrusted {
let block_info = self.client.info();
let safe_finality_depth = self
.client
.runtime_api()
.safe_finality_depth(block_info.best_hash)
.map_err(runtime_error_into_rpc_err)?;

if (block_info.best_number - safe_finality_depth.into())
if (block_info.best_number - 1_u8.into())
Comment thread
Anny0nn marked this conversation as resolved.
Outdated
> transaction_receipt.block_number.saturated_into()
{
return Ok(None);
Expand All @@ -608,11 +603,6 @@ where
block_number: <<Block as BlockT>::Header as sp_runtime::traits::Header>::Number,
) -> RpcResult<Vec<H256>> {
let block_info = self.client.info();
let safe_finality_depth = self
.client
.runtime_api()
.safe_finality_depth(block_info.best_hash)
.map_err(runtime_error_into_rpc_err)?;

let raw_block_transactions = self
.offchain_db
Expand All @@ -625,7 +615,7 @@ where
),
)
.or_else(|| {
if (block_info.best_number - safe_finality_depth.into()) <= block_number {
if (block_info.best_number - 1_u8.into()) <= block_number {
Comment thread
Anny0nn marked this conversation as resolved.
Outdated
self.offchain_db.clone().local_storage_get(
StorageKind::PERSISTENT,
&get_block_transaction_offchain_key(
Expand Down