mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 18:51:19 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
31 lines
861 B
Go
31 lines
861 B
Go
package testing
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/api/server/structs"
|
|
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
|
|
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
|
|
"github.com/prysmaticlabs/prysm/v5/network/httputil"
|
|
)
|
|
|
|
type MockBlockRewardFetcher struct {
|
|
Rewards *structs.BlockRewards
|
|
Error *httputil.DefaultJsonError
|
|
State state.BeaconState
|
|
}
|
|
|
|
func (m *MockBlockRewardFetcher) GetBlockRewardsData(_ context.Context, _ interfaces.ReadOnlyBeaconBlock) (*structs.BlockRewards, *httputil.DefaultJsonError) {
|
|
if m.Error != nil {
|
|
return nil, m.Error
|
|
}
|
|
return m.Rewards, nil
|
|
}
|
|
|
|
func (m *MockBlockRewardFetcher) GetStateForRewards(_ context.Context, _ interfaces.ReadOnlyBeaconBlock) (state.BeaconState, *httputil.DefaultJsonError) {
|
|
if m.Error != nil {
|
|
return nil, m.Error
|
|
}
|
|
return m.State, nil
|
|
}
|