Skip to content

Commit

Permalink
Merge Iroha1 develop into main (#3960)
Browse files Browse the repository at this point in the history
Co-authored-by: safinsaf <safinsaft@gmail.com>
Co-authored-by: Grzegorz Bazior (Yodiss PSA) <g.bazior@yodiss.pl>
Co-authored-by: Sudhanshu <76694373+sudhanshu-k@users.noreply.github.com>
Co-authored-by: Roopesh Saravanan <roopeshsaravanan.dev@gmail.com>
Co-authored-by: Vincent Autefage <vincent.autefage@u-bordeaux.fr>
Co-authored-by: G. Bazior <bazior@agh.edu.pl>
  • Loading branch information
7 people committed Oct 24, 2023
1 parent a62d7ea commit 9995600
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 46 deletions.
5 changes: 3 additions & 2 deletions .github/build-iroha1.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ jobs:
true
else
#echo >/tmp/comment_body "/build debug; /build ubuntu release debug normal"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"$'\n' "/build macos debug clang"
fi ;;
push) commit_message_body_build_spec >/tmp/comment_body || {
echo "/build macos ubuntu debug release normal gcc-10"
echo "/build ubuntu debug release normal gcc-10"
} >/tmp/comment_body ;;
workflow_dispatch) echo >/tmp/comment_body "${{github.event.inputs.build_spec}}" ;;
*) echo >&2 "::error::Unexpected event"; false ;;
Expand All @@ -221,6 +221,7 @@ jobs:
id: matrixes
run: |
set -x
cat /tmp/comment_body
cat /tmp/comment_body | .github/chatops-gen-matrix.sh
echo "::set-output name=matrix_ubuntu::$(cat matrix_ubuntu)"
echo "::set-output name=matrix_ubuntu_release::$(cat matrix_ubuntu_release)"
Expand Down
2 changes: 1 addition & 1 deletion .github/chatops-gen-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echoerr(){
readonly ALL_oses="ubuntu macos windows" ALL_build_types="Debug Release" ALL_cmake_opts="normal burrow ursa" ALL_compilers="gcc-9 gcc-10 clang-10 clang llvm msvc"
readonly DEFAULT_oses="ubuntu macos windows" DEFAULT_build_types="Debug" DEFAULT_cmake_opts="normal burrow ursa"
readonly DEFAULT_ubuntu_compilers="gcc-9" AVAILABLE_ubuntu_compilers="gcc-9 gcc-10 clang-10"
readonly DEFAULT_macos_compilers="clang" AVAILABLE_macos_compilers="clang" ## Also "llvm gcc-10" but they fail
readonly DEFAULT_macos_compilers="clang" AVAILABLE_macos_compilers="clang gcc-10" ## Also "llvm gcc-10" but they fail
readonly DEFAULT_windows_compilers="msvc" AVAILABLE_windows_compilers="msvc" ## Also "clang mingw cygwin" but they are redundant

--help-buildspec(){
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-iroha1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ jobs:
true
else
#echo >/tmp/comment_body "/build debug; /build ubuntu release debug normal"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"
echo >/tmp/comment_body "/build ubuntu debug release normal gcc-10"$'\n' "/build macos debug clang"
fi ;;
push) commit_message_body_build_spec >/tmp/comment_body || {
echo "/build macos ubuntu debug release normal gcc-10"
echo "/build ubuntu debug release normal gcc-10"
} >/tmp/comment_body ;;
workflow_dispatch) echo >/tmp/comment_body "${{github.event.inputs.build_spec}}" ;;
*) echo >&2 "::error::Unexpected event"; false ;;
Expand All @@ -235,6 +235,7 @@ jobs:
id: matrixes
run: |
set -x
cat /tmp/comment_body
cat /tmp/comment_body | .github/chatops-gen-matrix.sh
echo "::set-output name=matrix_ubuntu::$(cat matrix_ubuntu)"
echo "::set-output name=matrix_ubuntu_release::$(cat matrix_ubuntu_release)"
Expand Down
2 changes: 1 addition & 1 deletion docs/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To keep things simple, we will use Docker.
Prerequisites
-------------
For this guide, you need a machine with ``Docker`` installed.
You can read how to install it on a `Docker's website <https://www.docker.com/community-edition/>`_.
You can read how to install it on a `Docker's website <https://docs.docker.com/get-docker/>`_.

.. note:: Of course you can build Iroha from scratch, modify its code and launch a customized node!
If you are curious how to do that — you can check :ref:`build-guide` section.
Expand Down
4 changes: 1 addition & 3 deletions goSrc/src/vmCaller/iroha/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ func GetAccountTransactions(accountID string, txPaginationMeta *iroha_model.TxPa
if err != nil {
return []*pb.Transaction{}, err
}
if err != nil {
return []*pb.Transaction{}, err
}

metaPayload := MakeQueryPayloadMeta()
query := &pb.Query{Payload: &pb.Query_Payload{
Meta: &metaPayload,
Expand Down
1 change: 1 addition & 0 deletions iroha-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ iroha_lib::GrpcClient(
- [x] [getAssetInfo](https://iroha.readthedocs.io/en/main/develop/api/queries.html#get-asset-info)
- [x] [getRoles](https://iroha.readthedocs.io/en/main/develop/api/queries.html#get-roles)
- [x] [getRolePermissions](https://iroha.readthedocs.io/en/main/develop/api/queries.html#get-role-permissions)
- [x] [getPeers](https://iroha.readthedocs.io/en/main/develop/api/queries.html#get-peers)


## Compatibility and release policy
Expand Down
78 changes: 41 additions & 37 deletions iroha-lib/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
####### irohalib_tx_example:
add_executable(irohalib_tx_example
TxExample.cpp
)
if (APPLE)
message("iroha-lib does not support MacOS currently!")
else()
###### irohalib_tx_example:
add_executable(irohalib_tx_example
TxExample.cpp
)

target_link_libraries(irohalib_tx_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_tx_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_tx_example)
add_install_step_for_bin(irohalib_tx_example)


####### irohalib_batch_example:
add_executable(irohalib_batch_example
BatchExample.cpp
)
###### irohalib_batch_example:
add_executable(irohalib_batch_example
BatchExample.cpp
)

target_link_libraries(irohalib_batch_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_batch_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_batch_example)
add_install_step_for_bin(irohalib_batch_example)


####### irohalib_query_example:
add_executable(irohalib_query_example
QueryExample.cpp
)
###### irohalib_query_example:
add_executable(irohalib_query_example
QueryExample.cpp
)

target_link_libraries(irohalib_query_example
iroha_lib_model
logger_manager
)
target_link_libraries(irohalib_query_example
iroha_lib_model
logger_manager
)

add_install_step_for_bin(irohalib_query_example)
add_install_step_for_bin(irohalib_query_example)


####### irohalib_domainassetcreation_example:
add_executable(irohalib_domainassetcreation_example
DomainAssetCreation.cpp
)
###### irohalib_domainassetcreation_example:
add_executable(irohalib_domainassetcreation_example
DomainAssetCreation.cpp
)

target_link_libraries(irohalib_domainassetcreation_example
iroha_lib_model
logger_manager
gflags
)
target_link_libraries(irohalib_domainassetcreation_example
iroha_lib_model
logger_manager
gflags
)

add_install_step_for_bin(irohalib_domainassetcreation_example)
add_install_step_for_bin(irohalib_domainassetcreation_example)
endif()
10 changes: 10 additions & 0 deletions iroha-lib/model/Query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ Query& Query::getRolePermissions(
return *this;
}

Query& Query::getPeers(const std::string& account_id)
{
protobuf_query_ = *query_generator_.generateGetPeers(
account_id,
counter_,
created_time_);
return *this;
}


const iroha::protocol::Query Query::signAndAddSignature()
{
auto signature = iroha::sign(
Expand Down
1 change: 1 addition & 0 deletions iroha-lib/model/Query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Query {
Query& getRolePermissions(
const std::string& account_id,
const std::string& role_id);
Query& getPeers(const std::string& account_id);

const iroha::protocol::Query signAndAddSignature();

Expand Down
11 changes: 11 additions & 0 deletions iroha-lib/model/Tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ Tx& Tx::removePeer(const std::string& pubkey)
return *this;
}

Tx& Tx::removeSignatory(
const std::string& account_id,
const std::string& pubkey)
{
auto cmd = cmd_generator_.generateRemoveSignatory(
account_id,
pubkey);
addCommand(*cmd);
return *this;
}

Tx& Tx::revokePermission(
const std::string& account_id,
const iroha::protocol::GrantablePermission permission)
Expand Down
13 changes: 13 additions & 0 deletions iroha-lib/model/generators/QueryGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,17 @@ std::shared_ptr<iroha::protocol::Query> QueryGenerator::generateGetRolePermissio
return query;
}

std::shared_ptr<iroha::protocol::Query> QueryGenerator::generateGetPeers(
const std::string& account_id,
uint64_t counter,
const uint64_t created_time)
{
auto query = generateQuery(
account_id,
counter,
created_time);
query->mutable_payload()->mutable_get_peers();
return query;
}

}
4 changes: 4 additions & 0 deletions iroha-lib/model/generators/QueryGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ class QueryGenerator {
uint64_t counter,
const uint64_t created_time,
const std::string& role_id);
std::shared_ptr<iroha::protocol::Query> generateGetPeers(
const std::string& account_id,
uint64_t counter,
const uint64_t created_time);

private:
std::shared_ptr<iroha::protocol::Query> generateQuery(
Expand Down
38 changes: 38 additions & 0 deletions vcpkg/patches/0014-gtest-remove-werror-compile-flag.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/ports/gtest/portfile.cmake b/ports/gtest/portfile.cmake
index 11ac1140a..5226367cd 100644
--- a/ports/gtest/portfile.cmake
+++ b/ports/gtest/portfile.cmake
@@ -12,6 +12,7 @@ vcpkg_from_github(
0002-Fix-z7-override.patch
fix-main-lib-path.patch
fix-build-failure-in-gcc-11.patch
+ removing-werror-compiler-flag.patch
)

string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" GTEST_FORCE_SHARED_CRT)
diff --git a/ports/gtest/removing-werror-compiler-flag.patch b/ports/gtest/removing-werror-compiler-flag.patch
new file mode 100644
index 000000000..2b7339da4
--- /dev/null
+++ b/ports/gtest/removing-werror-compiler-flag.patch
@@ -0,0 +1,20 @@
+diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
+index 4439cb9..e385a5a 100644
+--- a/googletest/cmake/internal_utils.cmake
++++ b/googletest/cmake/internal_utils.cmake
+@@ -82,13 +82,13 @@ macro(config_compiler_and_linker)
+ # http://stackoverflow.com/questions/3232669 explains the issue.
+ set(cxx_base_flags "${cxx_base_flags} -wd4702")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+- set(cxx_base_flags "-Wall -Wshadow -Werror -Wconversion")
++ set(cxx_base_flags "-Wall -Wshadow -Wconversion")
+ set(cxx_exception_flags "-fexceptions")
+ set(cxx_no_exception_flags "-fno-exceptions")
+ set(cxx_strict_flags "-W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls")
+ set(cxx_no_rtti_flags "-fno-rtti")
+ elseif (CMAKE_COMPILER_IS_GNUCXX)
+- set(cxx_base_flags "-Wall -Wshadow -Werror")
++ set(cxx_base_flags "-Wall -Wshadow")
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
+ set(cxx_base_flags "${cxx_base_flags} -Wno-error=dangling-else")
+ endif()

0 comments on commit 9995600

Please sign in to comment.