@@ -21,7 +21,7 @@ import (
21
21
func getNodeValue (t Trie , key string ) ([]byte , error ) {
22
22
path := ToKey ([]byte (key ))
23
23
if asView , ok := t .(* view ); ok {
24
- if err := asView .calculateNodeIDs (context .Background ()); err != nil {
24
+ if err := asView .applyValueChanges (context .Background ()); err != nil {
25
25
return nil , err
26
26
}
27
27
}
@@ -131,7 +131,7 @@ func TestVisitPathToKey(t *testing.T) {
131
131
require .NoError (err )
132
132
require .IsType (& view {}, trieIntf )
133
133
trie = trieIntf .(* view )
134
- require .NoError (trie .calculateNodeIDs (context .Background ()))
134
+ require .NoError (trie .applyValueChanges (context .Background ()))
135
135
136
136
nodePath = make ([]* node , 0 , 1 )
137
137
require .NoError (visitPathToKey (trie , ToKey (key1 ), func (n * node ) error {
@@ -156,7 +156,7 @@ func TestVisitPathToKey(t *testing.T) {
156
156
require .NoError (err )
157
157
require .IsType (& view {}, trieIntf )
158
158
trie = trieIntf .(* view )
159
- require .NoError (trie .calculateNodeIDs (context .Background ()))
159
+ require .NoError (trie .applyValueChanges (context .Background ()))
160
160
161
161
nodePath = make ([]* node , 0 , 2 )
162
162
require .NoError (visitPathToKey (trie , ToKey (key2 ), func (n * node ) error {
@@ -185,7 +185,7 @@ func TestVisitPathToKey(t *testing.T) {
185
185
require .NoError (err )
186
186
require .IsType (& view {}, trieIntf )
187
187
trie = trieIntf .(* view )
188
- require .NoError (trie .calculateNodeIDs (context .Background ()))
188
+ require .NoError (trie .applyValueChanges (context .Background ()))
189
189
190
190
// Trie is:
191
191
// []
@@ -775,7 +775,7 @@ func Test_Trie_ChainDeletion(t *testing.T) {
775
775
)
776
776
require .NoError (err )
777
777
778
- require .NoError (newTrie .(* view ).calculateNodeIDs (context .Background ()))
778
+ require .NoError (newTrie .(* view ).applyValueChanges (context .Background ()))
779
779
maybeRoot := newTrie .getRoot ()
780
780
require .NoError (err )
781
781
require .True (maybeRoot .HasValue ())
@@ -794,7 +794,7 @@ func Test_Trie_ChainDeletion(t *testing.T) {
794
794
},
795
795
)
796
796
require .NoError (err )
797
- require .NoError (newTrie .(* view ).calculateNodeIDs (context .Background ()))
797
+ require .NoError (newTrie .(* view ).applyValueChanges (context .Background ()))
798
798
799
799
// trie should be empty
800
800
root := newTrie .getRoot ()
@@ -861,7 +861,7 @@ func Test_Trie_NodeCollapse(t *testing.T) {
861
861
)
862
862
require .NoError (err )
863
863
864
- require .NoError (trie .(* view ).calculateNodeIDs (context .Background ()))
864
+ require .NoError (trie .(* view ).applyValueChanges (context .Background ()))
865
865
866
866
for _ , kv := range kvs {
867
867
node , err := trie .getEditableNode (ToKey (kv .Key ), true )
@@ -888,7 +888,7 @@ func Test_Trie_NodeCollapse(t *testing.T) {
888
888
)
889
889
require .NoError (err )
890
890
891
- require .NoError (trie .(* view ).calculateNodeIDs (context .Background ()))
891
+ require .NoError (trie .(* view ).applyValueChanges (context .Background ()))
892
892
893
893
for _ , kv := range deletedKVs {
894
894
_ , err := trie .getEditableNode (ToKey (kv .Key ), true )
0 commit comments