From 838f65315354488ada3c18e8a9924b69cb61b002 Mon Sep 17 00:00:00 2001 From: maskpp Date: Tue, 18 Feb 2025 10:44:40 +0800 Subject: [PATCH] chore(consensus): change `SetHeadL1Origin` && `UpdateL1Origin` to `taikoauth_` namespace (#386) * move the update api to taiko auth namespace * fix lint --- eth/taiko_api_backend.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/eth/taiko_api_backend.go b/eth/taiko_api_backend.go index a435c5ae0b..cc6ca6bed6 100644 --- a/eth/taiko_api_backend.go +++ b/eth/taiko_api_backend.go @@ -60,18 +60,6 @@ func (s *TaikoAPIBackend) L1OriginByID(blockID *math.HexOrDecimal256) (*rawdb.L1 return l1Origin, nil } -// SetHeadL1Origin sets the latest L2 block's corresponding L1 origin. -func (s *TaikoAPIBackend) SetHeadL1Origin(blockID *math.HexOrDecimal256) *big.Int { - rawdb.WriteHeadL1Origin(s.eth.ChainDb(), (*big.Int)(blockID)) - return (*big.Int)(blockID) -} - -// UpdateL1Origin updates the L2 block's corresponding L1 origin. -func (s *TaikoAPIBackend) UpdateL1Origin(l1Origin *rawdb.L1Origin) *rawdb.L1Origin { - rawdb.WriteL1Origin(s.eth.ChainDb(), l1Origin.BlockID, l1Origin) - return l1Origin -} - // GetSyncMode returns the node sync mode. func (s *TaikoAPIBackend) GetSyncMode() (string, error) { return s.eth.config.SyncMode.String(), nil @@ -87,6 +75,18 @@ func NewTaikoAuthAPIBackend(eth *Ethereum) *TaikoAuthAPIBackend { return &TaikoAuthAPIBackend{eth} } +// SetHeadL1Origin sets the latest L2 block's corresponding L1 origin. +func (a *TaikoAuthAPIBackend) SetHeadL1Origin(blockID *math.HexOrDecimal256) *big.Int { + rawdb.WriteHeadL1Origin(a.eth.ChainDb(), (*big.Int)(blockID)) + return (*big.Int)(blockID) +} + +// UpdateL1Origin updates the L2 block's corresponding L1 origin. +func (a *TaikoAuthAPIBackend) UpdateL1Origin(l1Origin *rawdb.L1Origin) *rawdb.L1Origin { + rawdb.WriteL1Origin(a.eth.ChainDb(), l1Origin.BlockID, l1Origin) + return l1Origin +} + // TxPoolContent retrieves the transaction pool content with the given upper limits. func (a *TaikoAuthAPIBackend) TxPoolContent( beneficiary common.Address,