-
Notifications
You must be signed in to change notification settings - Fork 199
/
interceptedTxHandlerStub.go
74 lines (64 loc) · 1.81 KB
/
interceptedTxHandlerStub.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package mock
import (
"math/big"
"github.com/multiversx/mx-chain-core-go/data"
)
// InterceptedTxHandlerStub -
type InterceptedTxHandlerStub struct {
SenderShardIdCalled func() uint32
ReceiverShardIdCalled func() uint32
NonceCalled func() uint64
SenderAddressCalled func() []byte
FeeCalled func() *big.Int
TransactionCalled func() data.TransactionHandler
GetTxMessageForSignatureVerificationCalled func() ([]byte, error)
}
// SenderShardId -
func (iths *InterceptedTxHandlerStub) SenderShardId() uint32 {
if iths.SenderShardIdCalled != nil {
return iths.SenderShardIdCalled()
}
return 0
}
// ReceiverShardId -
func (iths *InterceptedTxHandlerStub) ReceiverShardId() uint32 {
if iths.ReceiverShardIdCalled != nil {
return iths.ReceiverShardIdCalled()
}
return 0
}
// Nonce -
func (iths *InterceptedTxHandlerStub) Nonce() uint64 {
if iths.NonceCalled != nil {
return iths.NonceCalled()
}
return 0
}
// SenderAddress -
func (iths *InterceptedTxHandlerStub) SenderAddress() []byte {
if iths.SenderAddressCalled != nil {
return iths.SenderAddressCalled()
}
return nil
}
// Fee -
func (iths *InterceptedTxHandlerStub) Fee() *big.Int {
if iths.FeeCalled != nil {
return iths.FeeCalled()
}
return nil
}
// Transaction -
func (iths *InterceptedTxHandlerStub) Transaction() data.TransactionHandler {
if iths.TransactionCalled != nil {
return iths.TransactionCalled()
}
return nil
}
// GetTxMessageForSignatureVerification -
func (iths *InterceptedTxHandlerStub) GetTxMessageForSignatureVerification() ([]byte, error) {
if iths.GetTxMessageForSignatureVerificationCalled != nil {
return iths.GetTxMessageForSignatureVerificationCalled()
}
return nil, nil
}