Skip to content

Commit

Permalink
fix(ProofcastEventAttestator.spec.js): rm 0x from event_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmp01 committed Nov 4, 2024
1 parent cacf93a commit 6ffaf0f
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ describe('Proofcast Event Attestator Tests', () => {

// We are going to extract this = require( the a subfield of the)
// official data
const data =
'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746b6e2e746f6b656e00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000008a88f6dc465640000000000000000000000000000000000000000000000000000000000075736572000000000000000000000000000000000000000000000000000000000000002a307836386262656436613437313934656666316366353134623530656139313839353539376663393165'
const data = {
event_bytes:
'00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000746b6e2e746f6b656e00000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000008a88f6dc465640000000000000000000000000000000000000000000000000000000000075736572000000000000000000000000000000000000000000000000000000000000002a307836386262656436613437313934656666316366353134623530656139313839353539376663393165',
}

const hexData = `0x${Buffer.from(JSON.stringify(data)).toString('hex')}`

const ea = new ProofcastEventAttestator({
version: Versions.V1,
Expand All @@ -69,11 +73,11 @@ describe('Proofcast Event Attestator Tests', () => {
transactionHash,
account,
action,
data,
data: hexData,
}

const expectedSignature =
'0x1cfc81a6dc16147e5d82d3b9c2fef1ef2125403b92f328439da20ddd5903aef1276adefaeaca2579a342b00149c6916f93d988f81514ab535ebf19dd4eebed3519'
'0x1b546cb297b24aab5b445756f1d0beece3dad851d2cbd8d973f89f69e83f82b77016c87be815fa95bf25d37fb10c3f884cb200d38495e2d1c1bb686e9de38842a5'

expect(ea.formatEosSignature(ea.sign(event))).toStrictEqual(
expectedSignature,
Expand Down

0 comments on commit 6ffaf0f

Please sign in to comment.