Skip to content

Commit 838f653

Browse files
authored
chore(consensus): change SetHeadL1Origin && UpdateL1Origin to taikoauth_ namespace (#386)
* move the update api to taiko auth namespace * fix lint
1 parent a3e2b34 commit 838f653

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

eth/taiko_api_backend.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,6 @@ func (s *TaikoAPIBackend) L1OriginByID(blockID *math.HexOrDecimal256) (*rawdb.L1
6060
return l1Origin, nil
6161
}
6262

63-
// SetHeadL1Origin sets the latest L2 block's corresponding L1 origin.
64-
func (s *TaikoAPIBackend) SetHeadL1Origin(blockID *math.HexOrDecimal256) *big.Int {
65-
rawdb.WriteHeadL1Origin(s.eth.ChainDb(), (*big.Int)(blockID))
66-
return (*big.Int)(blockID)
67-
}
68-
69-
// UpdateL1Origin updates the L2 block's corresponding L1 origin.
70-
func (s *TaikoAPIBackend) UpdateL1Origin(l1Origin *rawdb.L1Origin) *rawdb.L1Origin {
71-
rawdb.WriteL1Origin(s.eth.ChainDb(), l1Origin.BlockID, l1Origin)
72-
return l1Origin
73-
}
74-
7563
// GetSyncMode returns the node sync mode.
7664
func (s *TaikoAPIBackend) GetSyncMode() (string, error) {
7765
return s.eth.config.SyncMode.String(), nil
@@ -87,6 +75,18 @@ func NewTaikoAuthAPIBackend(eth *Ethereum) *TaikoAuthAPIBackend {
8775
return &TaikoAuthAPIBackend{eth}
8876
}
8977

78+
// SetHeadL1Origin sets the latest L2 block's corresponding L1 origin.
79+
func (a *TaikoAuthAPIBackend) SetHeadL1Origin(blockID *math.HexOrDecimal256) *big.Int {
80+
rawdb.WriteHeadL1Origin(a.eth.ChainDb(), (*big.Int)(blockID))
81+
return (*big.Int)(blockID)
82+
}
83+
84+
// UpdateL1Origin updates the L2 block's corresponding L1 origin.
85+
func (a *TaikoAuthAPIBackend) UpdateL1Origin(l1Origin *rawdb.L1Origin) *rawdb.L1Origin {
86+
rawdb.WriteL1Origin(a.eth.ChainDb(), l1Origin.BlockID, l1Origin)
87+
return l1Origin
88+
}
89+
9090
// TxPoolContent retrieves the transaction pool content with the given upper limits.
9191
func (a *TaikoAuthAPIBackend) TxPoolContent(
9292
beneficiary common.Address,

0 commit comments

Comments
 (0)