Skip to content

Commit 97f5c06

Browse files
feat: add borsh serialization and expand deployment configuration
1 parent 0730457 commit 97f5c06

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ license = "WTFPL"
66
publish = false
77

88
[dependencies]
9+
borsh = "0.9"
910
clap = "2.33.3"
1011
lazy_static = "1.4.0"
1112
serde = { version = "1.0.125", features = ["derive"] }

src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
729729

730730
#[cfg(test)]
731731
mod test {
732+
use solana_sdk::borsh::try_from_slice_unchecked;
732733
use borsh::{BorshDeserialize, BorshSerialize};
733734
use solana_sdk::pubkey::Pubkey;
734735

735-
use {super::*, solana_test_validator::*};
736-
737736
#[test]
738737
fn test_borsh() {
739738
#[repr(C)]
@@ -754,4 +753,4 @@ mod test {
754753
// Assert that the deserialized data matches the original
755754
assert_eq!(faux, in_faux);
756755
}
757-
}
756+
}

src/utils/ssh_deploy/tests/e2e.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ mod tests {
262262
node_name: "sonic-rpc".to_string(),
263263
rpc_url: None,
264264
additional_params: HashMap::new(),
265+
version: None,
266+
client_type: None,
267+
hot_swap_enabled: false,
268+
metrics_config: None,
269+
disk_config: None,
265270
};
266271

267272
// Deploy Sonic RPC node
@@ -295,4 +300,4 @@ mod tests {
295300

296301
Ok(())
297302
}
298-
}
303+
}

src/utils/ssh_deploy/tests/unit.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ mod tests {
191191
node_name: "test-node".to_string(),
192192
rpc_url: None,
193193
additional_params: HashMap::new(),
194+
version: None,
195+
client_type: None,
196+
hot_swap_enabled: false,
197+
metrics_config: None,
198+
disk_config: None,
194199
};
195200

196201
// Test valid system requirements
@@ -239,4 +244,4 @@ mod tests {
239244
assert!(service_content.contains("--arg1 value1"));
240245
assert!(service_content.contains("--arg2 value2"));
241246
}
242-
}
247+
}

src/utils/ssh_deploy/validators.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn validate_system_requirements(
4141
///
4242
/// # Returns
4343
/// * `Result<(u8, u16, u16), DeploymentError>` - Required CPU, memory, and disk
44-
fn get_required_resources(
44+
pub fn get_required_resources(
4545
svm_type: &str,
4646
node_type: &str,
4747
) -> Result<(u8, u16, u16), DeploymentError> {
@@ -69,7 +69,7 @@ fn get_required_resources(
6969
///
7070
/// # Returns
7171
/// * `Result<(), DeploymentError>` - Success/failure
72-
fn validate_cpu_cores(
72+
pub fn validate_cpu_cores(
7373
system_info: &HashMap<String, String>,
7474
required_cpu: u8,
7575
) -> Result<(), DeploymentError> {
@@ -96,7 +96,7 @@ fn validate_cpu_cores(
9696
///
9797
/// # Returns
9898
/// * `Result<(), DeploymentError>` - Success/failure
99-
fn validate_memory(
99+
pub fn validate_memory(
100100
system_info: &HashMap<String, String>,
101101
required_memory: u16,
102102
) -> Result<(), DeploymentError> {
@@ -123,7 +123,7 @@ fn validate_memory(
123123
///
124124
/// # Returns
125125
/// * `Result<(), DeploymentError>` - Success/failure
126-
fn validate_disk_space(
126+
pub fn validate_disk_space(
127127
system_info: &HashMap<String, String>,
128128
required_disk: u16,
129129
) -> Result<(), DeploymentError> {
@@ -152,4 +152,4 @@ fn validate_disk_space(
152152
}
153153

154154
Ok(())
155-
}
155+
}

0 commit comments

Comments
 (0)