Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert jsonrpc type #1444

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Changes from all commits
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
17 changes: 4 additions & 13 deletions core/api/src/jsonrpc/web3_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ pub struct Web3Block {
pub number: U256,
pub gas_used: U256,
pub gas_limit: U256,
pub extra_data: Vec<Hex>,
pub extra_data: Hex,
pub logs_bloom: Option<Bloom>,
pub timestamp: U256,
pub difficulty: U256,
Expand Down Expand Up @@ -331,12 +331,7 @@ impl From<Block> for Web3Block {
total_difficulty: Some(b.header.number.into()),
seal_fields: vec![],
base_fee_per_gas: b.header.base_fee_per_gas,
extra_data: b
.header
.extra_data
.iter()
.map(|i| Hex::encode(&i.inner.encode().unwrap()))
.collect(),
extra_data: Hex::encode(rlp::encode_list(&b.header.extra_data)),
size: Some(b.header.size().into()),
gas_limit: b.header.gas_limit,
gas_used: b.header.gas_used,
Expand Down Expand Up @@ -826,7 +821,7 @@ pub struct FeeHistoryEmpty {
#[serde(rename_all = "camelCase")]
pub struct Web3Header {
pub difficulty: U256,
pub extra_data: Vec<Hex>,
pub extra_data: Hex,
pub gas_limit: U256,
pub gas_used: U256,
pub logs_bloom: Option<Bloom>,
Expand Down Expand Up @@ -854,11 +849,7 @@ impl From<Header> for Web3Header {
receipts_root: h.receipts_root,
miner: h.proposer,
difficulty: U256::one(),
extra_data: h
.extra_data
.into_iter()
.map(|i| Hex::encode(i.inner.encode().unwrap()))
.collect(),
extra_data: Hex::encode(rlp::encode_list(&h.extra_data)),
gas_limit: h.gas_limit,
gas_used: h.gas_used,
timestamp: h.timestamp.into(),
Expand Down