Skip to content

Commit 3e9472b

Browse files
jayantkJayant Krishnamurthy
andauthored
[price service] Return VAA without prepending publish time (#577)
* [price service] Return VAA without prepending publish time * bump version --------- Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
1 parent 7f991bb commit 3e9472b

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

price_service/server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@pythnetwork/price-service-server",
3-
"version": "2.3.5",
4-
"description": "Pyth price pervice server",
3+
"version": "3.0.0",
4+
"description": "Webservice for retrieving prices from the Pyth oracle.",
55
"main": "index.js",
66
"scripts": {
77
"format": "prettier --write \"src/**/*.ts\"",

price_service/server/src/__tests__/rest.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,9 @@ describe("Get VAA endpoint and Get VAA CCIP", () => {
246246
.query({
247247
data: "0x" + id + pubTime16AsHex64Bit,
248248
});
249-
const pubTime20AsHex64Bit = "0000000000000014";
250249
expect(ccipResp.status).toBe(StatusCodes.OK);
251250
expect(ccipResp.body).toEqual({
252-
data:
253-
"0x" +
254-
pubTime20AsHex64Bit +
255-
Buffer.from("abcd20", "base64").toString("hex"),
251+
data: "0x" + Buffer.from("abcd20", "base64").toString("hex"),
256252
});
257253
});
258254

@@ -372,10 +368,7 @@ describe("Get VAA endpoint and Get VAA CCIP", () => {
372368
});
373369
expect(ccipResp.status).toBe(StatusCodes.OK);
374370
expect(ccipResp.body).toEqual({
375-
data:
376-
"0x" +
377-
pubTime5AsHex64Bit +
378-
Buffer.from(`pythnet${id}5`, "base64").toString("hex"),
371+
data: "0x" + Buffer.from(`pythnet${id}5`, "base64").toString("hex"),
379372
});
380373

381374
dbApp.close();

price_service/server/src/rest.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,7 @@ export class RestAPI {
239239
.status(StatusCodes.BAD_GATEWAY)
240240
.json({ "message:": "VAA not found." });
241241
} else {
242-
const pubTimeBuffer = Buffer.alloc(8);
243-
pubTimeBuffer.writeBigInt64BE(BigInt(vaa.publishTime));
244-
245-
const resData =
246-
"0x" +
247-
pubTimeBuffer.toString("hex") +
248-
Buffer.from(vaa.vaa, "base64").toString("hex");
242+
const resData = "0x" + Buffer.from(vaa.vaa, "base64").toString("hex");
249243

250244
res.json({
251245
data: resData,

0 commit comments

Comments
 (0)