Conversation
src/HashingLogic.test.ts
Outdated
'0x5c836525f55b64ede01a232fafde74afa7a8a82b47ecfe599294317971b2f4b5', | ||
} | ||
|
||
test('HashingLogic matches', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also a test with an array of more than 1 attestation type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
src/HashingLogic.ts
Outdated
|
||
export const hashAttestations = (attestations: IAttestationData[]) => { | ||
const individualAttestationHashes = attestations.map(a => | ||
soliditySha3({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
choosing soliditySha3 wasn't a fully educated decision. I just used it because it was available. is there an argument for using a different one? if not, this is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do any research into using a different one. I guess I just figured no reason to change it at this time. My goal here was to move duplicate hashing logic and types to this middleman library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, keeping it consistent makes sense
value: string | ||
} | ||
|
||
export const getAttestationAgreement = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what gets passed to signTypedData right? This will change when we use the merged EIP712 spec. Fine for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on how?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or point me in a direction where I can educate myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getFormattedSignTypedDataLegacy vs not legacy in the signingLogic.ts file in bloom-web. Will chat on slack
we'll also want to add all those sub-types like 'full-name', 'birth-date', 'gender' once everyone approves of the spec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Reminder for future reference that the EIP712 version of getAttestationAgreement will need to be finalized once metamask is ready
Changing back to soliditySha3
Adds a HashingLogic export, which can be used to perform attestation hashes between bloom-web and attestation-kit. Also includes merkletree support.