-
Notifications
You must be signed in to change notification settings - Fork 199
/
txProcessorMock.go
35 lines (28 loc) · 1.14 KB
/
txProcessorMock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package mock
import (
"math/big"
"github.com/ElrondNetwork/elrond-go/data/smartContractResult"
"github.com/ElrondNetwork/elrond-go/data/transaction"
)
// TxProcessorMock -
type TxProcessorMock struct {
ProcessTransactionCalled func(transaction *transaction.Transaction) error
SetBalancesToTrieCalled func(accBalance map[string]*big.Int) (rootHash []byte, err error)
ProcessSmartContractResultCalled func(scr *smartContractResult.SmartContractResult) error
}
// ProcessTransaction -
func (tp *TxProcessorMock) ProcessTransaction(transaction *transaction.Transaction) error {
return tp.ProcessTransactionCalled(transaction)
}
// SetBalancesToTrie -
func (tp *TxProcessorMock) SetBalancesToTrie(accBalance map[string]*big.Int) (rootHash []byte, err error) {
return tp.SetBalancesToTrieCalled(accBalance)
}
// ProcessSmartContractResult -
func (tp *TxProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error {
return tp.ProcessSmartContractResultCalled(scr)
}
// IsInterfaceNil returns true if there is no value under the interface
func (tp *TxProcessorMock) IsInterfaceNil() bool {
return tp == nil
}