-
Notifications
You must be signed in to change notification settings - Fork 199
/
transactionInterceptorMock.go
78 lines (64 loc) · 1.84 KB
/
transactionInterceptorMock.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
75
76
77
78
package mock
import (
"github.com/ElrondNetwork/elrond-go-core/core"
"github.com/ElrondNetwork/elrond-go-core/data/transaction"
)
// TransactionInterceptorMock -
type TransactionInterceptorMock struct {
IsChecked bool
IsVerified bool
RcvShardVal uint32
SndShardVal uint32
IsAddressedToOtherShardsVal bool
pubkeyConverter core.PubkeyConverter
Tx *transaction.Transaction
hash []byte
}
// Check -
func (tim *TransactionInterceptorMock) Check() bool {
return tim.IsChecked
}
// VerifySig -
func (tim *TransactionInterceptorMock) VerifySig() bool {
return tim.IsVerified
}
// ID -
func (tim *TransactionInterceptorMock) ID() string {
panic("implement me")
}
// RcvShard -
func (tim *TransactionInterceptorMock) RcvShard() uint32 {
return tim.RcvShardVal
}
// SndShard -
func (tim *TransactionInterceptorMock) SndShard() uint32 {
return tim.SndShardVal
}
// IsAddressedToOtherShards -
func (tim *TransactionInterceptorMock) IsAddressedToOtherShards() bool {
return tim.IsAddressedToOtherShardsVal
}
// SetPubkeyConverter -
func (tim *TransactionInterceptorMock) SetPubkeyConverter(converter core.PubkeyConverter) {
tim.pubkeyConverter = converter
}
// PubkeyConverter -
func (tim *TransactionInterceptorMock) PubkeyConverter() core.PubkeyConverter {
return tim.pubkeyConverter
}
// GetTransaction -
func (tim *TransactionInterceptorMock) GetTransaction() *transaction.Transaction {
return tim.Tx
}
// SetHash -
func (tim *TransactionInterceptorMock) SetHash(hash []byte) {
tim.hash = hash
}
// Hash -
func (tim *TransactionInterceptorMock) Hash() []byte {
return tim.hash
}
// IsInterfaceNil returns true if there is no value under the interface
func (tim *TransactionInterceptorMock) IsInterfaceNil() bool {
return tim == nil
}