From 4e3e0e010ae0848c533f57b91337e0cdcc03936a Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Tue, 25 Aug 2020 13:01:51 -0500 Subject: [PATCH] Final fixes Last round of fixes following the rebase to Beatrice --- .gitmodules | 2 +- libraries/chain/CMakeLists.txt | 6 ++++ libraries/chain/db_block.cpp | 2 ++ .../custom_account_authority_evaluator.hpp | 5 +-- .../chain/custom_account_authority_object.hpp | 8 +++-- .../chain/custom_permission_evaluator.hpp | 6 ++-- .../chain/custom_permission_object.hpp | 11 +++++-- .../include/graphene/chain/nft_evaluator.hpp | 5 +-- .../include/graphene/chain/nft_object.hpp | 9 ++++-- .../graphene/chain/offer_evaluator.hpp | 3 +- .../include/graphene/chain/offer_object.hpp | 9 +++++- libraries/chain/offer_evaluator.cpp | 3 +- libraries/protocol/CMakeLists.txt | 1 + .../protocol/custom_account_authority.cpp | 8 ++--- libraries/protocol/custom_permission.cpp | 8 ++--- .../include/graphene/protocol/base.hpp | 1 + .../graphene/protocol/betting_market.hpp | 1 - .../include/graphene/protocol/config.hpp | 21 ++++++------ .../protocol/custom_account_authority.hpp | 18 +++++------ .../graphene/protocol/custom_permission.hpp | 19 +++++------ .../include/graphene/protocol/event.hpp | 1 - .../include/graphene/protocol/event_group.hpp | 1 - .../include/graphene/protocol/lottery_ops.hpp | 1 - .../include/graphene/protocol/nft_ops.hpp | 32 +++++++++---------- .../include/graphene/protocol/object_id.hpp | 1 - .../include/graphene/protocol/offer.hpp | 26 +++++++-------- .../include/graphene/protocol/sport.hpp | 1 - .../include/graphene/protocol/tournament.hpp | 1 - .../include/graphene/protocol/types.hpp | 2 +- libraries/protocol/nft.cpp | 8 ++--- libraries/protocol/offer.cpp | 8 ++--- programs/build_helpers/member_enumerator.cpp | 4 +-- tests/tests/custom_permission_tests.cpp | 7 ++-- 33 files changed, 135 insertions(+), 104 deletions(-) diff --git a/.gitmodules b/.gitmodules index 4d3518d1..495183b6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,6 @@ ignore = dirty [submodule "libraries/fc"] path = libraries/fc - url = https://github.com/peerplays-network/peerplays-fc.git + url = https://github.com/nathanhourt/peerplays-fc branch = latest-fc ignore = dirty diff --git a/libraries/chain/CMakeLists.txt b/libraries/chain/CMakeLists.txt index 7901308b..f4c72289 100644 --- a/libraries/chain/CMakeLists.txt +++ b/libraries/chain/CMakeLists.txt @@ -80,9 +80,15 @@ add_library( graphene_chain betting_market_evaluator.cpp betting_market_object.cpp betting_market_group_object.cpp + custom_permission_evaluator.cpp + custom_account_authority_evaluator.cpp affiliate_payout.cpp + offer_object.cpp + offer_evaluator.cpp + nft_evaluator.cpp + ${HEADERS} "${CMAKE_CURRENT_BINARY_DIR}/include/graphene/chain/hardfork.hpp" ) diff --git a/libraries/chain/db_block.cpp b/libraries/chain/db_block.cpp index 41821baf..a4688471 100644 --- a/libraries/chain/db_block.cpp +++ b/libraries/chain/db_block.cpp @@ -41,6 +41,8 @@ #include #include +#include + namespace { struct proposed_operations_digest_accumulator diff --git a/libraries/chain/include/graphene/chain/custom_account_authority_evaluator.hpp b/libraries/chain/include/graphene/chain/custom_account_authority_evaluator.hpp index 3fe1f6f9..1ca2f0bb 100644 --- a/libraries/chain/include/graphene/chain/custom_account_authority_evaluator.hpp +++ b/libraries/chain/include/graphene/chain/custom_account_authority_evaluator.hpp @@ -1,6 +1,7 @@ #pragma once #include -#include + +#include namespace graphene { @@ -35,4 +36,4 @@ public: }; } // namespace chain -} // namespace graphene \ No newline at end of file +} // namespace graphene diff --git a/libraries/chain/include/graphene/chain/custom_account_authority_object.hpp b/libraries/chain/include/graphene/chain/custom_account_authority_object.hpp index acca8bcf..6bbf39c0 100644 --- a/libraries/chain/include/graphene/chain/custom_account_authority_object.hpp +++ b/libraries/chain/include/graphene/chain/custom_account_authority_object.hpp @@ -1,5 +1,6 @@ #pragma once -#include +#include + #include #include @@ -23,7 +24,6 @@ namespace graphene { namespace chain { time_point_sec valid_to; }; - struct by_id; struct by_permission_and_op; struct by_expiration; using custom_account_authority_multi_index_type = multi_index_container< @@ -51,5 +51,7 @@ namespace graphene { namespace chain { } } // graphene::chain +MAP_OBJECT_ID_TO_TYPE(graphene::chain::custom_account_authority_object) + FC_REFLECT_DERIVED( graphene::chain::custom_account_authority_object, (graphene::db::object), - (permission_id)(operation_type)(valid_from)(valid_to) ) \ No newline at end of file + (permission_id)(operation_type)(valid_from)(valid_to) ) diff --git a/libraries/chain/include/graphene/chain/custom_permission_evaluator.hpp b/libraries/chain/include/graphene/chain/custom_permission_evaluator.hpp index c9bc2801..9c1043ff 100644 --- a/libraries/chain/include/graphene/chain/custom_permission_evaluator.hpp +++ b/libraries/chain/include/graphene/chain/custom_permission_evaluator.hpp @@ -1,6 +1,8 @@ #pragma once + #include -#include + +#include namespace graphene { @@ -35,4 +37,4 @@ public: }; } // namespace chain -} // namespace graphene \ No newline at end of file +} // namespace graphene diff --git a/libraries/chain/include/graphene/chain/custom_permission_object.hpp b/libraries/chain/include/graphene/chain/custom_permission_object.hpp index 72789ef4..29b28f9f 100644 --- a/libraries/chain/include/graphene/chain/custom_permission_object.hpp +++ b/libraries/chain/include/graphene/chain/custom_permission_object.hpp @@ -1,5 +1,9 @@ #pragma once -#include + +#include + +#include + #include #include @@ -25,7 +29,6 @@ namespace graphene { namespace chain { authority auth; }; - struct by_id; struct by_account_and_permission; using custom_permission_multi_index_type = multi_index_container< custom_permission_object, @@ -45,5 +48,7 @@ namespace graphene { namespace chain { } } // graphene::chain +MAP_OBJECT_ID_TO_TYPE(graphene::chain::custom_permission_object) + FC_REFLECT_DERIVED( graphene::chain::custom_permission_object, (graphene::db::object), - (account)(permission_name)(auth) ) \ No newline at end of file + (account)(permission_name)(auth) ) diff --git a/libraries/chain/include/graphene/chain/nft_evaluator.hpp b/libraries/chain/include/graphene/chain/nft_evaluator.hpp index 0d0f5f51..a75cc44b 100644 --- a/libraries/chain/include/graphene/chain/nft_evaluator.hpp +++ b/libraries/chain/include/graphene/chain/nft_evaluator.hpp @@ -2,8 +2,9 @@ #include #include -#include -#include + +#include +#include namespace graphene { namespace chain { diff --git a/libraries/chain/include/graphene/chain/nft_object.hpp b/libraries/chain/include/graphene/chain/nft_object.hpp index 1994a92e..d5ffe09a 100644 --- a/libraries/chain/include/graphene/chain/nft_object.hpp +++ b/libraries/chain/include/graphene/chain/nft_object.hpp @@ -1,5 +1,7 @@ #pragma once -#include + +#include + #include #include @@ -10,7 +12,7 @@ namespace graphene { namespace chain { { public: static const uint8_t space_id = protocol_ids; - static const uint8_t type_id = nft_metadata_type; + static const uint8_t type_id = nft_metadata_object_type; account_id_type owner; std::string name; @@ -87,6 +89,9 @@ namespace graphene { namespace chain { } } // graphene::chain +MAP_OBJECT_ID_TO_TYPE(graphene::chain::nft_metadata_object) +MAP_OBJECT_ID_TO_TYPE(graphene::chain::nft_object) + FC_REFLECT_DERIVED( graphene::chain::nft_metadata_object, (graphene::db::object), (owner) (name) diff --git a/libraries/chain/include/graphene/chain/offer_evaluator.hpp b/libraries/chain/include/graphene/chain/offer_evaluator.hpp index 46f7045b..5d779cd6 100644 --- a/libraries/chain/include/graphene/chain/offer_evaluator.hpp +++ b/libraries/chain/include/graphene/chain/offer_evaluator.hpp @@ -1,7 +1,8 @@ -#include #include #include +#include + namespace graphene { namespace chain diff --git a/libraries/chain/include/graphene/chain/offer_object.hpp b/libraries/chain/include/graphene/chain/offer_object.hpp index fe176332..cb6440c8 100644 --- a/libraries/chain/include/graphene/chain/offer_object.hpp +++ b/libraries/chain/include/graphene/chain/offer_object.hpp @@ -1,5 +1,9 @@ #pragma once -#include + +#include + +#include + #include namespace graphene @@ -99,6 +103,9 @@ namespace graphene } // namespace chain } // namespace graphene +MAP_OBJECT_ID_TO_TYPE(graphene::chain::offer_object) +MAP_OBJECT_ID_TO_TYPE(graphene::chain::offer_history_object) + FC_REFLECT_DERIVED(graphene::chain::offer_object, (graphene::db::object), (issuer)(item_ids)(bidder)(bid_price)(minimum_price)( maximum_price)(buying_item)(offer_expiration_date)) diff --git a/libraries/chain/offer_evaluator.cpp b/libraries/chain/offer_evaluator.cpp index 0d1b1947..c91e79ed 100644 --- a/libraries/chain/offer_evaluator.cpp +++ b/libraries/chain/offer_evaluator.cpp @@ -83,7 +83,6 @@ namespace graphene auto now = d.head_block_time(); FC_ASSERT(now >= HARDFORK_NFT_TIME, "Not allowed until NFT HF"); const auto &offer = op.offer_id(d); - op.bidder(d); for (const auto &item : offer.item_ids) { const auto &nft_obj = item(d); @@ -335,4 +334,4 @@ namespace graphene FC_CAPTURE_AND_RETHROW((op)) } } // namespace chain -} // namespace graphene \ No newline at end of file +} // namespace graphene diff --git a/libraries/protocol/CMakeLists.txt b/libraries/protocol/CMakeLists.txt index a814ba2a..0fb7b64b 100644 --- a/libraries/protocol/CMakeLists.txt +++ b/libraries/protocol/CMakeLists.txt @@ -37,6 +37,7 @@ list(APPEND SOURCES account.cpp custom_permission.cpp custom_account_authority.cpp offer.cpp + nft.cpp ) diff --git a/libraries/protocol/custom_account_authority.cpp b/libraries/protocol/custom_account_authority.cpp index a74234d7..eaf939bc 100644 --- a/libraries/protocol/custom_account_authority.cpp +++ b/libraries/protocol/custom_account_authority.cpp @@ -1,9 +1,9 @@ -#include -#include +#include +#include namespace graphene { -namespace chain +namespace protocol { void custom_account_authority_create_operation::validate() const @@ -39,5 +39,5 @@ share_type custom_account_authority_create_operation::calculate_fee(const fee_pa return k.fee + calculate_data_fee( fc::raw::pack_size(*this), k.price_per_kbyte ); } -} // namespace chain +} // namespace protocol } // namespace graphene diff --git a/libraries/protocol/custom_permission.cpp b/libraries/protocol/custom_permission.cpp index c0919cbd..5084bf0b 100644 --- a/libraries/protocol/custom_permission.cpp +++ b/libraries/protocol/custom_permission.cpp @@ -1,9 +1,9 @@ -#include -#include +#include +#include namespace graphene { -namespace chain +namespace protocol { bool is_valid_permission_name(const string &name) @@ -81,5 +81,5 @@ share_type custom_permission_create_operation::calculate_fee(const fee_parameter return k.fee + calculate_data_fee( fc::raw::pack_size(*this), k.price_per_kbyte ); } -} // namespace chain +} // namespace protocol } // namespace graphene diff --git a/libraries/protocol/include/graphene/protocol/base.hpp b/libraries/protocol/include/graphene/protocol/base.hpp index faef9b09..73d60eab 100644 --- a/libraries/protocol/include/graphene/protocol/base.hpp +++ b/libraries/protocol/include/graphene/protocol/base.hpp @@ -25,6 +25,7 @@ #include #include +#include #include diff --git a/libraries/protocol/include/graphene/protocol/betting_market.hpp b/libraries/protocol/include/graphene/protocol/betting_market.hpp index 306840ab..e1d804d5 100644 --- a/libraries/protocol/include/graphene/protocol/betting_market.hpp +++ b/libraries/protocol/include/graphene/protocol/betting_market.hpp @@ -25,7 +25,6 @@ #include #include -#include namespace graphene { namespace protocol { diff --git a/libraries/protocol/include/graphene/protocol/config.hpp b/libraries/protocol/include/graphene/protocol/config.hpp index fe18aa9a..8a7a911d 100644 --- a/libraries/protocol/include/graphene/protocol/config.hpp +++ b/libraries/protocol/include/graphene/protocol/config.hpp @@ -152,21 +152,21 @@ */ ///@{ /// Represents the current committee members, two-week review period -#define GRAPHENE_COMMITTEE_ACCOUNT (graphene::chain::account_id_type(0)) +#define GRAPHENE_COMMITTEE_ACCOUNT (graphene::protocol::account_id_type(0)) /// Represents the current witnesses -#define GRAPHENE_WITNESS_ACCOUNT (graphene::chain::account_id_type(1)) +#define GRAPHENE_WITNESS_ACCOUNT (graphene::protocol::account_id_type(1)) /// Represents the current committee members -#define GRAPHENE_RELAXED_COMMITTEE_ACCOUNT (graphene::chain::account_id_type(2)) +#define GRAPHENE_RELAXED_COMMITTEE_ACCOUNT (graphene::protocol::account_id_type(2)) /// Represents the canonical account with NO authority (nobody can access funds in null account) -#define GRAPHENE_NULL_ACCOUNT (graphene::chain::account_id_type(3)) +#define GRAPHENE_NULL_ACCOUNT (graphene::protocol::account_id_type(3)) /// Represents the canonical account with WILDCARD authority (anybody can access funds in temp account) -#define GRAPHENE_TEMP_ACCOUNT (graphene::chain::account_id_type(4)) +#define GRAPHENE_TEMP_ACCOUNT (graphene::protocol::account_id_type(4)) /// Represents the canonical account for specifying you will vote directly (as opposed to a proxy) -#define GRAPHENE_PROXY_TO_SELF_ACCOUNT (graphene::chain::account_id_type(5)) +#define GRAPHENE_PROXY_TO_SELF_ACCOUNT (graphene::protocol::account_id_type(5)) /// -#define GRAPHENE_RAKE_FEE_ACCOUNT_ID (graphene::chain::account_id_type(6)) +#define GRAPHENE_RAKE_FEE_ACCOUNT_ID (graphene::protocol::account_id_type(6)) /// Sentinel value used in the scheduler. -#define GRAPHENE_NULL_WITNESS (graphene::chain::witness_id_type(0)) +#define GRAPHENE_NULL_WITNESS (graphene::protocol::witness_id_type(0)) ///@} #define GRAPHENE_FBA_STEALTH_DESIGNATED_ASSET (asset_id_type(743)) @@ -219,9 +219,10 @@ #define TOURNAMENT_MAX_START_TIME_IN_FUTURE (60*60*24*7*4) // 1 month #define TOURNAMENT_MAX_START_DELAY (60*60*24*7) // 1 week #define SWEEPS_DEFAULT_DISTRIBUTION_PERCENTAGE (2*GRAPHENE_1_PERCENT) -#define SWEEPS_DEFAULT_DISTRIBUTION_ASSET (graphene::chain::asset_id_type(0)) +#define SWEEPS_DEFAULT_DISTRIBUTION_ASSET (graphene::protocol::asset_id_type(0)) #define SWEEPS_VESTING_BALANCE_MULTIPLIER 100000000 -#define SWEEPS_ACCUMULATOR_ACCOUNT (graphene::chain::account_id_type(0)) +#define SWEEPS_ACCUMULATOR_ACCOUNT (graphene::protocol::account_id_type(0)) +#define GPOS_PERIOD_START (fc::time_point_sec(1578272400)) #define GPOS_PERIOD (60*60*24*30*6) // 6 months #define GPOS_SUBPERIOD (60*60*24*30) // 1 month #define GPOS_VESTING_LOCKIN_PERIOD (60*60*24*30) // 1 month diff --git a/libraries/protocol/include/graphene/protocol/custom_account_authority.hpp b/libraries/protocol/include/graphene/protocol/custom_account_authority.hpp index f5f8c1cd..2d6b353e 100644 --- a/libraries/protocol/include/graphene/protocol/custom_account_authority.hpp +++ b/libraries/protocol/include/graphene/protocol/custom_account_authority.hpp @@ -1,9 +1,9 @@ #pragma once -#include +#include namespace graphene { -namespace chain +namespace protocol { struct custom_account_authority_create_operation : public base_operation @@ -60,14 +60,14 @@ struct custom_account_authority_delete_operation : public base_operation share_type calculate_fee(const fee_parameters_type &k) const { return k.fee; } }; -} // namespace chain +} // namespace protocol } // namespace graphene -FC_REFLECT(graphene::chain::custom_account_authority_create_operation::fee_parameters_type, (fee)(price_per_kbyte)) -FC_REFLECT(graphene::chain::custom_account_authority_create_operation, (fee)(permission_id)(operation_type)(valid_from)(valid_to)(owner_account)) +FC_REFLECT(graphene::protocol::custom_account_authority_create_operation::fee_parameters_type, (fee)(price_per_kbyte)) +FC_REFLECT(graphene::protocol::custom_account_authority_create_operation, (fee)(permission_id)(operation_type)(valid_from)(valid_to)(owner_account)) -FC_REFLECT(graphene::chain::custom_account_authority_update_operation::fee_parameters_type, (fee)) -FC_REFLECT(graphene::chain::custom_account_authority_update_operation, (fee)(auth_id)(new_valid_from)(new_valid_to)(owner_account)) +FC_REFLECT(graphene::protocol::custom_account_authority_update_operation::fee_parameters_type, (fee)) +FC_REFLECT(graphene::protocol::custom_account_authority_update_operation, (fee)(auth_id)(new_valid_from)(new_valid_to)(owner_account)) -FC_REFLECT(graphene::chain::custom_account_authority_delete_operation::fee_parameters_type, (fee)) -FC_REFLECT(graphene::chain::custom_account_authority_delete_operation, (fee)(auth_id)(owner_account)) \ No newline at end of file +FC_REFLECT(graphene::protocol::custom_account_authority_delete_operation::fee_parameters_type, (fee)) +FC_REFLECT(graphene::protocol::custom_account_authority_delete_operation, (fee)(auth_id)(owner_account)) diff --git a/libraries/protocol/include/graphene/protocol/custom_permission.hpp b/libraries/protocol/include/graphene/protocol/custom_permission.hpp index 8093ef07..6c708bcf 100644 --- a/libraries/protocol/include/graphene/protocol/custom_permission.hpp +++ b/libraries/protocol/include/graphene/protocol/custom_permission.hpp @@ -1,9 +1,10 @@ #pragma once -#include +#include +#include namespace graphene { -namespace chain +namespace protocol { struct custom_permission_create_operation : public base_operation @@ -57,14 +58,14 @@ struct custom_permission_delete_operation : public base_operation share_type calculate_fee(const fee_parameters_type &k) const { return k.fee; } }; -} // namespace chain +} // namespace protocol } // namespace graphene -FC_REFLECT(graphene::chain::custom_permission_create_operation::fee_parameters_type, (fee)(price_per_kbyte)) -FC_REFLECT(graphene::chain::custom_permission_create_operation, (fee)(owner_account)(permission_name)(auth)) +FC_REFLECT(graphene::protocol::custom_permission_create_operation::fee_parameters_type, (fee)(price_per_kbyte)) +FC_REFLECT(graphene::protocol::custom_permission_create_operation, (fee)(owner_account)(permission_name)(auth)) -FC_REFLECT(graphene::chain::custom_permission_update_operation::fee_parameters_type, (fee)) -FC_REFLECT(graphene::chain::custom_permission_update_operation, (fee)(permission_id)(new_auth)(owner_account)) +FC_REFLECT(graphene::protocol::custom_permission_update_operation::fee_parameters_type, (fee)) +FC_REFLECT(graphene::protocol::custom_permission_update_operation, (fee)(permission_id)(new_auth)(owner_account)) -FC_REFLECT(graphene::chain::custom_permission_delete_operation::fee_parameters_type, (fee)) -FC_REFLECT(graphene::chain::custom_permission_delete_operation, (fee)(permission_id)(owner_account)) \ No newline at end of file +FC_REFLECT(graphene::protocol::custom_permission_delete_operation::fee_parameters_type, (fee)) +FC_REFLECT(graphene::protocol::custom_permission_delete_operation, (fee)(permission_id)(owner_account)) diff --git a/libraries/protocol/include/graphene/protocol/event.hpp b/libraries/protocol/include/graphene/protocol/event.hpp index fdf2e74d..75012733 100644 --- a/libraries/protocol/include/graphene/protocol/event.hpp +++ b/libraries/protocol/include/graphene/protocol/event.hpp @@ -25,7 +25,6 @@ #include #include -#include namespace graphene { namespace protocol { diff --git a/libraries/protocol/include/graphene/protocol/event_group.hpp b/libraries/protocol/include/graphene/protocol/event_group.hpp index 9b21f057..daf8676d 100644 --- a/libraries/protocol/include/graphene/protocol/event_group.hpp +++ b/libraries/protocol/include/graphene/protocol/event_group.hpp @@ -25,7 +25,6 @@ #include #include -#include namespace graphene { namespace protocol { diff --git a/libraries/protocol/include/graphene/protocol/lottery_ops.hpp b/libraries/protocol/include/graphene/protocol/lottery_ops.hpp index 4dc65632..22e81d44 100644 --- a/libraries/protocol/include/graphene/protocol/lottery_ops.hpp +++ b/libraries/protocol/include/graphene/protocol/lottery_ops.hpp @@ -23,7 +23,6 @@ */ #pragma once #include -#include namespace graphene { namespace protocol { diff --git a/libraries/protocol/include/graphene/protocol/nft_ops.hpp b/libraries/protocol/include/graphene/protocol/nft_ops.hpp index 41e77b06..f5235661 100644 --- a/libraries/protocol/include/graphene/protocol/nft_ops.hpp +++ b/libraries/protocol/include/graphene/protocol/nft_ops.hpp @@ -1,8 +1,8 @@ #pragma once -#include -#include +#include +#include -namespace graphene { namespace chain { +namespace graphene { namespace protocol { struct nft_metadata_create_operation : public base_operation { @@ -117,19 +117,19 @@ namespace graphene { namespace chain { share_type calculate_fee(const fee_parameters_type &k) const; }; -} } // graphene::chain +} } // graphene::protocol -FC_REFLECT( graphene::chain::nft_metadata_create_operation::fee_parameters_type, (fee) (price_per_kbyte) ) -FC_REFLECT( graphene::chain::nft_metadata_update_operation::fee_parameters_type, (fee) ) -FC_REFLECT( graphene::chain::nft_mint_operation::fee_parameters_type, (fee) (price_per_kbyte) ) -FC_REFLECT( graphene::chain::nft_safe_transfer_from_operation::fee_parameters_type, (fee) (price_per_kbyte) ) -FC_REFLECT( graphene::chain::nft_approve_operation::fee_parameters_type, (fee) ) -FC_REFLECT( graphene::chain::nft_set_approval_for_all_operation::fee_parameters_type, (fee) ) +FC_REFLECT( graphene::protocol::nft_metadata_create_operation::fee_parameters_type, (fee) (price_per_kbyte) ) +FC_REFLECT( graphene::protocol::nft_metadata_update_operation::fee_parameters_type, (fee) ) +FC_REFLECT( graphene::protocol::nft_mint_operation::fee_parameters_type, (fee) (price_per_kbyte) ) +FC_REFLECT( graphene::protocol::nft_safe_transfer_from_operation::fee_parameters_type, (fee) (price_per_kbyte) ) +FC_REFLECT( graphene::protocol::nft_approve_operation::fee_parameters_type, (fee) ) +FC_REFLECT( graphene::protocol::nft_set_approval_for_all_operation::fee_parameters_type, (fee) ) -FC_REFLECT( graphene::chain::nft_metadata_create_operation, (fee) (owner) (name) (symbol) (base_uri) (revenue_partner) (revenue_split) (is_transferable) (is_sellable) ) -FC_REFLECT( graphene::chain::nft_metadata_update_operation, (fee) (owner) (nft_metadata_id) (name) (symbol) (base_uri) (revenue_partner) (revenue_split) (is_transferable) (is_sellable) ) -FC_REFLECT( graphene::chain::nft_mint_operation, (fee) (payer) (nft_metadata_id) (owner) (approved) (approved_operators) (token_uri) ) -FC_REFLECT( graphene::chain::nft_safe_transfer_from_operation, (fee) (operator_) (from) (to) (token_id) (data) ) -FC_REFLECT( graphene::chain::nft_approve_operation, (fee) (operator_) (approved) (token_id) ) -FC_REFLECT( graphene::chain::nft_set_approval_for_all_operation, (fee) (owner) (operator_) (approved) ) +FC_REFLECT( graphene::protocol::nft_metadata_create_operation, (fee) (owner) (name) (symbol) (base_uri) (revenue_partner) (revenue_split) (is_transferable) (is_sellable) ) +FC_REFLECT( graphene::protocol::nft_metadata_update_operation, (fee) (owner) (nft_metadata_id) (name) (symbol) (base_uri) (revenue_partner) (revenue_split) (is_transferable) (is_sellable) ) +FC_REFLECT( graphene::protocol::nft_mint_operation, (fee) (payer) (nft_metadata_id) (owner) (approved) (approved_operators) (token_uri) ) +FC_REFLECT( graphene::protocol::nft_safe_transfer_from_operation, (fee) (operator_) (from) (to) (token_id) (data) ) +FC_REFLECT( graphene::protocol::nft_approve_operation, (fee) (operator_) (approved) (token_id) ) +FC_REFLECT( graphene::protocol::nft_set_approval_for_all_operation, (fee) (owner) (operator_) (approved) ) diff --git a/libraries/protocol/include/graphene/protocol/object_id.hpp b/libraries/protocol/include/graphene/protocol/object_id.hpp index 7471ff6a..b641e760 100644 --- a/libraries/protocol/include/graphene/protocol/object_id.hpp +++ b/libraries/protocol/include/graphene/protocol/object_id.hpp @@ -34,7 +34,6 @@ namespace graphene { namespace db { using fc::flat_map; using fc::variant; using fc::unsigned_int; - using fc::signed_int; struct object_id_type { diff --git a/libraries/protocol/include/graphene/protocol/offer.hpp b/libraries/protocol/include/graphene/protocol/offer.hpp index 2bf3dfc2..d5a890fd 100644 --- a/libraries/protocol/include/graphene/protocol/offer.hpp +++ b/libraries/protocol/include/graphene/protocol/offer.hpp @@ -1,10 +1,10 @@ #pragma once -#include -#include +#include +#include namespace graphene { - namespace chain + namespace protocol { /* @@ -118,26 +118,26 @@ namespace graphene share_type calculate_fee(const fee_parameters_type &k) const; }; - } // namespace chain + } // namespace protocol } // namespace graphene -FC_REFLECT(graphene::chain::offer_operation::fee_parameters_type, +FC_REFLECT(graphene::protocol::offer_operation::fee_parameters_type, (fee)(price_per_kbyte)); -FC_REFLECT(graphene::chain::offer_operation, +FC_REFLECT(graphene::protocol::offer_operation, (fee)(item_ids)(issuer)(minimum_price)(maximum_price)(buying_item)(offer_expiration_date)(memo)(extensions)); -FC_REFLECT(graphene::chain::bid_operation::fee_parameters_type, +FC_REFLECT(graphene::protocol::bid_operation::fee_parameters_type, (fee)); -FC_REFLECT(graphene::chain::bid_operation, +FC_REFLECT(graphene::protocol::bid_operation, (fee)(bidder)(bid_price)(offer_id)(extensions)); -FC_REFLECT(graphene::chain::cancel_offer_operation::fee_parameters_type, +FC_REFLECT(graphene::protocol::cancel_offer_operation::fee_parameters_type, (fee)); -FC_REFLECT(graphene::chain::cancel_offer_operation, +FC_REFLECT(graphene::protocol::cancel_offer_operation, (fee)(issuer)(offer_id)(extensions)); -FC_REFLECT_ENUM(graphene::chain::result_type, (Expired)(ExpiredNoBid)(Cancelled)); -FC_REFLECT(graphene::chain::finalize_offer_operation::fee_parameters_type, +FC_REFLECT_ENUM(graphene::protocol::result_type, (Expired)(ExpiredNoBid)(Cancelled)); +FC_REFLECT(graphene::protocol::finalize_offer_operation::fee_parameters_type, (fee)); -FC_REFLECT(graphene::chain::finalize_offer_operation, +FC_REFLECT(graphene::protocol::finalize_offer_operation, (fee)(fee_paying_account)(offer_id)(result)(extensions)); diff --git a/libraries/protocol/include/graphene/protocol/sport.hpp b/libraries/protocol/include/graphene/protocol/sport.hpp index f0a644e1..cdb64984 100644 --- a/libraries/protocol/include/graphene/protocol/sport.hpp +++ b/libraries/protocol/include/graphene/protocol/sport.hpp @@ -25,7 +25,6 @@ #include #include -#include namespace graphene { namespace protocol { diff --git a/libraries/protocol/include/graphene/protocol/tournament.hpp b/libraries/protocol/include/graphene/protocol/tournament.hpp index 09b5d37a..6eebece2 100644 --- a/libraries/protocol/include/graphene/protocol/tournament.hpp +++ b/libraries/protocol/include/graphene/protocol/tournament.hpp @@ -30,7 +30,6 @@ #include #include -#include #include #include diff --git a/libraries/protocol/include/graphene/protocol/types.hpp b/libraries/protocol/include/graphene/protocol/types.hpp index 94ea006e..35fdf3a2 100644 --- a/libraries/protocol/include/graphene/protocol/types.hpp +++ b/libraries/protocol/include/graphene/protocol/types.hpp @@ -262,7 +262,7 @@ GRAPHENE_DEFINE_IDS(protocol, protocol_ids, /*protocol objects are not prefixed* (custom_permission) (custom_account_authority) (offer) - (nft_metadata_type) + (nft_metadata) (nft)) FC_REFLECT(graphene::protocol::public_key_type, (key_data)) diff --git a/libraries/protocol/nft.cpp b/libraries/protocol/nft.cpp index 802bf425..be7cce32 100644 --- a/libraries/protocol/nft.cpp +++ b/libraries/protocol/nft.cpp @@ -1,9 +1,9 @@ -#include -#include +#include +#include namespace graphene { -namespace chain +namespace protocol { bool is_valid_nft_token_name(const string &name) @@ -95,5 +95,5 @@ share_type nft_set_approval_for_all_operation::calculate_fee(const fee_parameter return k.fee; } -} // namespace chain +} // namespace protocol } // namespace graphene diff --git a/libraries/protocol/offer.cpp b/libraries/protocol/offer.cpp index e83af3f8..aefb813e 100644 --- a/libraries/protocol/offer.cpp +++ b/libraries/protocol/offer.cpp @@ -1,9 +1,9 @@ -#include +#include #include namespace graphene { - namespace chain + namespace protocol { share_type offer_operation::calculate_fee(const fee_parameters_type &schedule) const { @@ -53,5 +53,5 @@ namespace graphene return core_fee_required; } - } // namespace chain -} // namespace graphene \ No newline at end of file + } // namespace protocol +} // namespace graphene diff --git a/programs/build_helpers/member_enumerator.cpp b/programs/build_helpers/member_enumerator.cpp index e7c44301..232d994f 100644 --- a/programs/build_helpers/member_enumerator.cpp +++ b/programs/build_helpers/member_enumerator.cpp @@ -140,7 +140,7 @@ struct if_enum } }; -template +template struct if_reflected { template< typename T > @@ -152,7 +152,7 @@ struct if_reflected }; template<> -struct if_reflected +struct if_reflected { template< typename T > static void process_class( class_processor* proc, const T* dummy ) diff --git a/tests/tests/custom_permission_tests.cpp b/tests/tests/custom_permission_tests.cpp index 4aad1897..030ad97f 100644 --- a/tests/tests/custom_permission_tests.cpp +++ b/tests/tests/custom_permission_tests.cpp @@ -1,7 +1,5 @@ -#include #include #include -#include #include #include @@ -13,7 +11,12 @@ #include +#include + #include + +#include + #include "../common/database_fixture.hpp" using namespace graphene::chain;