From e503220bdf7e2a3652323c91d53be8337cc8bcbd Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 3 Nov 2023 14:22:49 +0200 Subject: [PATCH] fix: gnosis tx status --- package.json | 2 +- src/web3/adapters/GnosisAdapter.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2aeb834..80b3f76 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@bgd-labs/frontend-web3-utils", "description": "Frontend utilities common to multiple Web3 projects", - "version": "0.4.23", + "version": "0.4.24", "author": "BGD labs", "license": "MIT", "private": false, diff --git a/src/web3/adapters/GnosisAdapter.ts b/src/web3/adapters/GnosisAdapter.ts index 42483df..f48972a 100644 --- a/src/web3/adapters/GnosisAdapter.ts +++ b/src/web3/adapters/GnosisAdapter.ts @@ -24,6 +24,7 @@ export type GnosisTxStatusResponse = { submissionDate: string | null; modified: string; nonce: number; + trusted: boolean; }; export class GnosisAdapter implements AdapterInterface { @@ -136,13 +137,13 @@ export class GnosisAdapter implements AdapterInterface { produce(state, (draft) => { const tx = draft.transactionsPool[txKey] as PoolEthTx; - if (statusResponse.isExecuted) { + if (statusResponse.isExecuted || !statusResponse.trusted) { tx.status = statusResponse.isSuccessful ? TransactionStatus.Success : TransactionStatus.Reverted; } - tx.pending = !statusResponse.isExecuted; + tx.pending = !statusResponse.isExecuted && statusResponse.trusted; tx.nonce = statusResponse.nonce; }), );