Merge pull request #5312 from str4d/fix-connectblockslow-bench

bench: Add Orchard logic to zcbenchmarks
This commit is contained in:
str4d 2021-09-23 06:45:45 +12:00 committed by GitHub
commit 5ef1b9b8cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -448,6 +448,7 @@ class FakeCoinsViewDB : public CCoinsView {
uint256 hash;
SproutMerkleTree sproutTree;
SaplingMerkleTree saplingTree;
OrchardMerkleTree orchardTree;
public:
FakeCoinsViewDB(std::string dbName, uint256& hash) : db(GetDataDir() / dbName, 100, false, false), hash(hash) {}
@ -468,6 +469,14 @@ public:
return false;
}
bool GetOrchardAnchorAt(const uint256 &rt, OrchardMerkleTree &tree) const {
if (rt == orchardTree.root()) {
tree = orchardTree;
return true;
}
return false;
}
bool GetNullifier(const uint256 &nf, ShieldedType type) const {
return false;
}
@ -490,6 +499,8 @@ public:
return sproutTree.root();
case SAPLING:
return saplingTree.root();
case ORCHARD:
return orchardTree.root();
default:
throw new std::runtime_error("Unknown shielded type");
}
@ -499,10 +510,14 @@ public:
const uint256 &hashBlock,
const uint256 &hashSproutAnchor,
const uint256 &hashSaplingAnchor,
const uint256 &hashOrchardAnchor,
CAnchorsSproutMap &mapSproutAnchors,
CAnchorsSaplingMap &mapSaplingAnchors,
CAnchorsOrchardMap &mapOrchardAnchors,
CNullifiersMap &mapSproutNullifiers,
CNullifiersMap &mapSaplingNullifiers) {
CNullifiersMap &mapSaplingNullifiers,
CNullifiersMap &mapOrchardNullifiers,
CHistoryCacheMap &historyCacheMap) {
return false;
}