Skip to content

Commit

Permalink
project restructure consensus
Browse files Browse the repository at this point in the history
Signed-off-by: iceseer <iceseer@gmail.com>
  • Loading branch information
iceseer committed Nov 24, 2022
1 parent 72226eb commit 171e3de
Show file tree
Hide file tree
Showing 20 changed files with 70 additions and 286 deletions.
2 changes: 1 addition & 1 deletion core/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ target_link_libraries(api
storage
blob
metadata_api
babe
consensus
ss58_codec
outcome
build_version
Expand Down
56 changes: 52 additions & 4 deletions core/consensus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,55 @@
# SPDX-License-Identifier: Apache-2.0
#

add_subdirectory(validation)
add_subdirectory(babe)
add_subdirectory(grandpa)
add_subdirectory(authority)
add_library(consensus
authority/impl/schedule_node.cpp
authority/impl/authority_manager_impl.cpp
authority/authority_update_observer_error.cpp
authority/authority_manager_error.cpp
babe/impl/babe_digests_util.cpp
babe/impl/babe_config_node.cpp
babe/impl/block_executor_impl.cpp
babe/impl/babe_impl.cpp
babe/impl/threshold_util.cpp
babe/impl/babe_lottery_impl.cpp
babe/impl/babe_config_repository_impl.cpp
babe/impl/block_appender_impl.cpp
babe/impl/consistency_keeper_impl.cpp
babe/babe_error.cpp
validation/babe_block_validator.cpp
grandpa/impl/vote_tracker_impl.cpp
grandpa/impl/vote_crypto_provider_impl.cpp
grandpa/impl/grandpa_impl.cpp
grandpa/impl/voting_round_impl.cpp
grandpa/impl/environment_impl.cpp
grandpa/vote_graph/vote_graph_error.cpp
grandpa/vote_graph/vote_graph_impl.cpp
grandpa/voter_set.cpp
grandpa/voting_round_error.cpp
)
target_link_libraries(consensus
mp_utils
ed25519_types
Boost::boost
schnorrkel_crust::schnorrkel_crust
transaction_pool_error
hasher
vrf_provider
logger
scale::scale
primitives
blob
outcome
p2p::p2p_peer_id
storage
metrics
blockchain
telemetry
)
kagome_install(consensus)
add_custom_command(TARGET consensus
POST_BUILD
COMMAND find ${CMAKE_CURRENT_BINARY_DIR} -name "*.o" -type f -delete
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Removing object files from '${CMAKE_CURRENT_BINARY_DIR}'"
)
20 changes: 0 additions & 20 deletions core/consensus/authority/CMakeLists.txt

This file was deleted.

16 changes: 0 additions & 16 deletions core/consensus/authority/impl/CMakeLists.txt

This file was deleted.

15 changes: 0 additions & 15 deletions core/consensus/babe/CMakeLists.txt

This file was deleted.

103 changes: 0 additions & 103 deletions core/consensus/babe/impl/CMakeLists.txt

This file was deleted.

67 changes: 0 additions & 67 deletions core/consensus/grandpa/CMakeLists.txt

This file was deleted.

14 changes: 0 additions & 14 deletions core/consensus/grandpa/vote_graph/CMakeLists.txt

This file was deleted.

14 changes: 0 additions & 14 deletions core/consensus/validation/CMakeLists.txt

This file was deleted.

1 change: 1 addition & 0 deletions core/crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ target_link_libraries(vrf_provider
blob
p2p::p2p_random_generator # generator from libp2p
)
kagome_install(vrf_provider)

add_library(sr25519_provider
sr25519/sr25519_provider_impl.cpp
Expand Down
11 changes: 1 addition & 10 deletions core/injector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ target_link_libraries(application_injector
authority_discovery_api
print_chain_info_mode
assets
authority_manager
babe
storage
babe_api
babe_lottery
babe_config_repository
binaryen_executor_factory
binaryen_runtime_external_interface
binaryen_wasm_memory
Expand All @@ -31,18 +27,15 @@ target_link_libraries(application_injector
module_repository
binaryen_module_factory
bip39_provider
block_appender
block_builder_api
block_executor
consensus
blockchain
block_validator
clock
chain_spec
core_api
crypto_store
ecdsa_provider
ed25519_provider
environment
transaction_pool
host_api_factory
key_file_storage
Expand Down Expand Up @@ -75,10 +68,8 @@ target_link_libraries(application_injector
trie_storage_provider
vrf_provider
waitable_timer
authority_manager
assets
grandpa_api
grandpa
p2p::p2p_loopback_stream
offchain_worker_factory
offchain_worker_pool
Expand Down
2 changes: 1 addition & 1 deletion core/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_executable(storage_explorer
)
target_link_libraries(storage_explorer
application_injector
authority_manager
consensus
)
if (BACKWARD)
add_backward(storage_explorer)
Expand Down
2 changes: 1 addition & 1 deletion test/core/blockchain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ addtest(block_tree_test
target_link_libraries(block_tree_test
blockchain
network
babe_digests_util
consensus
logger_for_tests
dummy_error
)
Expand Down
Loading

0 comments on commit 171e3de

Please sign in to comment.