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

feat(genesis): update extra_fields to use OtherFields #936

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions crates/genesis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ alloy-serde.workspace = true

# serde
serde.workspace = true

[dev-dependencies]
serde_json.workspace = true

[features]
Expand Down
6 changes: 3 additions & 3 deletions crates/genesis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

extern crate alloc;

use alloc::{collections::BTreeMap, string::String};
use alloc::collections::BTreeMap;
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_serde::{storage::deserialize_storage_map, ttd::deserialize_json_ttd_opt};
use alloy_serde::{storage::deserialize_storage_map, ttd::deserialize_json_ttd_opt, OtherFields};
use serde::{Deserialize, Serialize};

/// The genesis block specification.
Expand Down Expand Up @@ -421,7 +421,7 @@ pub struct ChainConfig {

/// Additional fields specific to each chain.
#[serde(flatten, default)]
pub extra_fields: BTreeMap<String, serde_json::Value>,
pub extra_fields: OtherFields,

/// The deposit contract address
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand Down