From 436cb26422c522f249bf24219c8018eee750b845 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 9 Mar 2022 16:03:29 +0000 Subject: [PATCH] Use GetDescendants instead of accessing `Descendants` directly --- internal/trie/node/copy.go | 2 +- lib/trie/trie_endtoend_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/trie/node/copy.go b/internal/trie/node/copy.go index 62d680a42c..9a26ff6b75 100644 --- a/internal/trie/node/copy.go +++ b/internal/trie/node/copy.go @@ -10,7 +10,7 @@ func (b *Branch) Copy(copyChildren bool) Node { cpy := &Branch{ Dirty: b.Dirty, Generation: b.Generation, - Descendants: b.Descendants, + Descendants: b.GetDescendants(), } if copyChildren { diff --git a/lib/trie/trie_endtoend_test.go b/lib/trie/trie_endtoend_test.go index bec7501faa..bf982b0446 100644 --- a/lib/trie/trie_endtoend_test.go +++ b/lib/trie/trie_endtoend_test.go @@ -1132,7 +1132,7 @@ func countNodesFromStats(root Node) (nodesCount uint32) { } else if root.Type() == node.LeafType { return 1 } - return 1 + root.(*node.Branch).Descendants + return 1 + root.(*node.Branch).GetDescendants() } func testDescendants(t *testing.T, root Node) {