mirror of
https://github.com/tlsnotary/tlsn-js.git
synced 2026-01-08 04:03:53 -05:00
testing
This commit is contained in:
@@ -21,11 +21,11 @@ function App(): ReactElement {
|
||||
|
||||
const onClick = useCallback(async () => {
|
||||
setProcessing(true);
|
||||
// set_log_level_filter("debug");
|
||||
await set_log_level_filter("info");
|
||||
const p = await prove('https://swapi.dev/api/people/1', {
|
||||
method: 'GET',
|
||||
maxTranscriptSize: 16384,
|
||||
notaryUrl: 'https://notary.pse.dev/v0.1.0-alpha.5',
|
||||
notaryUrl: 'http://localhost:7047',
|
||||
websocketProxyUrl: 'wss://notary.pse.dev/proxy?token=swapi.dev',
|
||||
});
|
||||
setProof(p);
|
||||
@@ -34,6 +34,7 @@ function App(): ReactElement {
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
if (proof) {
|
||||
await set_log_level_filter("trace");
|
||||
const r = await verify(proof);
|
||||
setResult(r);
|
||||
setProcessing(false);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-loader-spinner": "^6.1.6",
|
||||
"tlsn-js": "../../tlsn-js-dev"
|
||||
"tlsn-js": "../../"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.0.26",
|
||||
|
||||
@@ -26,9 +26,8 @@ export default class TLSN {
|
||||
// 6422528 ~= 6.12 mb
|
||||
// console.log('!@# res.memory.buffer.length=', res.memory.buffer.byteLength);
|
||||
await initThreadPool(numConcurrency);
|
||||
await set_log_level_filter("trace");
|
||||
this.resolveStart();
|
||||
|
||||
await set_log_level_filter("info");
|
||||
}
|
||||
|
||||
async waitForStart() {
|
||||
@@ -36,7 +35,8 @@ export default class TLSN {
|
||||
}
|
||||
|
||||
async set_log_level_filter(level: string) {
|
||||
await set_log_level_filter(level);
|
||||
// await this.waitForStart();
|
||||
|
||||
}
|
||||
|
||||
async prove(
|
||||
|
||||
@@ -61,6 +61,8 @@ pub fn setup_tracing_web() {
|
||||
SUBSCRIBER
|
||||
.set(Mutex::new(handle))
|
||||
.expect("Failed to set subscriber handle");
|
||||
|
||||
info!("🪵 Initialized logging 🪵");
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
|
||||
@@ -9,6 +9,7 @@ use tlsn_core::proof::{SessionProof, TlsProof};
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub async fn verify(proof: &str, notary_pubkey_str: &str) -> Result<String, JsValue> {
|
||||
trace!("test test test");
|
||||
let proof: TlsProof = serde_json::from_str(proof)
|
||||
.map_err(|e| JsValue::from_str(&format!("Could not deserialize proof: {:?}", e)))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user