diff --git a/consensus/consensus.go b/consensus/consensus.go index bc37d5e9d..bfea5de2a 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -299,6 +299,7 @@ func (consensus *Consensus) UpdatePublicKeys(pubKeys []kyber.Point) int { return len(consensus.PublicKeys) } +// NewFaker returns a faker consensus. func NewFaker() *Consensus { return &Consensus{} } @@ -386,11 +387,14 @@ func (consensus *Consensus) SealHash(header *types.Header) (hash common.Hash) { return hash } +// Seal is to seal final block. func (consensus *Consensus) Seal(chain ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error { // TODO: implement final block sealing return nil } +// Prepare is to prepare ... +// TODO(RJ): fix it. func (consensus *Consensus) Prepare(chain ChainReader, header *types.Header) error { // TODO: implement prepare method return nil diff --git a/node/worker/worker.go b/node/worker/worker.go index f4dbc14b2..c8825c186 100644 --- a/node/worker/worker.go +++ b/node/worker/worker.go @@ -1,10 +1,11 @@ package worker import ( - "github.com/harmony-one/harmony/log" "math/big" "time" + "github.com/harmony-one/harmony/log" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/params" "github.com/harmony-one/harmony/consensus" @@ -38,6 +39,7 @@ type Worker struct { gasCeil uint64 } +// SelectTransactionsForNewBlock selects transactions for new block. func (w *Worker) SelectTransactionsForNewBlock(txs types.Transactions, maxNumTxs int) (types.Transactions, types.Transactions, types.Transactions) { if w.current.gasPool == nil { w.current.gasPool = new(core.GasPool).AddGas(w.current.header.GasLimit)