Skip to content

Commit

Permalink
fix: gnosis tx status
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Nov 3, 2023
1 parent d0ddce0 commit e503220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 3 additions & 2 deletions src/web3/adapters/GnosisAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type GnosisTxStatusResponse = {
submissionDate: string | null;
modified: string;
nonce: number;
trusted: boolean;
};

export class GnosisAdapter<T extends BaseTx> implements AdapterInterface<T> {
Expand Down Expand Up @@ -136,13 +137,13 @@ export class GnosisAdapter<T extends BaseTx> implements AdapterInterface<T> {
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;
}),
);
Expand Down

0 comments on commit e503220

Please sign in to comment.