Skip to content

Commit

Permalink
feat(jstzd): serialize rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
ryutamago committed Dec 6, 2024
1 parent 3202002 commit 2514ac2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/jstzd/src/task/jstzd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct JstzdConfig {
baker_config: OctezBakerConfig,
#[serde(rename(serialize = "octez-client"))]
octez_client_config: OctezClientConfig,
#[serde(skip_serializing)]
#[serde(rename(serialize = "octez-rollup"))]
octez_rollup_config: OctezRollupConfig,
#[serde(skip_serializing)]
jstz_node_config: JstzNodeConfig,
Expand Down
4 changes: 4 additions & 0 deletions crates/jstzd/tests/jstzd_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ async fn fetch_config_test(jstzd_config: JstzdConfig, jstzd_port: u16) {
"octez-baker",
serde_json::to_value(jstzd_config.baker_config()).unwrap(),
),
(
"octez-rollup",
serde_json::to_value(jstzd_config.octez_rollup_config()).unwrap(),
),
] {
let res =
reqwest::get(&format!("http://localhost:{}/config/{}", jstzd_port, key))
Expand Down
6 changes: 3 additions & 3 deletions crates/octez/src/async/rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::unused_port;
use super::{bootstrap::SmartRollupPvmKind, endpoint::Endpoint};
use anyhow::Result;
use http::Uri;
use serde::Deserialize;
use serde::{Deserialize, Serialize};
use std::{
path::{Path, PathBuf},
str::FromStr,
Expand All @@ -13,7 +13,7 @@ use tokio::process::{Child, Command};

const DEFAULT_BINARY_PATH: &str = "octez-smart-rollup-node";

#[derive(Clone, PartialEq, Debug, Deserialize)]
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
pub enum RollupDataDir {
/// Path to the rollup data directory. This directory
/// should contain the kernel pre image files under `wasm_2_0_0/`
Expand Down Expand Up @@ -119,7 +119,7 @@ impl OctezRollupConfigBuilder {
}
}

#[derive(Clone)]
#[derive(Clone, Serialize)]
pub struct OctezRollupConfig {
pub binary_path: PathBuf,
pub octez_client_base_dir: PathBuf,
Expand Down

0 comments on commit 2514ac2

Please sign in to comment.