Skip to content

Commit

Permalink
Merge pull request #2028 from bitshares/docker_build
Browse files Browse the repository at this point in the history
Simple fix
  • Loading branch information
pmconrad authored Oct 23, 2019
2 parents f182b60 + 2f4e152 commit 2eb65b8
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
3 changes: 2 additions & 1 deletion libraries/protocol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ list(APPEND CUSTOM_AUTHS_FILES
custom_authorities/list_4.cpp
custom_authorities/list_5.cpp
custom_authorities/list_6.cpp
custom_authorities/list_7.cpp)
custom_authorities/list_7.cpp
custom_authorities/list_8.cpp)

add_library( graphene_protocol_custom_auths ${CUSTOM_AUTHS_FILES} )
target_link_libraries( graphene_protocol_custom_auths fc )
Expand Down
41 changes: 41 additions & 0 deletions libraries/protocol/custom_authorities/list_8.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2019 Contributors.
*
* The MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "restriction_predicate.hxx"

namespace graphene { namespace protocol {

using result_type = object_restriction_predicate<operation>;

result_type get_restriction_predicate_list_8(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_8::list(), idx, [&rs] (auto t) -> result_type {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
});
}
} }
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ restriction_predicate_function get_restriction_predicate(vector<restriction> rs,
return get_restriction_predicate_list_6(typelist::index_of<operation_list_6::list, Op>(), std::move(rs));
if (typelist::contains<operation_list_7::list, Op>())
return get_restriction_predicate_list_7(typelist::index_of<operation_list_7::list, Op>(), std::move(rs));
if (typelist::contains<operation_list_8::list, Op>())
return get_restriction_predicate_list_8(typelist::index_of<operation_list_8::list, Op>(), std::move(rs));

// Compile time check that we'll never get to the exception below
static_assert(typelist::contains<typelist::concat<operation_list_1::list, operation_list_2::list,
operation_list_3::list, operation_list_4::list,
operation_list_5::list, operation_list_6::list,
operation_list_7::list>, Op>(), "");
operation_list_7::list, operation_list_8::list>,
Op>(), "");
FC_THROW_EXCEPTION(fc::assert_exception,
"LOGIC ERROR: Operation type not handled by custom authorities implementation. "
"Please report this error.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,10 @@ using operation_list_1 = static_variant<typelist::slice<operation::list, 0, 5>>;
using operation_list_2 = static_variant<typelist::slice<operation::list, 5, 10>>;
using operation_list_3 = static_variant<typelist::slice<operation::list, 10, 20>>;
using operation_list_4 = static_variant<typelist::slice<operation::list, 20, 30>>;
using operation_list_5 = static_variant<typelist::slice<operation::list, 30, 40>>;
using operation_list_6 = static_variant<typelist::slice<operation::list, 40, 50>>;
using operation_list_7 = static_variant<typelist::slice<operation::list, 50>>;
using operation_list_5 = static_variant<typelist::slice<operation::list, 30, 35>>;
using operation_list_6 = static_variant<typelist::slice<operation::list, 35, 40>>;
using operation_list_7 = static_variant<typelist::slice<operation::list, 40, 50>>;
using operation_list_8 = static_variant<typelist::slice<operation::list, 50>>;

object_restriction_predicate<operation> get_restriction_predicate_list_1(size_t idx, vector<restriction> rs);
object_restriction_predicate<operation> get_restriction_predicate_list_2(size_t idx, vector<restriction> rs);
Expand All @@ -605,5 +606,6 @@ object_restriction_predicate<operation> get_restriction_predicate_list_4(size_t
object_restriction_predicate<operation> get_restriction_predicate_list_5(size_t idx, vector<restriction> rs);
object_restriction_predicate<operation> get_restriction_predicate_list_6(size_t idx, vector<restriction> rs);
object_restriction_predicate<operation> get_restriction_predicate_list_7(size_t idx, vector<restriction> rs);
object_restriction_predicate<operation> get_restriction_predicate_list_8(size_t idx, vector<restriction> rs);

} } // namespace graphene::protocol

0 comments on commit 2eb65b8

Please sign in to comment.