From 5ea788912bd329d4a9e470d9541a529f59069f8d Mon Sep 17 00:00:00 2001 From: Arijit Das Date: Mon, 17 Jan 2022 17:46:22 +0530 Subject: [PATCH] Add clique consensus engine. --- pkg/eth/backend.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/eth/backend.go b/pkg/eth/backend.go index 3d9485a4..f4df3d63 100644 --- a/pkg/eth/backend.go +++ b/pkg/eth/backend.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/clique" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/bloombits" @@ -812,7 +813,11 @@ func (b *Backend) GetStorageByHash(ctx context.Context, address common.Address, // Engine satisfied the ChainContext interface func (b *Backend) Engine() consensus.Engine { - // TODO: we need to support more than just ethash based engines + if b.Config.ChainConfig.Clique != nil { + engine := clique.New(b.Config.ChainConfig.Clique, nil) + return engine + } + return ethash.NewFaker() } -- 2.45.2