Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit 497ac8f

Browse files
authored
Merge pull request #39 from KasarLabs/net/manual_import
Net/manual import
2 parents ec4192f + e47db87 commit 497ac8f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

crates/client/block-proposer/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ where
214214
) -> Self::Proposal {
215215
let (tx, rx) = oneshot::channel();
216216
let spawn_handle = self.spawn_handle.clone();
217+
let txs = self.transaction_pool.ready().count() > 0;
218+
219+
// If there are no transactions, return an error (we want to avoid empty blocks)
220+
if !txs {
221+
return async { Err(sp_blockchain::Error::Application("No transactions in pool".into())) }.boxed();
222+
}
217223

218224
spawn_handle.spawn_blocking(
219225
"madara-block-proposer",

crates/client/data-availability/src/utils.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use lazy_static::lazy_static;
55
use mp_storage::{
66
PALLET_STARKNET, STARKNET_CONTRACT_CLASS, STARKNET_CONTRACT_CLASS_HASH, STARKNET_NONCE, STARKNET_STORAGE,
77
};
8+
use reqwest::{StatusCode, header::{HeaderMap, CONTENT_TYPE}};
9+
use serde_json::json;
810
use sp_io::hashing::twox_128;
911
use url::{ParseError, Url};
1012

@@ -66,4 +68,4 @@ pub fn is_valid_ws_endpoint(endpoint: &str) -> bool {
6668

6769
pub fn is_valid_http_endpoint(endpoint: &str) -> bool {
6870
if let Ok(url) = get_valid_url(endpoint) { matches!(url.scheme(), "http" | "https") } else { false }
69-
}
71+
}

0 commit comments

Comments
 (0)