From 951d458b39e170f2aef63f92339414e57668d2ab Mon Sep 17 00:00:00 2001 From: Peterjah Date: Wed, 13 Nov 2024 13:10:52 +0100 Subject: [PATCH] fix operation not found --- src/client/publicAPI.ts | 8 +++++++- src/smartContracts/smartContract.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/publicAPI.ts b/src/client/publicAPI.ts index edc776d4..c77789ce 100644 --- a/src/client/publicAPI.ts +++ b/src/client/publicAPI.ts @@ -217,13 +217,19 @@ export class PublicAPI { return this.connector.get_operations(operationIds) } - async getOperation(operationId: string): Promise { + async getOperation( + operationId: string + ): Promise { return this.getOperations([operationId]).then((r) => r[0]) } async getOperationStatus(operationId: string): Promise { const op = await this.getOperation(operationId) + if (!op) { + return OperationStatus.NotFound + } + if (op.op_exec_status === null) { if (op.is_operation_final === null) { return OperationStatus.NotFound diff --git a/src/smartContracts/smartContract.ts b/src/smartContracts/smartContract.ts index 9ce4f101..b4750748 100644 --- a/src/smartContracts/smartContract.ts +++ b/src/smartContracts/smartContract.ts @@ -62,7 +62,7 @@ export class SmartContract { } /** - * Executes a smart contract read operation + * Deploy a SmartContract byteCode * @param provider - Web3 provider. * @param byteCode - Compiled SmartContract bytecode. * @param constructorArgs - Parameter for call of constructor function.