Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove constructChangesTrie
Signed-off-by: turuslan <[email protected]>
  • Loading branch information
turuslan committed Jul 29, 2022
commit b537f0a6dd08df30320aa6cb97007b47a83dee9f
7 changes: 0 additions & 7 deletions core/storage/changes_trie/changes_tracker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ namespace kagome::storage::changes_trie {
*/
virtual outcome::result<void> onRemove(common::BufferView extrinsic_index,
const common::BufferView &key) = 0;

/**
* Sinks accumulated changes for the latest registered block to the changes
* trie and returns its root hash
*/
virtual outcome::result<common::Hash256> constructChangesTrie(
const primitives::BlockHash &parent, const ChangesTrieConfig &conf) = 0;
};

} // namespace kagome::storage::changes_trie
Expand Down
14 changes: 0 additions & 14 deletions core/storage/changes_trie/impl/storage_changes_tracker_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,4 @@ namespace kagome::storage::changes_trie {
}
return outcome::success();
}

outcome::result<common::Hash256>
StorageChangesTrackerImpl::constructChangesTrie(
const primitives::BlockHash &parent, const ChangesTrieConfig &conf) {
if (parent != parent_hash_) {
return Error::INVALID_PARENT_HASH;
}
OUTCOME_TRY(
trie,
ChangesTrie::buildFromChanges(
parent_number_, trie_factory_, codec_, extrinsics_changes_, conf));
return trie->getHash();
}

} // namespace kagome::storage::changes_trie
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ namespace kagome::storage::changes_trie {
outcome::result<void> onRemove(common::BufferView extrinsic_index,
const common::BufferView &key) override;

outcome::result<common::Hash256> constructChangesTrie(
const primitives::BlockHash &parent,
const ChangesTrieConfig &conf) override;

private:
std::shared_ptr<storage::trie::PolkadotTrieFactory> trie_factory_;
std::shared_ptr<storage::trie::Codec> codec_;
Expand Down
2 changes: 0 additions & 2 deletions test/core/storage/changes_trie/changes_tracker_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,5 @@ TEST(ChangesTrieTest, IntegrationWithOverlay) {
auto repo = std::make_shared<BlockHeaderRepositoryMock>();
EXPECT_CALL(*repo, getNumberByHash(_)).WillRepeatedly(Return(42));

EXPECT_OUTCOME_TRUE_1(
changes_tracker->constructChangesTrie("aaa"_hash256, {}));
// THEN SUCCESS
}
6 changes: 0 additions & 6 deletions test/mock/core/storage/changes_trie/changes_tracker_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ namespace kagome::storage::changes_trie {
onRemove,
(common::BufferView ext_idx, const common::BufferView &key),
(override));

MOCK_METHOD(outcome::result<common::Hash256>,
constructChangesTrie,
(const primitives::BlockHash &parent,
const ChangesTrieConfig &conf),
(override));
};

} // namespace kagome::storage::changes_trie
Expand Down