Skip to content

Commit

Permalink
fix: read more bytes to determine version
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Sep 21, 2023
1 parent dbd88d6 commit 2837e66
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/javascript/crypto/src/eas/EasTicketAttestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,8 @@ export class EasTicketAttestation extends AttestableObject implements Attestable

// console.log("ABI Encoded bytes: ", "0x" + uint8tohex(new Uint8Array(asnEmbedded.easAttestation)));

const firstElem = defaultAbiCoder.decode(['uint16'], parts.attestation);
const version = firstElem[0] > 50 ? 0 : 1;

console.log(version);
const firstElem = defaultAbiCoder.decode(['uint256'], parts.attestation);
const version = firstElem[0] > 50n ? 0 : 1;

const abiDecoded = defaultAbiCoder.decode(
OFFCHAIN_ATTESTATION_TYPES[version].types.map((field) => field.type),
Expand Down

0 comments on commit 2837e66

Please sign in to comment.