Skip to content

Commit

Permalink
Merge branch '269-fix-tx-signing-status' into 'dev'
Browse files Browse the repository at this point in the history
add signing status got isTxValid

Closes #269

See merge request ergo/rosen-bridge/ts-guard-service!214
  • Loading branch information
vorujack committed Jul 31, 2023
2 parents 272171e + a7621e7 commit 03e68e5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 43 deletions.
62 changes: 31 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
"@rosen-bridge/tokens": "^0.1.12",
"@rosen-bridge/tss": "^1.0.0",
"@rosen-bridge/watcher-data-extractor": "^1.1.4",
"@rosen-chains/abstract-chain": "^0.1.11",
"@rosen-chains/cardano": "^0.1.11",
"@rosen-chains/cardano-koios-network": "^0.1.8",
"@rosen-chains/ergo": "^0.1.16",
"@rosen-chains/ergo-explorer-network": "^0.1.11",
"@rosen-chains/ergo-node-network": "^0.1.13",
"@rosen-chains/abstract-chain": "^0.1.12",
"@rosen-chains/cardano": "^0.1.12",
"@rosen-chains/cardano-koios-network": "^0.1.9",
"@rosen-chains/ergo": "^0.1.17",
"@rosen-chains/ergo-explorer-network": "^0.1.12",
"@rosen-chains/ergo-node-network": "^0.1.14",
"@sinclair/typebox": "^0.28.15",
"await-semaphore": "^0.1.3",
"axios": "^0.27.2",
Expand Down
13 changes: 7 additions & 6 deletions src/transaction/TransactionProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import {
PaymentTransaction,
TransactionTypes,
} from '@rosen-chains/abstract-chain';
import { SigningStatus } from '@rosen-chains/abstract-chain/lib/types';
import { ERGO_CHAIN } from '@rosen-chains/ergo';
import Configs from '../configs/Configs';
import { DatabaseAction } from '../db/DatabaseAction';
import { TransactionEntity } from '../db/entities/TransactionEntity';
import ChainHandler from '../handlers/ChainHandler';
import GuardPkHandler from '../handlers/GuardPkHandler';
import { loggerFactory } from '../log/Logger';
import { EventStatus, TransactionStatus } from '../utils/constants';
import Configs from '../configs/Configs';
import TransactionSerializer from './TransactionSerializer';
import { ERGO_CHAIN } from '@rosen-chains/ergo';
import GuardPkHandler from '../handlers/GuardPkHandler';
import { DatabaseAction } from '../db/DatabaseAction';

const logger = loggerFactory(import.meta.url);

Expand Down Expand Up @@ -159,7 +160,7 @@ class TransactionProcessor {
} else {
// tx is not found, checking if tx is still valid
const paymentTx = TransactionSerializer.fromJson(tx.txJson);
if (await chain.isTxValid(paymentTx)) {
if (await chain.isTxValid(paymentTx, SigningStatus.UnSigned)) {
// tx is valid, requesting to sign...
logger.info(`Tx [${tx.txId}] is still valid. Requesting to sign tx...`);
await this.processApprovedTx(tx);
Expand Down Expand Up @@ -247,7 +248,7 @@ class TransactionProcessor {
} else {
// tx is not in mempool, checking if tx is still valid
const paymentTx = TransactionSerializer.fromJson(tx.txJson);
if (await chain.isTxValid(paymentTx)) {
if (await chain.isTxValid(paymentTx, SigningStatus.Signed)) {
// tx is valid. resending...
logger.info(`Tx [${tx.txId}] is still valid. Resending tx...`);
await chain.submitTransaction(paymentTx);
Expand Down

0 comments on commit 03e68e5

Please sign in to comment.