Skip to content

Commit

Permalink
add test for passing wasm-hash to read
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaineHeffron committed Jun 12, 2024
1 parent 2eff681 commit fa62f4f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/crates/soroban-test/tests/it/integration/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,18 @@ fn contract_data_read_failure(sandbox: &TestEnv, id: &str) {
);
}

fn contract_data_read_hash(sandbox: &TestEnv, hash: &str) {
sandbox
.new_assert_cmd("contract")
.arg("read")
.arg("--wasm-hash")
.arg(hash)
.arg("--durability=persistent")
.assert()
.success()
.stdout(predicates::str::starts_with("\"\"\""));
}

#[tokio::test]
async fn contract_data_read() {
const KEY: &str = "COUNTER";
Expand Down Expand Up @@ -293,6 +305,9 @@ async fn contract_data_read() {
.assert()
.success()
.stdout(predicates::str::starts_with("COUNTER,2"));
let hello_world_hash = HELLO_WORLD.hash().expect("Failed to hash HELLO_WORLD");
let hello_world_hash_hex = hello_world_hash.to_string();
contract_data_read_hash(sandbox, &hello_world_hash_hex);
}

#[tokio::test]
Expand Down

0 comments on commit fa62f4f

Please sign in to comment.