Restart pusher on balance issues (#1125)

* Restart pusher on balance issues

* Bump
This commit is contained in:
Amin Moghaddam 2023-10-31 08:39:22 +01:00 committed by GitHub
parent d07579e0a6
commit d4fad5049c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

2
package-lock.json generated
View File

@ -54807,7 +54807,7 @@
},
"price_pusher": {
"name": "@pythnetwork/price-pusher",
"version": "5.7.0",
"version": "5.7.1",
"license": "Apache-2.0",
"dependencies": {
"@injectivelabs/sdk-ts": "1.10.72",

View File

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

View File

@ -299,10 +299,12 @@ export class SuiPricePusher implements IPricePusher {
);
} catch (e: any) {
console.log("Error when signAndExecuteTransactionBlock");
if (String(e).includes("GasBalanceTooLow")) {
console.warn(
`The balance of gas object ${gasObject.objectId} is too low. Removing from pool.`
);
if (
String(e).includes("Balance of gas object") ||
String(e).includes("GasBalanceTooLow")
) {
// If the error is caused by insufficient gas, we should panic
throw e;
} else {
// Refresh the coin object here in case the error is caused by an object version mismatch.
nextGasObject = await SuiPricePusher.tryRefreshObjectReference(