diff --git a/libraries/chain/include/graphene/chain/config.hpp b/libraries/chain/include/graphene/chain/config.hpp index 757582b0..149118c4 100644 --- a/libraries/chain/include/graphene/chain/config.hpp +++ b/libraries/chain/include/graphene/chain/config.hpp @@ -87,7 +87,8 @@ #define GRAPHENE_GENESIS_TIMESTAMP (1431700000) /// Should be divisible by GRAPHENE_DEFAULT_BLOCK_INTERVAL #define GRAPHENE_MAX_WORKER_NAME_LENGTH 63 -#define GRAPHENE_MAX_WORKER_URL_LENGTH 127 + +#define GRAPHENE_MAX_URL_LENGTH 127 // counter initialization values used to derive near and far future seeds for shuffling witnesses // we use the fractional bits of sqrt(2) in hex diff --git a/libraries/chain/include/graphene/chain/operations.hpp b/libraries/chain/include/graphene/chain/operations.hpp index f6bf79ab..bf7ef5c1 100644 --- a/libraries/chain/include/graphene/chain/operations.hpp +++ b/libraries/chain/include/graphene/chain/operations.hpp @@ -314,6 +314,7 @@ namespace graphene { namespace chain { asset fee; /// The account which owns the delegate. This account pays the fee for this operation. account_id_type delegate_account; + string url; account_id_type fee_payer()const { return delegate_account; } void get_required_auth(flat_set& active_auth_set, flat_set&)const; @@ -334,6 +335,7 @@ namespace graphene { namespace chain { asset fee; /// The account which owns the delegate. This account pays the fee for this operation. account_id_type witness_account; + string url; key_id_type block_signing_key; secret_hash_type initial_secret; @@ -1543,9 +1545,9 @@ FC_REFLECT( graphene::chain::account_whitelist_operation, (fee)(authorizing_acco FC_REFLECT( graphene::chain::account_transfer_operation, (fee)(account_id)(new_owner) ) FC_REFLECT( graphene::chain::delegate_create_operation, - (fee)(delegate_account) ) + (fee)(delegate_account)(url) ) -FC_REFLECT( graphene::chain::witness_create_operation, (fee)(witness_account)(block_signing_key)(initial_secret) ) +FC_REFLECT( graphene::chain::witness_create_operation, (fee)(witness_account)(url)(block_signing_key)(initial_secret) ) FC_REFLECT( graphene::chain::witness_withdraw_pay_operation, (fee)(from_witness)(to_account)(amount) ) FC_REFLECT( graphene::chain::limit_order_create_operation, diff --git a/libraries/chain/operations.cpp b/libraries/chain/operations.cpp index 063ce897..56eb9bcc 100644 --- a/libraries/chain/operations.cpp +++ b/libraries/chain/operations.cpp @@ -341,6 +341,7 @@ void delegate_create_operation::get_required_auth(flat_set& act void delegate_create_operation::validate()const { FC_ASSERT( fee.amount >= 0 ); + FC_ASSERT(url.size() < GRAPHENE_MAX_URL_LENGTH ); } void asset_fund_fee_pool_operation::get_required_auth(flat_set& active_auth_set, flat_set&) const @@ -539,6 +540,7 @@ void witness_create_operation::get_required_auth(flat_set= 0); + FC_ASSERT(url.size() < GRAPHENE_MAX_URL_LENGTH ); } share_type witness_create_operation::calculate_fee(const fee_schedule_type& k) const @@ -779,7 +781,7 @@ void worker_create_operation::validate() const FC_ASSERT(daily_pay > 0); FC_ASSERT(daily_pay < GRAPHENE_BLOCKCHAIN_MAX_SHARES); FC_ASSERT(name.size() < GRAPHENE_MAX_WORKER_NAME_LENGTH ); - FC_ASSERT(url.size() < GRAPHENE_MAX_WORKER_URL_LENGTH ); + FC_ASSERT(url.size() < GRAPHENE_MAX_URL_LENGTH ); } share_type worker_create_operation::calculate_fee(const fee_schedule_type& k) const