Skip to content

Commit

Permalink
Merge pull request #701 from massalabs/fix_opnotfound
Browse files Browse the repository at this point in the history
fix operation not found
  • Loading branch information
peterjah authored Nov 13, 2024
2 parents ed5cdd5 + 951d458 commit aca68fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/client/publicAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,19 @@ export class PublicAPI {
return this.connector.get_operations(operationIds)
}

async getOperation(operationId: string): Promise<t.OperationInfo> {
async getOperation(
operationId: string
): Promise<t.OperationInfo | undefined> {
return this.getOperations([operationId]).then((r) => r[0])
}

async getOperationStatus(operationId: string): Promise<OperationStatus> {
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
Expand Down
2 changes: 1 addition & 1 deletion src/smartContracts/smartContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

1 comment on commit aca68fc

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for experimental massa-web3

St.
Category Percentage Covered / Total
🟡 Statements 64.06% 1171/1828
🔴 Branches 45.67% 195/427
🔴 Functions 47.33% 213/450
🟡 Lines 64.34% 1164/1809

Test suite run success

132 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from aca68fc

Please sign in to comment.