Update the VAA hash to use payload hash (#422)
* Update the VAA hash to use payload hash * Bugfix
This commit is contained in:
parent
b1aea626e9
commit
6e279c84bb
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@pythnetwork/pyth-price-service",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pythnetwork/pyth-price-service",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@certusone/wormhole-sdk": "^0.1.4",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@pythnetwork/pyth-price-service",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"description": "Pyth Price Service",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -160,7 +160,11 @@ export class Listener implements PriceStore {
|
|||
async processVaa(vaa: Buffer) {
|
||||
const { parse_vaa } = await importCoreWasm();
|
||||
|
||||
const vaaHash: VaaHash = createHash("md5").update(vaa).digest("base64");
|
||||
const parsedVaa = parse_vaa(vaa);
|
||||
|
||||
const vaaHash: VaaHash = createHash("md5")
|
||||
.update(Buffer.from(parsedVaa.payload))
|
||||
.digest("base64");
|
||||
|
||||
if (this.observedVaas.has(vaaHash)) {
|
||||
return;
|
||||
|
@ -169,8 +173,6 @@ export class Listener implements PriceStore {
|
|||
this.observedVaas.set(vaaHash, true);
|
||||
this.promClient?.incReceivedVaa();
|
||||
|
||||
const parsedVaa = parse_vaa(vaa);
|
||||
|
||||
let batchAttestation;
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue