Skip to content

Commit

Permalink
fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed Jun 5, 2024
1 parent e60a623 commit 87b3976
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions process/transactionProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"math/big"
"net/http"
"strings"

"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/core/check"
Expand Down Expand Up @@ -43,9 +42,7 @@ const (
relayedV1TransactionDescriptor = "RelayedTx"
relayedV2TransactionDescriptor = "RelayedTxV2"
relayedV3TransactionDescriptor = "RelayedTxV3"
relayedTxV1DataMarker = "relayedTx@"
relayedTxV2DataMarker = "relayedTxV2"
argumentsSeparator = "@"
emptyDataStr = ""
)

Expand Down Expand Up @@ -488,7 +485,7 @@ func (tp *TransactionProcessor) computeTransactionStatus(tx *transaction.ApiTran
}
}

isRelayedV3, status := checkIfRelayedV3Completed(allLogs, tx)
isRelayedV3, status := checkIfRelayedV3Completed(allScrs, allLogs, tx)
if isRelayedV3 {
return &data.ProcessStatusResponse{
Status: status,
Expand Down Expand Up @@ -557,7 +554,7 @@ func checkIfCompleted(logs []*transaction.ApiLogs) bool {
return found
}

func checkIfRelayedV3Completed(logs []*transaction.ApiLogs, tx *transaction.ApiTransactionResult) (bool, string) {
func checkIfRelayedV3Completed(scrs []*transaction.ApiTransactionResult, logs []*transaction.ApiLogs, tx *transaction.ApiTransactionResult) (bool, string) {
if len(tx.InnerTransactions) == 0 {
return false, string(transaction.TxStatusPending)
}
Expand All @@ -574,11 +571,16 @@ func checkIfRelayedV3Completed(logs []*transaction.ApiLogs, tx *transaction.ApiT

completedFound, _ := findIdentifierInSingleLog(logInstance, core.CompletedTxEventIdentifier)
deployFound, _ := findIdentifierInSingleLog(logInstance, core.SCDeployIdentifier)

if completedFound || deployFound {
completedCnt++
}
}

if checkIfFailedOnReturnMessage(scrs, tx) {
return true, string(transaction.TxStatusFail)
}

status := string(transaction.TxStatusPending)
if completedCnt == len(tx.InnerTransactions) {
status = string(transaction.TxStatusSuccess)
Expand Down

0 comments on commit 87b3976

Please sign in to comment.