Skip to content

Commit e8c4bca

Browse files
authored
update jortestkit (#3904)
1 parent 25e2fbb commit e8c4bca

File tree

17 files changed

+56
-33
lines changed

17 files changed

+56
-33
lines changed

Cargo.lock

Lines changed: 16 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testing/jormungandr-automation/src/jcli/api/certificate.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use assert_cmd::assert::OutputAssertExt;
33
use assert_fs::{prelude::*, NamedTempFile};
44
use chain_impl_mockchain::vote::Choice;
55
use jormungandr_lib::interfaces::TaxType;
6-
use jortestkit::file;
7-
use jortestkit::process::output_extensions::ProcessOutput;
6+
use jortestkit::{file, process::output_extensions::ProcessOutput};
87
use std::path::Path;
98

109
#[derive(Debug)]
@@ -156,7 +155,7 @@ impl Certificate {
156155
.as_single_line()
157156
}
158157

159-
pub fn stake_pool_id<P: AsRef<Path>>(self, input_file: P) -> String {
158+
pub fn stake_pool_id<P: AsRef<Path>>(self, input_file: P) -> Result<String, std::io::Error> {
160159
println!("Running get stake pool id...");
161160
let temp_file = NamedTempFile::new("stake_pool.id").unwrap();
162161
self.command
@@ -168,7 +167,7 @@ impl Certificate {
168167
file::read_file(temp_file.path())
169168
}
170169

171-
pub fn vote_plan_id<S: Into<String>>(self, cert: S) -> String {
170+
pub fn vote_plan_id<S: Into<String>>(self, cert: S) -> Result<String, std::io::Error> {
172171
println!("Running get stake pool id...");
173172
let input_file = NamedTempFile::new("cert_file").unwrap();
174173
input_file.write_str(&cert.into()).unwrap();

testing/jormungandr-automation/src/jcli/api/votes/committee/communication_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl CommunicationKey {
2424
}
2525

2626
#[allow(clippy::wrong_self_convention)]
27-
pub fn to_public(self, input: String) -> String {
27+
pub fn to_public(self, input: String) -> Result<String, std::io::Error> {
2828
let input_file = NamedTempFile::new("input.tmp").unwrap();
2929
input_file.write_str(&input).unwrap();
3030
let output_file = NamedTempFile::new("output.tmp").unwrap();

testing/jormungandr-automation/src/jcli/api/votes/committee/member_key.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ impl MemberKey {
1616
}
1717

1818
#[allow(clippy::wrong_self_convention)]
19-
pub fn to_public<S: Into<String>>(self, member_secret_key: S) -> String {
19+
pub fn to_public<S: Into<String>>(
20+
self,
21+
member_secret_key: S,
22+
) -> Result<String, std::io::Error> {
2023
let input_file = NamedTempFile::new("member_key.tmp").unwrap();
2124
input_file.write_str(&member_secret_key.into()).unwrap();
2225

testing/jormungandr-automation/src/jcli/api/votes/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ impl Votes {
2929
Crs::new(self.votes_command.crs())
3030
}
3131

32-
pub fn election_public_key<S: Into<String>>(self, member_key: S) -> String {
32+
pub fn election_public_key<S: Into<String>>(
33+
self,
34+
member_key: S,
35+
) -> Result<String, std::io::Error> {
3336
let output_file = NamedTempFile::new("election_public_key.tmp").unwrap();
3437
self.votes_command
3538
.election_public_key(member_key, output_file.path())

testing/jormungandr-automation/src/jcli/services/certificate_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl CertificateBuilder {
2424
stake_pool_id: &str,
2525
stake_key_pub: &str,
2626
stake_key_file: &Path,
27-
) -> String {
27+
) -> Result<String, std::io::Error> {
2828
let temp_dir = TempDir::new().unwrap();
2929

3030
let stake_delegation_cert = self

testing/jormungandr-automation/src/jormungandr/explorer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ pub fn compare_schema<P: AsRef<Path>>(actual_schema_path: P) {
299299
PathBuf::from_str("./jormungandr-automation/resources/explorer/graphql/schema.graphql")
300300
.unwrap();
301301

302-
if !file::have_the_same_content(actual_schema_path.as_ref(), &expected_schema_path) {
303-
file::copy_file(actual_schema_path.as_ref(), &expected_schema_path, true);
302+
if !file::have_the_same_content(actual_schema_path.as_ref(), &expected_schema_path).unwrap() {
303+
file::copy_file(actual_schema_path.as_ref(), &expected_schema_path, true).unwrap();
304304
println!("discrepancies detected, already replaced file with new content. Please commit to update schema");
305305
}
306306
}

testing/jormungandr-automation/src/jormungandr/legacy/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ pub fn get_jormungandr_bin(release: &Release, temp_dir: &impl PathChild) -> Path
5252
let release_dir = temp_dir.child(format!("release-{}", release.version()));
5353
release_dir.create_dir_all().unwrap();
5454
decompress(output.path(), release_dir.path()).unwrap();
55-
file::find_file(release_dir.path(), "jormungandr").unwrap()
55+
file::find_file(release_dir.path(), "jormungandr")
56+
.unwrap()
57+
.unwrap()
5658
}

testing/jormungandr-automation/src/jormungandr/remote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl RemoteJormungandrBuilder {
211211

212212
pub fn with_node_config(mut self, node_config: PathBuf) -> Self {
213213
self.node_config =
214-
Some(serde_yaml::from_str(&jortestkit::file::read_file(node_config)).unwrap());
214+
Some(serde_yaml::from_str(&jortestkit::file::read_file(node_config).unwrap()).unwrap());
215215
self
216216
}
217217

testing/jormungandr-integration-tests/src/jcli/certificate/e2e.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn test_create_and_sign_new_stake_delegation() {
2525

2626
let input_file = temp_dir.child("certificate");
2727
input_file.write_str(&certificate).unwrap();
28-
let stake_pool_id = jcli.certificate().stake_pool_id(input_file.path());
28+
let stake_pool_id = jcli.certificate().stake_pool_id(input_file.path()).unwrap();
2929
let certificate = jcli
3030
.certificate()
3131
.new_stake_delegation(&stake_pool_id, &owner.identifier().to_bech32_str());

0 commit comments

Comments
 (0)