From be2dffed41c4c28621343b2d5271b52178b5ac4f Mon Sep 17 00:00:00 2001 From: sklppy88 Date: Thu, 8 Aug 2024 10:33:29 +0000 Subject: [PATCH] init --- yarn-project/pxe/src/pxe_service/pxe_service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 333f47a02ba..e5525b9c141 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -528,6 +528,13 @@ export class PXEService implements PXE { if (await this.node.getTxEffect(txHash)) { throw new Error(`A settled tx with equal hash ${txHash.toString()} exists.`); } + + const isValidTx = await this.node.validateTx(tx); + + if (!isValidTx) { + throw new Error('The simulated transaction is unable to be added to state and is invalid.'); + } + this.log.info(`Sending transaction ${txHash}`); await this.node.sendTx(tx); return txHash;