Skip to content

Commit

Permalink
Merge pull request #12215 from smartcontractkit/jtw/step-3-01-non-per…
Browse files Browse the repository at this point in the history
…sistent

TXM In-memory: step 3-01-Non-Persistent Methods
  • Loading branch information
poopoothegorilla authored May 1, 2024
2 parents e287b53 + e17ae31 commit 483637c
Show file tree
Hide file tree
Showing 4 changed files with 2,493 additions and 27 deletions.
9 changes: 9 additions & 0 deletions common/txmgr/address_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,15 @@ func (as *addressState[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) findTx
return txAttempts
}

// findTxByID returns the transaction with the given ID.
// If no transaction is found, nil is returned.
func (as *addressState[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) findTxByID(txID int64) *txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE] {
as.RLock()
defer as.RUnlock()

return as.allTxs[txID]
}

// findTxs returns all transactions that match the given filters.
// If txIDs are provided, only the transactions with those IDs are considered.
// If no txIDs are provided, all transactions are considered.
Expand Down
Loading

0 comments on commit 483637c

Please sign in to comment.