2.5.1 Dev <- master backmerge (#1093)

* check if there as a pending transaction before marking transaction as a cancellation one

* update pkg.json
This commit is contained in:
Mikhail Mikheev 2020-07-06 19:04:31 +04:00 committed by GitHub
parent 3fdac537ec
commit 54ed00564b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "safe-react", "name": "safe-react",
"version": "2.5.0", "version": "2.5.1",
"description": "Allowing crypto users manage funds in a safer way", "description": "Allowing crypto users manage funds in a safer way",
"website": "https://github.com/gnosis/safe-react#readme", "website": "https://github.com/gnosis/safe-react#readme",
"bugs": { "bugs": {

View File

@ -79,7 +79,10 @@ export type BatchProcessTxsProps = OutgoingTxs & {
const extractCancelAndOutgoingTxs = (safeAddress: string, outgoingTxs: TxServiceModel[]): OutgoingTxs => { const extractCancelAndOutgoingTxs = (safeAddress: string, outgoingTxs: TxServiceModel[]): OutgoingTxs => {
return outgoingTxs.reduce( return outgoingTxs.reduce(
(acc, transaction) => { (acc, transaction) => {
if (isCancelTransaction(transaction, safeAddress)) { if (
isCancelTransaction(transaction, safeAddress) &&
outgoingTxs.find((tx) => tx.nonce === transaction.nonce && !isCancelTransaction(tx, safeAddress))
) {
if (!isNaN(Number(transaction.nonce))) { if (!isNaN(Number(transaction.nonce))) {
acc.cancellationTxs[transaction.nonce] = transaction acc.cancellationTxs[transaction.nonce] = transaction
} }