Skip to content

Commit

Permalink
Implement BitArray and replace trie.Key (#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann authored Jan 23, 2025
1 parent b45cae5 commit 4d99dd0
Show file tree
Hide file tree
Showing 16 changed files with 3,219 additions and 597 deletions.
6 changes: 3 additions & 3 deletions core/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ func (s *State) globalTrie(bucket db.Bucket, newTrie trie.NewTrieFunc) (*trie.Tr

// fetch root key
rootKeyDBKey := dbPrefix
var rootKey *trie.Key
var rootKey *trie.BitArray // TODO: use value instead of pointer
err := s.txn.Get(rootKeyDBKey, func(val []byte) error {
rootKey = new(trie.Key)
rootKey = new(trie.BitArray)
return rootKey.UnmarshalBinary(val)
})

Expand Down Expand Up @@ -169,7 +169,7 @@ func (s *State) globalTrie(bucket db.Bucket, newTrie trie.NewTrieFunc) (*trie.Tr

if resultingRootKey != nil {
var rootKeyBytes bytes.Buffer
_, marshalErr := resultingRootKey.WriteTo(&rootKeyBytes)
_, marshalErr := resultingRootKey.Write(&rootKeyBytes)
if marshalErr != nil {
return marshalErr
}
Expand Down
Loading

0 comments on commit 4d99dd0

Please sign in to comment.