[price_pusher] fix bug from last PR (#916)

This commit is contained in:
Jayant Krishnamurthy 2023-06-23 10:33:30 -07:00 committed by GitHub
parent dfc2df779c
commit e4d494db9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@pythnetwork/price-pusher",
"version": "5.4.0",
"version": "5.4.1",
"description": "Pyth Price Pusher",
"homepage": "https://pyth.network",
"main": "lib/index.js",

View File

@ -6,6 +6,7 @@ import { PythPriceListener } from "../pyth-price-listener";
import { Controller } from "../controller";
import { Options } from "yargs";
import { SuiPriceListener, SuiPricePusher } from "./sui";
import { Ed25519Keypair } from "@mysten/sui.js";
export default {
command: "sui",
@ -105,6 +106,13 @@ export default {
}
);
const mnemonic = fs.readFileSync(mnemonicFile, "utf-8").trim();
console.log(
`Pushing updates from wallet address: ${Ed25519Keypair.deriveKeypair(
mnemonic
)
.getPublicKey()
.toSuiAddress()}`
);
const priceItems = priceConfigs.map(({ id, alias }) => ({ id, alias }));

View File

@ -144,7 +144,7 @@ export class SuiPricePusher implements IPricePusher {
const txs = [];
let currentBatchVaas = [];
let currentBatchPriceFeedIds = [];
for (const [vaa, priceFeedIds] of Object.entries(vaaToPriceFeedIds)) {
for (const [vaa, priceFeedIds] of vaaToPriceFeedIds.entries()) {
currentBatchVaas.push(vaa);
currentBatchPriceFeedIds.push(...priceFeedIds);
if (currentBatchVaas.length >= this.maxVaasPerPtb) {