Skip to content

Commit

Permalink
🔍 Inspect CI Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Roaring30s committed Dec 11, 2023
1 parent 74e156d commit 8dde212
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
9 changes: 9 additions & 0 deletions crates/exm/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@
testDelKv() {
return this.kv;
}
async sha256(buffer) {
return subtle.digest('SHA-256', buffer).then((hashBuffer) => {
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray
.map((bytes) => bytes.toString(16).padStart(2, '0'))
.join('');
return hashHex;
});
}
}

const ExmSymbol = Symbol('exm');
Expand Down
4 changes: 2 additions & 2 deletions crates/smartweave/smartweave.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,12 @@
async toSHA256(input) {
const encoder = new TextEncoder();
const data = encoder.encode(input);
const hashBuffer = await SmartWeave.arweave.crypto.hash(data);
const hashBuffer = await globalThis.SmartWeave.arweave.crypto.hash(data);
const hashArray = Array.from(hashBuffer);
const hashHex = hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');

return hashHex;

}
}
}
Expand Down
5 changes: 2 additions & 3 deletions js/napi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ mod tests {

let contract_result = contract.state;
let str_state = contract_result.to_string();
//println!("STATUS::::: {:#?}", str_state.contains("wearemintingyes"));
assert!(str_state.contains("wearemintingyes"));

}
Expand Down Expand Up @@ -791,9 +792,7 @@ mod tests {

let contract = simulate_contract(execution_context).await.unwrap();
const hello_hash: &str = "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824";
println!("{:#?}", contract.state);
println!("{:#?}", contract.state[0]);
//assert_eq!(contract.state[0], hello_hash);
assert_eq!(contract.state[0], hello_hash);
}

#[tokio::test]
Expand Down

0 comments on commit 8dde212

Please sign in to comment.