@@ -12,6 +12,7 @@ import (
1212 ethtypes "github.com/ethereum/go-ethereum/core/types"
1313 "github.com/rocket-pool/rocketpool-go/rewards"
1414 "github.com/rocket-pool/rocketpool-go/types"
15+ "github.com/rocket-pool/smartnode/shared/services/beacon"
1516 "github.com/wealdtech/go-merkletree"
1617)
1718
@@ -40,6 +41,16 @@ type RewardsExecutionClient interface {
4041 GetRewardSnapshotEvent (previousRewardsPoolAddresses []common.Address , interval uint64 , opts * bind.CallOpts ) (rewards.RewardsEvent , error )
4142}
4243
44+ // RewardsBeaconClient defines and interface
45+ // that contains only the functions from beacon.Client
46+ // required for rewards generation.
47+ // This facade makes it easier to perform dependency injection in tests.
48+ type RewardsBeaconClient interface {
49+ GetBeaconBlock (slot string ) (beacon.BeaconBlock , bool , error )
50+ GetCommitteesForEpoch (epoch * uint64 ) (beacon.Committees , error )
51+ GetAttestations (slot string ) ([]beacon.AttestationInfo , bool , error )
52+ }
53+
4354// Interface for version-agnostic minipool performance
4455type IMinipoolPerformanceFile interface {
4556 // Serialize a minipool performance file into bytes
@@ -80,6 +91,8 @@ type IRewardsFile interface {
8091 GetTotalCollateralRpl () * big.Int
8192 GetTotalNodeOperatorSmoothingPoolEth () * big.Int
8293 GetTotalPoolStakerSmoothingPoolEth () * big.Int
94+ GetExecutionStartBlock () uint64
95+ GetConsensusStartBlock () uint64
8396 GetExecutionEndBlock () uint64
8497 GetConsensusEndBlock () uint64
8598 GetStartTime () time.Time
0 commit comments