Skip to content

Commit

Permalink
Refactor and update (#1836)
Browse files Browse the repository at this point in the history
* update: client name and copyright-comments
* refactor: replace include-guards by pragma-once
* update: bump project version

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
  • Loading branch information
xDimon authored Oct 9, 2023
1 parent c896b31 commit b1ef9b6
Show file tree
Hide file tree
Showing 1,473 changed files with 4,250 additions and 4,251 deletions.
6 changes: 6 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

BasedOnStyle: Google
NamespaceIndentation: All
BreakBeforeBinaryOperators: NonAssignment
Expand Down
6 changes: 6 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

---
Checks: '-*,clang-analyzer-*,clang-diagnostic-*,readability-*,modernize-*,boost-*,bugprone-*,cppcoreguidelines-*,google-*,hicpp-*,performance-*,readability-*,-google-readability-namespace-comments,-readability-inconsistent-declaration-parameter-name,-readability-braces-around-statements,-hicpp-signed-bitwise,-google-runtime-references,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-readability-magic-numbers,-hicpp-explicit-conversions,-hicpp-uppercase-literal-suffix,-readability-uppercase-literal-suffix,-hicpp-no-array-decay,-hicpp-special-member-functions,-bugprone-narrowing-conversions,-modernize-use-nodiscard,-google-readability-braces-around-statements,-hicpp-braces-around-statements,-bugprone-suspicious-semicolon,-readability-named-parameter,-hicpp-named-parameter,-readability-identifier-naming,-modernize-use-trailing-return-type'
WarningsAsErrors: 'modernize-*,cppcoreguidelines-*,boost-*,performance-*,google-build-using-namespace,readability-else-after-return,google-readability-todo'
Expand Down
6 changes: 6 additions & 0 deletions .githooks/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[//]: # (
Copyright Quadrivium LLC
All Rights Reserved
SPDX-License-Identifier: Apache-2.0
)

# Git Hooks

This folder _might_ contain some git-hooks to execute various checkup in Kagome.
Expand Down
5 changes: 5 additions & 0 deletions .githooks/activate_hooks.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/sh
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

GIT=$(which git)

Expand Down
5 changes: 5 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/sh
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

if git rev-parse --verify HEAD >/dev/null 2>&1; then
BASE=HEAD
Expand Down
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[//]: # (
Copyright Quadrivium LLC
All Rights Reserved
SPDX-License-Identifier: Apache-2.0
)

<!-- You will not see HTML commented line in Pull Request body -->
<!-- Optional sections may be omitted. Just remove them or write None -->

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/autotests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

name: Autotests

on:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

name: Build

on:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/zombie-builder.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

# Update zombie builder image each Sunday night
on:
schedule:
Expand All @@ -22,6 +28,6 @@ jobs:
login-server: https://index.docker.io/v1/
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Push zombie-builder docker image
- name: Push zombie-builder docker image
working-directory: ./zombienet/docker
run: make builder_push
run: make builder_push
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

cmake_minimum_required(VERSION 3.12)

find_program(CCACHE_FOUND ccache)
Expand All @@ -13,7 +19,10 @@ set(CMAKE_TOOLCHAIN_FILE
include("cmake/Hunter/init.cmake")

add_compile_options(-gdwarf-4)
project(kagome C CXX)
project(kagome
VERSION 0.9.2
LANGUAGES C CXX
)

include(cmake/print.cmake)
print("C flags: ${CMAKE_C_FLAGS}")
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[//]: # (
Copyright Quadrivium LLC
All Rights Reserved
SPDX-License-Identifier: Apache-2.0
)

# CONTRIBUTING

1. Kagome uses C++20 as target language
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2019 Soramitsu Co Ltd
Copyright 2023 Quadrivium LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[//]: # (
Copyright Quadrivium LLC
All Rights Reserved
SPDX-License-Identifier: Apache-2.0
)

![logo](/docs/image_assets/kagome-logo-(new-2020).svg)

[![CodeFactor](https://www.codefactor.io/repository/github/soramitsu/kagome/badge)](https://www.codefactor.io/repository/github/soramitsu/kagome)
Expand Down
3 changes: 2 additions & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

Expand Down
6 changes: 6 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[//]: # (
Copyright Quadrivium LLC
All Rights Reserved
SPDX-License-Identifier: Apache-2.0
)

# core

Every module should be in its folder, so when you include them, it will look like
Expand Down
5 changes: 3 additions & 2 deletions core/api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#

Expand Down Expand Up @@ -67,7 +68,7 @@ target_link_libraries(api
ss58_codec
outcome
build_version
PRIVATE
PRIVATE
RapidJSON::rapidjson
metrics
)
Expand Down
8 changes: 3 additions & 5 deletions core/api/allow_unsafe.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_API_ALLOW_UNSAFE_HPP
#define KAGOME_API_ALLOW_UNSAFE_HPP
#pragma once

#include <boost/asio/ip/tcp.hpp>

Expand All @@ -26,5 +26,3 @@ namespace kagome::api {
Config config;
};
} // namespace kagome::api

#endif // KAGOME_API_ALLOW_UNSAFE_HPP
8 changes: 3 additions & 5 deletions core/api/jrpc/custom_json_writer.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_CUSTOM_JSON_WRITER_HPP
#define KAGOME_CUSTOM_JSON_WRITER_HPP
#pragma once

#include <jsonrpc-lean/json.h>
#include <jsonrpc-lean/jsonformatteddata.h>
Expand Down Expand Up @@ -203,5 +203,3 @@ namespace kagome::api {
};

} // namespace kagome::api

#endif // KAGOME_CUSTOM_JSON_WRITER_HPP
3 changes: 2 additions & 1 deletion core/api/jrpc/decode_args.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down
3 changes: 2 additions & 1 deletion core/api/jrpc/jrpc_handle_batch.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down
8 changes: 3 additions & 5 deletions core/api/jrpc/jrpc_handle_batch.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_API_JRPC_HANDLE_BATCH_HPP
#define KAGOME_API_JRPC_HANDLE_BATCH_HPP
#pragma once

#include <memory>
#include <string>
Expand Down Expand Up @@ -41,5 +41,3 @@ namespace kagome::api {
std::string batch_;
};
} // namespace kagome::api

#endif // KAGOME_API_JRPC_HANDLE_BATCH_HPP
8 changes: 3 additions & 5 deletions core/api/jrpc/jrpc_method.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_CORE_API_JRPC_JRPC_METHOD_HPP
#define KAGOME_CORE_API_JRPC_JRPC_METHOD_HPP
#pragma once

#include <jsonrpc-lean/dispatcher.h>
#include <jsonrpc-lean/request.h>
Expand Down Expand Up @@ -53,5 +53,3 @@ namespace kagome::api {
}
};
} // namespace kagome::api

#endif // KAGOME_CORE_API_JRPC_JRPC_METHOD_HPP
8 changes: 3 additions & 5 deletions core/api/jrpc/jrpc_processor.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_CORE_API_JRPC_JRPC_PROCESSOR_HPP
#define KAGOME_CORE_API_JRPC_JRPC_PROCESSOR_HPP
#pragma once

#include <boost/noncopyable.hpp>
#include <memory>
Expand All @@ -25,5 +25,3 @@ namespace kagome::api {
virtual void registerHandlers() = 0;
};
} // namespace kagome::api

#endif // KAGOME_CORE_API_JRPC_JRPC_PROCESSOR_HPP
8 changes: 3 additions & 5 deletions core/api/jrpc/jrpc_server.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_API_JRPC_SERVER_HPP
#define KAGOME_API_JRPC_SERVER_HPP
#pragma once

#include <functional>

Expand Down Expand Up @@ -79,5 +79,3 @@ namespace kagome::api {
};

} // namespace kagome::api

#endif // KAGOME_API_JRPC_SERVER_HPP
3 changes: 2 additions & 1 deletion core/api/jrpc/jrpc_server_impl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down
8 changes: 3 additions & 5 deletions core/api/jrpc/jrpc_server_impl.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_API_JRPC_SERVER_IMPL_HPP
#define KAGOME_API_JRPC_SERVER_IMPL_HPP
#pragma once

#include <jsonrpc-lean/server.h>

Expand Down Expand Up @@ -59,5 +59,3 @@ namespace kagome::api {
} // namespace kagome::api

OUTCOME_HPP_DECLARE_ERROR(kagome::api, JRpcServerImpl::Error);

#endif // KAGOME_API_JRPC_SERVER_IMPL_HPP
8 changes: 3 additions & 5 deletions core/api/jrpc/value_converter.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_CORE_API_EXTRINSIC_RESPONSE_VALUE_CONVERTER_HPP
#define KAGOME_CORE_API_EXTRINSIC_RESPONSE_VALUE_CONVERTER_HPP
#pragma once

#include <vector>

Expand Down Expand Up @@ -336,5 +336,3 @@ namespace kagome::api {
};
}
} // namespace kagome::api

#endif // KAGOME_CORE_API_EXTRINSIC_RESPONSE_VALUE_CONVERTER_HPP
8 changes: 3 additions & 5 deletions core/api/service/api_service.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* Copyright Quadrivium LLC
* All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef KAGOME_CORE_API_SERVICE_HPP
#define KAGOME_CORE_API_SERVICE_HPP
#pragma once

#include <vector>

Expand Down Expand Up @@ -62,5 +62,3 @@ namespace kagome::api {
PubsubSubscriptionId subscription_id) = 0;
};
} // namespace kagome::api

#endif // KAGOME_CORE_API_SERVICE_HPP
Loading

0 comments on commit b1ef9b6

Please sign in to comment.