[price-service] Hotfix a serde problem (#503)
* Fix linting error * Bump patch version * Revert seqNum to number
This commit is contained in:
parent
1940a0bb2e
commit
0eac7246bd
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@pythnetwork/pyth-price-service",
|
"name": "@pythnetwork/pyth-price-service",
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pythnetwork/pyth-price-service",
|
"name": "@pythnetwork/pyth-price-service",
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certusone/wormhole-sdk": "^0.9.9",
|
"@certusone/wormhole-sdk": "^0.9.9",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@pythnetwork/pyth-price-service",
|
"name": "@pythnetwork/pyth-price-service",
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"description": "Pyth Price Service",
|
"description": "Pyth Price Service",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -42,7 +42,7 @@ function dummyPriceInfoPair(
|
||||||
priceFeed: dummyPriceFeed(id),
|
priceFeed: dummyPriceFeed(id),
|
||||||
publishTime: 0,
|
publishTime: 0,
|
||||||
attestationTime: 0,
|
attestationTime: 0,
|
||||||
seqNum: BigInt(seqNum),
|
seqNum,
|
||||||
vaa: Buffer.from(vaa, "hex"),
|
vaa: Buffer.from(vaa, "hex"),
|
||||||
emitterChainId: 0,
|
emitterChainId: 0,
|
||||||
priceServiceReceiveTime: 0,
|
priceServiceReceiveTime: 0,
|
||||||
|
|
|
@ -23,7 +23,7 @@ import { PromClient } from "./promClient";
|
||||||
|
|
||||||
export type PriceInfo = {
|
export type PriceInfo = {
|
||||||
vaa: Buffer;
|
vaa: Buffer;
|
||||||
seqNum: bigint;
|
seqNum: number;
|
||||||
publishTime: TimestampInSec;
|
publishTime: TimestampInSec;
|
||||||
attestationTime: TimestampInSec;
|
attestationTime: TimestampInSec;
|
||||||
priceFeed: PriceFeed;
|
priceFeed: PriceFeed;
|
||||||
|
@ -284,7 +284,7 @@ export class Listener implements PriceStore {
|
||||||
|
|
||||||
const priceFeed = priceAttestationToPriceFeed(priceAttestation);
|
const priceFeed = priceAttestationToPriceFeed(priceAttestation);
|
||||||
const priceInfo = {
|
const priceInfo = {
|
||||||
seqNum: parsedVaa.sequence,
|
seqNum: Number(parsedVaa.sequence),
|
||||||
vaa,
|
vaa,
|
||||||
publishTime: priceAttestation.publishTime,
|
publishTime: priceAttestation.publishTime,
|
||||||
attestationTime: priceAttestation.attestationTime,
|
attestationTime: priceAttestation.attestationTime,
|
||||||
|
|
|
@ -44,7 +44,7 @@ export class RestException extends Error {
|
||||||
function asyncWrapper(
|
function asyncWrapper(
|
||||||
callback: (req: Request, res: Response, next: NextFunction) => Promise<any>
|
callback: (req: Request, res: Response, next: NextFunction) => Promise<any>
|
||||||
) {
|
) {
|
||||||
return function (req: Request, res: Response, next: NextFunction) {
|
return (req: Request, res: Response, next: NextFunction) => {
|
||||||
callback(req, res, next).catch(next);
|
callback(req, res, next).catch(next);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ export class RestAPI {
|
||||||
|
|
||||||
// Multiple price ids might share same vaa, we use sequence number as
|
// Multiple price ids might share same vaa, we use sequence number as
|
||||||
// key of a vaa and deduplicate using a map of seqnum to vaa bytes.
|
// key of a vaa and deduplicate using a map of seqnum to vaa bytes.
|
||||||
const vaaMap = new Map<bigint, Buffer>();
|
const vaaMap = new Map<number, Buffer>();
|
||||||
|
|
||||||
const notFoundIds: string[] = [];
|
const notFoundIds: string[] = [];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue