Skip to content

Commit 28d60bd

Browse files
committed
add verify_from_image
1 parent b252474 commit 28d60bd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/main.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,3 +1128,26 @@ fn test_local_example() -> anyhow::Result<()> {
11281128
assert_eq!(hash, EXPECTED_HASH, "Program hash {} does not match expected value {}", hash, EXPECTED_HASH);
11291129
Ok(())
11301130
}
1131+
1132+
1133+
#[test]
1134+
fn test_verify_from_image() -> anyhow::Result<()> {
1135+
let args: Vec<&str> = "verify-from-image -e examples/hello_world/target/deploy/hello_world.so -i ellipsislabs/hello_world_verifiable_build:latest -p 2ZrriTQSVekoj414Ynysd48jyn4AX6ZF4TTJRqHfbJfn".split(" ").collect();
1136+
let child = std::process::Command::new("./target/debug/solana-verify")
1137+
.args(args)
1138+
.stdin(Stdio::piped())
1139+
.stdout(Stdio::piped())
1140+
.stderr(Stdio::piped())
1141+
.spawn()
1142+
.context("Failed to execute solana-verify command")?;
1143+
1144+
let output = child
1145+
.wait_with_output()
1146+
.context("Failed to wait for solana-verify command")?;
1147+
1148+
if !output.status.success() {
1149+
let error = String::from_utf8_lossy(&output.stderr);
1150+
anyhow::bail!("Command failed: {}", error);
1151+
}
1152+
Ok(())
1153+
}

0 commit comments

Comments
 (0)