Skip to content

Commit

Permalink
updated stubs.
Browse files Browse the repository at this point in the history
  • Loading branch information
cristure committed Jul 3, 2024
1 parent 936fda0 commit a4e4d38
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions facade/mock/transactionProcessorStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import (
"math/big"

"github.com/multiversx/mx-chain-core-go/data/transaction"

"github.com/multiversx/mx-chain-proxy-go/data"
"github.com/multiversx/mx-chain-proxy-go/process/resultsParser"
)

var errNotImplemented = errors.New("not implemented")
Expand All @@ -19,6 +21,7 @@ type TransactionProcessorStub struct {
TransactionCostRequestCalled func(tx *data.Transaction) (*data.TxCostResponseData, error)
GetTransactionStatusCalled func(txHash string, sender string) (string, error)
GetProcessedTransactionStatusCalled func(txHash string) (*data.ProcessStatusResponse, error)
GetProcessedTransactionOutcomeCalled func(txHash string) (*resultsParser.ResultOutcome, error)
GetTransactionCalled func(txHash string, withEvents bool) (*transaction.ApiTransactionResult, error)
GetTransactionByHashAndSenderAddressCalled func(txHash string, sndAddr string, withEvents bool) (*transaction.ApiTransactionResult, int, error)
ComputeTransactionHashCalled func(tx *data.Transaction) (string, error)
Expand Down Expand Up @@ -92,6 +95,15 @@ func (tps *TransactionProcessorStub) GetProcessedTransactionStatus(txHash string
return &data.ProcessStatusResponse{}, errNotImplemented
}

// GetProcessedTransactionOutcome -
func (tps *TransactionProcessorStub) GetProcessedTransactionOutcome(txHash string) (*resultsParser.ResultOutcome, error) {
if tps.GetProcessedTransactionOutcomeCalled != nil {
return tps.GetProcessedTransactionOutcomeCalled(txHash)
}

return &resultsParser.ResultOutcome{}, errNotImplemented
}

// GetTransaction -
func (tps *TransactionProcessorStub) GetTransaction(txHash string, withEvents bool) (*transaction.ApiTransactionResult, error) {
if tps.GetTransactionCalled != nil {
Expand Down

0 comments on commit a4e4d38

Please sign in to comment.