Skip to content

Commit 8fba519

Browse files
authored
Skip (#1451)
1 parent bdc40fe commit 8fba519

File tree

1 file changed

+20
-9
lines changed
  • governance/xc_admin/packages/crank_pythnet_relayer/src

1 file changed

+20
-9
lines changed

governance/xc_admin/packages/crank_pythnet_relayer/src/index.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const KEYPAIR: Keypair = Keypair.fromSecretKey(
3737
Uint8Array.from(JSON.parse(fs.readFileSync(envOrErr("WALLET"), "ascii")))
3838
);
3939
const OFFSET: number = Number(process.env.OFFSET ?? "-1");
40+
const SKIP_FAILED_REMOTE_INSTRUCTIONS: boolean =
41+
process.env.SKIP_FAILED_REMOTE_INSTRUCTIONS == "true";
4042
const COMMITMENT: Commitment =
4143
(process.env.COMMITMENT as Commitment) ?? "confirmed";
4244

@@ -163,15 +165,24 @@ async function run() {
163165
}
164166
}
165167

166-
await remoteExecutor.methods
167-
.executePostedVaa()
168-
.accounts({
169-
claimRecord: claimRecordAddress,
170-
postedVaa: derivePostedVaaKey(WORMHOLE_ADDRESS[CLUSTER]!, vaa.hash),
171-
})
172-
.remainingAccounts(extraAccountMetas)
173-
.preInstructions(preInstructions)
174-
.rpc({ skipPreflight: true });
168+
try {
169+
await remoteExecutor.methods
170+
.executePostedVaa()
171+
.accounts({
172+
claimRecord: claimRecordAddress,
173+
postedVaa: derivePostedVaaKey(
174+
WORMHOLE_ADDRESS[CLUSTER]!,
175+
vaa.hash
176+
),
177+
})
178+
.remainingAccounts(extraAccountMetas)
179+
.preInstructions(preInstructions)
180+
.rpc({ skipPreflight: true });
181+
} catch (e) {
182+
if (SKIP_FAILED_REMOTE_INSTRUCTIONS) {
183+
console.error(e);
184+
} else throw e;
185+
}
175186
}
176187
} else if (response.code == 5) {
177188
console.log(`All VAAs have been relayed`);

0 commit comments

Comments
 (0)