XDCx, consensus: fix some typos (#1173)

This commit is contained in:
Daniel Liu 2025-07-02 14:12:11 +08:00 committed by GitHub
parent e24293a49c
commit 801e92b56d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 14 additions and 14 deletions

View file

@ -166,7 +166,7 @@ func (l *liquidationPriceState) deepCopy(db *TradingStateDB, onDirty func(liquid
return stateOrderList return stateOrderList
} }
// Retrieve a state object given my the address. Returns nil if not found. // Retrieve a state object given by the address. Returns nil if not found.
func (l *liquidationPriceState) getStateLendingBook(db Database, lendingBook common.Hash) (stateObject *stateLendingBook) { func (l *liquidationPriceState) getStateLendingBook(db Database, lendingBook common.Hash) (stateObject *stateLendingBook) {
// Prefer 'live' objects. // Prefer 'live' objects.
if obj := l.stateLendingBooks[lendingBook]; obj != nil { if obj := l.stateLendingBooks[lendingBook]; obj != nil {

View file

@ -227,7 +227,7 @@ func (te *tradingExchanges) updateAsksTrie(db Database) Trie {
return tr return tr
} }
// CommitAskTrie the storage trie of the object to dwb. // CommitAskTrie the storage trie of the object to db.
// This updates the trie root. // This updates the trie root.
func (te *tradingExchanges) updateAsksRoot(db Database) error { func (te *tradingExchanges) updateAsksRoot(db Database) error {
te.updateAsksTrie(db) te.updateAsksTrie(db)
@ -238,7 +238,7 @@ func (te *tradingExchanges) updateAsksRoot(db Database) error {
return nil return nil
} }
// CommitAskTrie the storage trie of the object to dwb. // CommitAskTrie the storage trie of the object to db.
// This updates the trie root. // This updates the trie root.
func (te *tradingExchanges) CommitAsksTrie(db Database) error { func (te *tradingExchanges) CommitAsksTrie(db Database) error {
te.updateAsksTrie(db) te.updateAsksTrie(db)
@ -300,7 +300,7 @@ func (te *tradingExchanges) updateBidsRoot(db Database) {
te.data.BidRoot = te.bidsTrie.Hash() te.data.BidRoot = te.bidsTrie.Hash()
} }
// CommitAskTrie the storage trie of the object to dwb. // CommitAskTrie the storage trie of the object to db.
// This updates the trie root. // This updates the trie root.
func (te *tradingExchanges) CommitBidsTrie(db Database) error { func (te *tradingExchanges) CommitBidsTrie(db Database) error {
te.updateBidsTrie(db) te.updateBidsTrie(db)
@ -417,7 +417,7 @@ func (te *tradingExchanges) removeStateOrderListBidObject(db Database, stateOrde
te.setError(te.bidsTrie.TryDelete(stateOrderList.price[:])) te.setError(te.bidsTrie.TryDelete(stateOrderList.price[:]))
} }
// Retrieve a state object given my the address. Returns nil if not found. // Retrieve a state object given by the address. Returns nil if not found.
func (te *tradingExchanges) getStateOrderListAskObject(db Database, price common.Hash) (stateOrderList *stateOrderList) { func (te *tradingExchanges) getStateOrderListAskObject(db Database, price common.Hash) (stateOrderList *stateOrderList) {
// Prefer 'live' objects. // Prefer 'live' objects.
if obj := te.stateAskObjects[price]; obj != nil { if obj := te.stateAskObjects[price]; obj != nil {
@ -469,7 +469,7 @@ func (te *tradingExchanges) createStateOrderListAskObject(db Database, price com
return newobj return newobj
} }
// Retrieve a state object given my the address. Returns nil if not found. // Retrieve a state object given by the address. Returns nil if not found.
func (te *tradingExchanges) getStateBidOrderListObject(db Database, price common.Hash) (stateOrderList *stateOrderList) { func (te *tradingExchanges) getStateBidOrderListObject(db Database, price common.Hash) (stateOrderList *stateOrderList) {
// Prefer 'live' objects. // Prefer 'live' objects.
if obj := te.stateBidObjects[price]; obj != nil { if obj := te.stateBidObjects[price]; obj != nil {
@ -521,7 +521,7 @@ func (te *tradingExchanges) createStateBidOrderListObject(db Database, price com
return newobj return newobj
} }
// Retrieve a state object given my the address. Returns nil if not found. // Retrieve a state object given by the address. Returns nil if not found.
func (te *tradingExchanges) getStateOrderObject(db Database, orderId common.Hash) (stateOrderItem *stateOrderItem) { func (te *tradingExchanges) getStateOrderObject(db Database, orderId common.Hash) (stateOrderItem *stateOrderItem) {
// Prefer 'live' objects. // Prefer 'live' objects.
if obj := te.stateOrderObjects[orderId]; obj != nil { if obj := te.stateOrderObjects[orderId]; obj != nil {
@ -587,14 +587,14 @@ func (t *tradingExchanges) updateOrdersTrie(db Database) Trie {
return tr return tr
} }
// CommitAskTrie the storage trie of the object to dwb. // CommitAskTrie the storage trie of the object to db.
// This updates the trie root. // This updates the trie root.
func (t *tradingExchanges) updateOrdersRoot(db Database) { func (t *tradingExchanges) updateOrdersRoot(db Database) {
t.updateOrdersTrie(db) t.updateOrdersTrie(db)
t.data.OrderRoot = t.ordersTrie.Hash() t.data.OrderRoot = t.ordersTrie.Hash()
} }
// CommitAskTrie the storage trie of the object to dwb. // CommitAskTrie the storage trie of the object to db.
// This updates the trie root. // This updates the trie root.
func (t *tradingExchanges) CommitOrdersTrie(db Database) error { func (t *tradingExchanges) CommitOrdersTrie(db Database) error {
t.updateOrdersTrie(db) t.updateOrdersTrie(db)

View file

@ -424,7 +424,7 @@ func (t *TradingStateDB) updateStateExchangeObject(stateObject *tradingExchanges
t.setError(t.trie.TryUpdate(addr[:], data)) t.setError(t.trie.TryUpdate(addr[:], data))
} }
// Retrieve a state object given my the address. Returns nil if not found. // Retrieve a state object given by the address. Returns nil if not found.
func (t *TradingStateDB) getStateExchangeObject(addr common.Hash) (stateObject *tradingExchanges) { func (t *TradingStateDB) getStateExchangeObject(addr common.Hash) (stateObject *tradingExchanges) {
// Prefer 'live' objects. // Prefer 'live' objects.
if obj := t.stateExhangeObjects[addr]; obj != nil { if obj := t.stateExhangeObjects[addr]; obj != nil {

View file

@ -409,7 +409,7 @@ func (ls *LendingStateDB) updateLendingExchange(stateObject *lendingExchangeStat
ls.setError(ls.trie.TryUpdate(addr[:], data)) ls.setError(ls.trie.TryUpdate(addr[:], data))
} }
// Retrieve a state object given my the address. Returns nil if not found. // Retrieve a state object given by the address. Returns nil if not found.
func (ls *LendingStateDB) getLendingExchange(addr common.Hash) (stateObject *lendingExchangeState) { func (ls *LendingStateDB) getLendingExchange(addr common.Hash) (stateObject *lendingExchangeState) {
// Prefer 'live' objects. // Prefer 'live' objects.
if obj := ls.lendingExchangeStates[addr]; obj != nil { if obj := ls.lendingExchangeStates[addr]; obj != nil {

View file

@ -482,7 +482,7 @@ func (x *XDPoS_v1) snapshot(chain consensus.ChainReader, number uint64, hash com
// checkpoint snapshot = checkpoint - gap // checkpoint snapshot = checkpoint - gap
if (number+x.config.Gap)%x.config.Epoch == 0 { if (number+x.config.Gap)%x.config.Epoch == 0 {
if s, err := loadSnapshot(x.config, x.signatures, x.db, hash); err == nil { if s, err := loadSnapshot(x.config, x.signatures, x.db, hash); err == nil {
log.Trace("Loaded voting snapshot form disk", "number", number, "hash", hash) log.Trace("Loaded voting snapshot from disk", "number", number, "hash", hash)
snap = s snap = s
break break
} }

View file

@ -397,7 +397,7 @@ func (c *Clique) snapshot(chain consensus.ChainReader, number uint64, hash commo
// If an on-disk checkpoint snapshot can be found, use that // If an on-disk checkpoint snapshot can be found, use that
if number%checkpointInterval == 0 { if number%checkpointInterval == 0 {
if s, err := loadSnapshot(c.config, c.signatures, c.db, hash); err == nil { if s, err := loadSnapshot(c.config, c.signatures, c.db, hash); err == nil {
log.Trace("Loaded voting snapshot form disk", "number", number, "hash", hash) log.Trace("Loaded voting snapshot from disk", "number", number, "hash", hash)
snap = s snap = s
break break
} }

View file

@ -319,7 +319,7 @@ func (s *stateObject) updateRoot(db Database) {
s.data.Root = s.trie.Hash() s.data.Root = s.trie.Hash()
} }
// CommitTrie the storage trie of the object to dwb. // CommitTrie the storage trie of the object to db.
// This updates the trie root. // This updates the trie root.
func (s *stateObject) CommitTrie(db Database) error { func (s *stateObject) CommitTrie(db Database) error {
// If nothing changed, don't bother with hashing anything // If nothing changed, don't bother with hashing anything