mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 21:07:18 +00:00
84916672c6
* replace eth2 types * replace protos * regen proto * replace * gaz * deps * amend * regen proto * mod * gaz * gaz * ensure build * ssz * add dep * no more eth2 types * no more eth2 * remg * all builds * buidl * tidy * clean * fmt * val serv * gaz Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
29 lines
685 B
Go
29 lines
685 B
Go
package testutil
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/state"
|
|
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
|
|
)
|
|
|
|
// MockFetcher is a fake implementation of statefetcher.Fetcher.
|
|
type MockFetcher struct {
|
|
BeaconState state.BeaconState
|
|
BeaconStateRoot []byte
|
|
}
|
|
|
|
// State --
|
|
func (m *MockFetcher) State(context.Context, []byte) (state.BeaconState, error) {
|
|
return m.BeaconState, nil
|
|
}
|
|
|
|
// StateRoot --
|
|
func (m *MockFetcher) StateRoot(context.Context, []byte) ([]byte, error) {
|
|
return m.BeaconStateRoot, nil
|
|
}
|
|
|
|
func (m *MockFetcher) StateBySlot(context.Context, types.Slot) (state.BeaconState, error) {
|
|
return m.BeaconState, nil
|
|
}
|