Skip to content

Commit 7a9b5d4

Browse files
authored
Merge branch 'master' into geyser_txn_accounts_data
2 parents 13ef9f8 + df2c93b commit 7a9b5d4

File tree

6 files changed

+53
-19
lines changed

6 files changed

+53
-19
lines changed

ci/buildkite-pipeline-in-disk.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ all_test_steps() {
187187
- command: "ci/test-stable-sbf.sh"
188188
name: "stable-sbf"
189189
timeout_in_minutes: 35
190-
artifact_paths: "sbf-dumps.tar.bz2"
191190
agents:
192191
queue: "gcp"
193192
EOF

ci/buildkite-pipeline.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ all_test_steps() {
226226
- command: "ci/docker-run-default-image.sh ci/test-stable-sbf.sh"
227227
name: "stable-sbf"
228228
timeout_in_minutes: 35
229-
artifact_paths: "sbf-dumps.tar.bz2"
230229
agents:
231230
queue: "solana"
232231
EOF

ci/buildkite-solana-private.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ all_test_steps() {
171171
- command: "ci/docker-run-default-image.sh ci/test-stable-sbf.sh"
172172
name: "stable-sbf"
173173
timeout_in_minutes: 35
174-
artifact_paths: "sbf-dumps.tar.bz2"
175174
agents:
176175
queue: "default"
177176
EOF

ci/test-stable.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,6 @@ test-stable-sbf)
5858
# SBF program tests
5959
_ make -C programs/sbf test-v0
6060

61-
# SBF program instruction count assertion
62-
sbf_target_path=programs/sbf/target
63-
_ cargo test \
64-
--manifest-path programs/sbf/Cargo.toml \
65-
--features=sbf_c,sbf_rust assert_instruction_count \
66-
-- --nocapture &> $sbf_target_path/deploy/instruction_counts.txt
67-
68-
sbf_dump_archive="sbf-dumps.tar.bz2"
69-
rm -f "$sbf_dump_archive"
70-
tar cjvf "$sbf_dump_archive" $sbf_target_path/deploy/{*.txt,*.so}
7161
exit 0
7262
;;
7363
test-docs)

validator/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
7777
.subcommand(commands::plugin::command(default_args))
7878
.subcommand(commands::set_identity::command(default_args))
7979
.subcommand(commands::set_log_filter::command())
80-
.subcommand(commands::staked_nodes_overrides::command(default_args))
80+
.subcommand(commands::staked_nodes_overrides::command())
8181
.subcommand(commands::wait_for_restart_window::command())
8282
.subcommand(commands::set_public_address::command());
8383

validator/src/commands/staked_nodes_overrides/mod.rs

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
use {
2-
crate::{admin_rpc_service, cli::DefaultArgs},
2+
crate::{admin_rpc_service, commands::FromClapArgMatches},
33
clap::{App, Arg, ArgMatches, SubCommand},
44
std::path::Path,
55
};
66

7-
pub fn command(_default_args: &DefaultArgs) -> App<'_, '_> {
8-
SubCommand::with_name("staked-nodes-overrides")
7+
const COMMAND: &str = "staked-nodes-overrides";
8+
9+
#[derive(Debug, PartialEq)]
10+
pub struct StakedNodesOverridesArgs {
11+
pub path: String,
12+
}
13+
14+
impl FromClapArgMatches for StakedNodesOverridesArgs {
15+
fn from_clap_arg_match(matches: &ArgMatches) -> Result<Self, String> {
16+
Ok(StakedNodesOverridesArgs {
17+
path: matches
18+
.value_of("path")
19+
.expect("path is required")
20+
.to_string(),
21+
})
22+
}
23+
}
24+
25+
pub fn command<'a>() -> App<'a, 'a> {
26+
SubCommand::with_name(COMMAND)
927
.about("Overrides stakes of specific node identities.")
1028
.arg(
1129
Arg::with_name("path")
@@ -22,15 +40,44 @@ pub fn command(_default_args: &DefaultArgs) -> App<'_, '_> {
2240
}
2341

2442
pub fn execute(matches: &ArgMatches, ledger_path: &Path) -> Result<(), String> {
25-
let path = matches.value_of("path").expect("path is required");
43+
let staked_nodes_overrides_args = StakedNodesOverridesArgs::from_clap_arg_match(matches)?;
2644

2745
let admin_client = admin_rpc_service::connect(ledger_path);
2846
admin_rpc_service::runtime()
2947
.block_on(async move {
3048
admin_client
3149
.await?
32-
.set_staked_nodes_overrides(path.to_string())
50+
.set_staked_nodes_overrides(staked_nodes_overrides_args.path)
3351
.await
3452
})
3553
.map_err(|err| format!("set staked nodes override request failed: {err}"))
3654
}
55+
56+
#[cfg(test)]
57+
mod tests {
58+
use {
59+
super::*,
60+
crate::commands::tests::{
61+
verify_args_struct_by_command, verify_args_struct_by_command_is_error,
62+
},
63+
};
64+
65+
#[test]
66+
fn verify_args_struct_by_command_staked_nodes_overrides_default() {
67+
verify_args_struct_by_command_is_error::<StakedNodesOverridesArgs>(
68+
command(),
69+
vec![COMMAND],
70+
);
71+
}
72+
73+
#[test]
74+
fn verify_args_struct_by_command_staked_nodes_overrides_path() {
75+
verify_args_struct_by_command(
76+
command(),
77+
vec![COMMAND, "test.json"],
78+
StakedNodesOverridesArgs {
79+
path: "test.json".to_string(),
80+
},
81+
);
82+
}
83+
}

0 commit comments

Comments
 (0)