Closed 0xtsukino closed 1 month ago
Are you sure it is json? tsify did create an interface NotarizationOutput
automatically:
https://github.com/tlsnotary/tlsn-js/blob/cdd70e365e14bc12eec9cb5bbc68563ae5b83f34/wasm/pkg/tlsn_wasm.d.ts#L85 ?
My intention was for you to move the attestation and secrets out and serialize them separately
Are you sure it is json? tsify did create an interface
NotarizationOutput
automatically: https://github.com/tlsnotary/tlsn-js/blob/cdd70e365e14bc12eec9cb5bbc68563ae5b83f34/wasm/pkg/tlsn_wasm.d.ts#L85 ?
Yep, you can try running the react demo example in tlsn-js
alpha7 branch
My intention was for you to move the attestation and secrets out and serialize them separately
I want to serialize them separately too, but the output is a json object, and both Attestation
and Secrets
doesn't have a method that allows me to serialize them from json
for more context, i am trying to serialize them here: https://github.com/tlsnotary/tlsn-js/pull/67/files#diff-e59662795ab51f95e1bf2a44d30dd0debbc194a499adffd1bb6a197bd188d4b5R233-R236
const output = await prover.notarize(commit);
return {
attestation: output.attestation.serialize(),
secrets: output.secrets.serialize(),
};
for whatever reason, the output from notarize
didn't return Attestation
and Secrets
as expected.
I see the problem. wasm-bindgen
shenanigans again. Apparently in order to expose those fields as classes we have to clone them.
https://github.com/tlsnotary/tlsn/blob/dev/crates/wasm/src/prover/mod.rs#L138-L141
For some reason a json object is returned here instead of a serializable class