Skip to content

Commit

Permalink
Merge #4297
Browse files Browse the repository at this point in the history
4297: Update access handler to use finalized header cache interface object r=pattyshack a=pattyshack

The emulator does not have a real finalized header cache.  We need to provide a stub implementation instead.

Co-authored-by: Patrick Lee <[email protected]>
  • Loading branch information
bors[bot] and pattyshack authored May 1, 2023
2 parents e01ef0a + 52f014f commit 6a911be
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions access/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ import (
"github.com/onflow/flow-go/consensus/hotstuff"
"github.com/onflow/flow-go/consensus/hotstuff/signature"
"github.com/onflow/flow-go/engine/common/rpc/convert"
synceng "github.com/onflow/flow-go/engine/common/synchronization"
"github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-go/module"
)

type FinalizedHeaderCache interface {
Get() *flow.Header
}

type Handler struct {
api API
chain flow.Chain
signerIndicesDecoder hotstuff.BlockSignerDecoder
finalizedHeaderCache *synceng.FinalizedHeaderCache
finalizedHeaderCache FinalizedHeaderCache
me module.Local
}

Expand All @@ -30,7 +33,7 @@ type HandlerOption func(*Handler)

var _ access.AccessAPIServer = (*Handler)(nil)

func NewHandler(api API, chain flow.Chain, finalizedHeader *synceng.FinalizedHeaderCache, me module.Local, options ...HandlerOption) *Handler {
func NewHandler(api API, chain flow.Chain, finalizedHeader FinalizedHeaderCache, me module.Local, options ...HandlerOption) *Handler {
h := &Handler{
api: api,
chain: chain,
Expand Down

0 comments on commit 6a911be

Please sign in to comment.