-
Notifications
You must be signed in to change notification settings - Fork 197
/
epochStartSystemSCStub.go
46 lines (40 loc) · 1.42 KB
/
epochStartSystemSCStub.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
package mock
import (
"github.com/ElrondNetwork/elrond-go-core/data/block"
"github.com/ElrondNetwork/elrond-go/epochStart"
"github.com/ElrondNetwork/elrond-go/state"
)
// EpochStartSystemSCStub -
type EpochStartSystemSCStub struct {
ProcessSystemSmartContractCalled func(validatorInfos map[uint32][]*state.ValidatorInfo, nonce uint64, epoch uint32) error
ProcessDelegationRewardsCalled func(miniBlocks block.MiniBlockSlice, txCache epochStart.TransactionCacher) error
ToggleUnStakeUnBondCalled func(value bool) error
}
// ToggleUnStakeUnBond -
func (e *EpochStartSystemSCStub) ToggleUnStakeUnBond(value bool) error {
if e.ToggleUnStakeUnBondCalled != nil {
return e.ToggleUnStakeUnBondCalled(value)
}
return nil
}
// ProcessSystemSmartContract -
func (e *EpochStartSystemSCStub) ProcessSystemSmartContract(validatorInfos map[uint32][]*state.ValidatorInfo, nonce uint64, epoch uint32) error {
if e.ProcessSystemSmartContractCalled != nil {
return e.ProcessSystemSmartContractCalled(validatorInfos, nonce, epoch)
}
return nil
}
// ProcessDelegationRewards -
func (e *EpochStartSystemSCStub) ProcessDelegationRewards(
miniBlocks block.MiniBlockSlice,
txCache epochStart.TransactionCacher,
) error {
if e.ProcessDelegationRewardsCalled != nil {
return e.ProcessDelegationRewardsCalled(miniBlocks, txCache)
}
return nil
}
// IsInterfaceNil -
func (e *EpochStartSystemSCStub) IsInterfaceNil() bool {
return e == nil
}