Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
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
42 changes: 41 additions & 1 deletion crates/supervisor/types/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl BlockSeal {
}
/// Output data for version 0 of the protocol.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "PascalCase")]
#[serde(rename_all = "camelCase")]
Comment thread
dhyaniarun1993 marked this conversation as resolved.
pub struct OutputV0 {
/// The state root hash
pub state_root: B256,
Expand All @@ -58,3 +58,43 @@ pub struct SubscriptionEvent {
/// Represents the event data sent by the node
pub data: Option<ManagedEvent>,
}

#[cfg(test)]
mod tests {
use super::*;
use alloy_primitives::B256;
use serde_json::{Value, json};

#[test]
fn test_output_v0_serialize_camel_case() {
let output = OutputV0 {
state_root: B256::from([1u8; 32]),
message_passer_storage_root: B256::from([2u8; 32]),
block_hash: B256::from([3u8; 32]),
};

let json_str = serde_json::to_string(&output).unwrap();
let v: Value = serde_json::from_str(&json_str).unwrap();

// Check that keys are camelCase
assert!(v.get("stateRoot").is_some());
assert!(v.get("messagePasserStorageRoot").is_some());
assert!(v.get("blockHash").is_some());
}

#[test]
fn test_output_v0_deserialize_camel_case() {
let json_obj = json!({
"stateRoot": "0x0101010101010101010101010101010101010101010101010101010101010101",
"messagePasserStorageRoot": "0x0202020202020202020202020202020202020202020202020202020202020202",
"blockHash": "0x0303030303030303030303030303030303030303030303030303030303030303"
});

let json_str = serde_json::to_string(&json_obj).unwrap();
let output: OutputV0 = serde_json::from_str(&json_str).unwrap();

assert_eq!(output.state_root, B256::from([1u8; 32]));
assert_eq!(output.message_passer_storage_root, B256::from([2u8; 32]));
assert_eq!(output.block_hash, B256::from([3u8; 32]));
}
}
6 changes: 3 additions & 3 deletions tests/devnets/simple-supervisor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ optimism_package:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101511.0
cl:
type: op-node
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.13.5
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:develop
log_level: debug
extra_params: [--experimental.sequencer-api=true]
network_params:
Expand All @@ -35,7 +35,7 @@ optimism_package:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101511.0
cl:
type: op-node
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.13.5
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:develop
log_level: debug
extra_params: [--experimental.sequencer-api=true]
network_params:
Expand All @@ -62,7 +62,7 @@ optimism_package:
image: kona-supervisor:local
superchain: superchain
extra_env_vars:
RUST_LOG: "supervisor=info"
RUST_LOG: "supervisor=info,supervisor::chain_processor=trace"
test-sequencers:
sequencer:
enabled: true
Expand Down