From 2bd59e1473210c14623a680e5149b165ccdc1323 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Fri, 27 Apr 2018 15:18:04 -0600 Subject: [PATCH] Rename PushAnchor to PushSproutAnchor. --- src/coins.cpp | 2 +- src/coins.h | 2 +- src/main.cpp | 2 +- src/test/coins_tests.cpp | 22 +++++++++++----------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index 072d3f659..ebcc5e1a8 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -158,7 +158,7 @@ bool CCoinsViewCache::GetNullifier(const uint256 &nullifier, ShieldedType type) return tmp; } -void CCoinsViewCache::PushAnchor(const ZCIncrementalMerkleTree &tree) { +void CCoinsViewCache::PushSproutAnchor(const ZCIncrementalMerkleTree &tree) { uint256 newrt = tree.root(); auto currentRoot = GetBestAnchor(); diff --git a/src/coins.h b/src/coins.h index b774961e1..99273786e 100644 --- a/src/coins.h +++ b/src/coins.h @@ -453,7 +453,7 @@ public: // Adds the tree to mapAnchors and sets the current commitment // root to this root. - void PushAnchor(const ZCIncrementalMerkleTree &tree); + void PushSproutAnchor(const ZCIncrementalMerkleTree &tree); // Removes the current commitment root from mapAnchors and sets // the new current root. diff --git a/src/main.cpp b/src/main.cpp index 21d4c3992..96f9b66aa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2411,7 +2411,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION); } - view.PushAnchor(tree); + view.PushSproutAnchor(tree); if (!fJustCheck) { pindex->hashSproutAnchorEnd = tree.root(); } diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index bfe14b533..9382edeb2 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -325,7 +325,7 @@ BOOST_AUTO_TEST_CASE(anchor_pop_regression_test) tree.append(cm); // Add the anchor - cache1.PushAnchor(tree); + cache1.PushSproutAnchor(tree); cache1.Flush(); // Remove the anchor @@ -333,7 +333,7 @@ BOOST_AUTO_TEST_CASE(anchor_pop_regression_test) cache1.Flush(); // Add the anchor back - cache1.PushAnchor(tree); + cache1.PushSproutAnchor(tree); cache1.Flush(); // The base contains the anchor, of course! @@ -355,7 +355,7 @@ BOOST_AUTO_TEST_CASE(anchor_pop_regression_test) tree.append(cm); // Add the anchor and flush to disk - cache1.PushAnchor(tree); + cache1.PushSproutAnchor(tree); cache1.Flush(); // Remove the anchor, but don't flush yet! @@ -363,7 +363,7 @@ BOOST_AUTO_TEST_CASE(anchor_pop_regression_test) { CCoinsViewCacheTest cache2(&cache1); // Build cache on top - cache2.PushAnchor(tree); // Put the same anchor back! + cache2.PushSproutAnchor(tree); // Put the same anchor back! cache2.Flush(); // Flush to cache1 } @@ -398,7 +398,7 @@ BOOST_AUTO_TEST_CASE(anchor_regression_test) ZCIncrementalMerkleTree tree; uint256 cm = GetRandHash(); tree.append(cm); - cache1.PushAnchor(tree); + cache1.PushSproutAnchor(tree); cache1.Flush(); cache1.PopAnchor(ZCIncrementalMerkleTree::empty_root()); @@ -415,7 +415,7 @@ BOOST_AUTO_TEST_CASE(anchor_regression_test) ZCIncrementalMerkleTree tree; uint256 cm = GetRandHash(); tree.append(cm); - cache1.PushAnchor(tree); + cache1.PushSproutAnchor(tree); cache1.Flush(); cache1.PopAnchor(ZCIncrementalMerkleTree::empty_root()); @@ -433,7 +433,7 @@ BOOST_AUTO_TEST_CASE(anchor_regression_test) ZCIncrementalMerkleTree tree; uint256 cm = GetRandHash(); tree.append(cm); - cache1.PushAnchor(tree); + cache1.PushSproutAnchor(tree); cache1.Flush(); { @@ -457,7 +457,7 @@ BOOST_AUTO_TEST_CASE(anchor_regression_test) ZCIncrementalMerkleTree tree; uint256 cm = GetRandHash(); tree.append(cm); - cache1.PushAnchor(tree); + cache1.PushSproutAnchor(tree); cache1.Flush(); { @@ -507,7 +507,7 @@ BOOST_AUTO_TEST_CASE(anchors_flush_test) newrt = tree.root(); - cache.PushAnchor(tree); + cache.PushSproutAnchor(tree); cache.Flush(); } @@ -631,7 +631,7 @@ BOOST_AUTO_TEST_CASE(anchors_test) uint256 newrt = tree.root(); uint256 newrt2; - cache.PushAnchor(tree); + cache.PushSproutAnchor(tree); BOOST_CHECK(cache.GetBestAnchor() == newrt); { @@ -646,7 +646,7 @@ BOOST_AUTO_TEST_CASE(anchors_test) newrt2 = tree.root(); - cache.PushAnchor(tree); + cache.PushSproutAnchor(tree); BOOST_CHECK(cache.GetBestAnchor() == newrt2); ZCIncrementalMerkleTree test_tree;