From 15885f4c9b9263746827172b4f4f56d0926d18e2 Mon Sep 17 00:00:00 2001 From: frozen <355847+Frozen@users.noreply.github.com> Date: Wed, 22 Mar 2023 01:25:20 -0300 Subject: [PATCH] Clean up code. --- node/worker/worker.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/node/worker/worker.go b/node/worker/worker.go index f8279d349..d2a8f407a 100644 --- a/node/worker/worker.go +++ b/node/worker/worker.go @@ -311,7 +311,7 @@ func (w *Worker) UpdateCurrent() error { Time(big.NewInt(timestamp)). ShardID(w.chain.ShardID()). Header() - return w.makeCurrent(parent, header) + return w.makeCurrent(parent.Header(), header) } // GetCurrentHeader returns the current header to propose @@ -320,7 +320,7 @@ func (w *Worker) GetCurrentHeader() *block.Header { } // makeCurrent creates a new environment for the current cycle. -func (w *Worker) makeCurrent(parent *types.Block, header *block.Header) error { +func (w *Worker) makeCurrent(parent *block.Header, header *block.Header) error { state, err := w.chain.StateAt(parent.Root()) if err != nil { return err @@ -380,16 +380,6 @@ func (w *Worker) GetCurrentReceipts() []*types.Receipt { return w.current.receipts } -// OutgoingReceipts get the receipts generated starting from the last state. -func (w *Worker) OutgoingReceipts() []*types.CXReceipt { - return w.current.outcxs -} - -// IncomingReceipts get incoming receipts in destination shard that is received from source shard -func (w *Worker) IncomingReceipts() []*types.CXReceiptsProof { - return w.current.incxs -} - // CollectVerifiedSlashes sets w.current.slashes only to those that // past verification func (w *Worker) CollectVerifiedSlashes() error { @@ -596,7 +586,7 @@ func New( Time(big.NewInt(timestamp)). ShardID(worker.chain.ShardID()). Header() - worker.makeCurrent(parent, header) + worker.makeCurrent(parent.Header(), header) return worker }