[price_pusher] fix bug from last PR (#916)
This commit is contained in:
parent
dfc2df779c
commit
e4d494db9f
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@pythnetwork/price-pusher",
|
"name": "@pythnetwork/price-pusher",
|
||||||
"version": "5.4.0",
|
"version": "5.4.1",
|
||||||
"description": "Pyth Price Pusher",
|
"description": "Pyth Price Pusher",
|
||||||
"homepage": "https://pyth.network",
|
"homepage": "https://pyth.network",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { PythPriceListener } from "../pyth-price-listener";
|
||||||
import { Controller } from "../controller";
|
import { Controller } from "../controller";
|
||||||
import { Options } from "yargs";
|
import { Options } from "yargs";
|
||||||
import { SuiPriceListener, SuiPricePusher } from "./sui";
|
import { SuiPriceListener, SuiPricePusher } from "./sui";
|
||||||
|
import { Ed25519Keypair } from "@mysten/sui.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
command: "sui",
|
command: "sui",
|
||||||
|
@ -105,6 +106,13 @@ export default {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const mnemonic = fs.readFileSync(mnemonicFile, "utf-8").trim();
|
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 }));
|
const priceItems = priceConfigs.map(({ id, alias }) => ({ id, alias }));
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@ export class SuiPricePusher implements IPricePusher {
|
||||||
const txs = [];
|
const txs = [];
|
||||||
let currentBatchVaas = [];
|
let currentBatchVaas = [];
|
||||||
let currentBatchPriceFeedIds = [];
|
let currentBatchPriceFeedIds = [];
|
||||||
for (const [vaa, priceFeedIds] of Object.entries(vaaToPriceFeedIds)) {
|
for (const [vaa, priceFeedIds] of vaaToPriceFeedIds.entries()) {
|
||||||
currentBatchVaas.push(vaa);
|
currentBatchVaas.push(vaa);
|
||||||
currentBatchPriceFeedIds.push(...priceFeedIds);
|
currentBatchPriceFeedIds.push(...priceFeedIds);
|
||||||
if (currentBatchVaas.length >= this.maxVaasPerPtb) {
|
if (currentBatchVaas.length >= this.maxVaasPerPtb) {
|
||||||
|
|
Loading…
Reference in New Issue