diff --git a/libraries/chain/include/graphene/chain/operations.hpp b/libraries/chain/include/graphene/chain/operations.hpp index 21bb470d..0484cb95 100644 --- a/libraries/chain/include/graphene/chain/operations.hpp +++ b/libraries/chain/include/graphene/chain/operations.hpp @@ -559,8 +559,7 @@ namespace graphene { namespace chain { vector outputs; account_id_type fee_payer()const; - void get_required_auth( flat_set& active_auth_set, - flat_set& )const; + void get_required_auth( flat_set& active_auth_set, flat_set& )const; void validate()const; share_type calculate_fee( const fee_schedule_type& k )const; void get_balance_delta( balance_accumulator& acc, const operation_result& result = asset())const; @@ -578,8 +577,7 @@ namespace graphene { namespace chain { vector inputs; account_id_type fee_payer()const; - void get_required_auth( flat_set& active_auth_set, - flat_set& )const; + void get_required_auth( flat_set& active_auth_set, flat_set& )const; void validate()const; share_type calculate_fee( const fee_schedule_type& k )const; void get_balance_delta( balance_accumulator& acc, const operation_result& result = asset())const; @@ -637,8 +635,7 @@ namespace graphene { namespace chain { vector outputs; account_id_type fee_payer()const; - void get_required_auth( flat_set& active_auth_set, - flat_set& )const; + void get_required_auth( flat_set& active_auth_set, flat_set& )const; void validate()const; share_type calculate_fee( const fee_schedule_type& k )const; void get_balance_delta( balance_accumulator& acc, const operation_result& result = asset())const; @@ -2047,16 +2044,18 @@ FC_REFLECT( graphene::chain::worker_create_operation, FC_REFLECT( graphene::chain::custom_operation, (fee)(payer)(required_auths)(id)(data) ) FC_REFLECT( graphene::chain::void_result, ) -FC_REFLECT( graphene::chain::blind_transfer_operation::blind_memo, +FC_REFLECT( graphene::chain::blind_memo, (from)(amount)(message)(check) ) -FC_REFLECT( graphene::chain::blind_transfer_operation::blind_input, +FC_REFLECT( graphene::chain::blind_input, (commitment)(owner) ) -FC_REFLECT( graphene::chain::blind_transfer_operation::blind_output, +FC_REFLECT( graphene::chain::blind_output, (commitment)(range_proof)(owner)(one_time_key)(encrypted_memo) ) +FC_REFLECT( graphene::chain::transfer_to_blind_operation, + (fee)(amount)(from)(outputs) ) +FC_REFLECT( graphene::chain::transfer_from_blind_operation, + (fee)(amount)(to)(inputs) ) FC_REFLECT( graphene::chain::blind_transfer_operation, - (fee)(fee_payer_id) - (from_account)(from_amount) - (to_account)(to_account_name)(to_address)(to_amount) ) + (fee)(fee_payer_id)(inputs)(outputs) ) FC_REFLECT_TYPENAME( graphene::chain::operation ) FC_REFLECT_TYPENAME( fc::flat_set ) diff --git a/libraries/chain/operations.cpp b/libraries/chain/operations.cpp index 6a233116..e09714f8 100644 --- a/libraries/chain/operations.cpp +++ b/libraries/chain/operations.cpp @@ -935,17 +935,74 @@ share_type account_upgrade_operation::calculate_fee(const fee_schedule_type& k) return k.membership_annual_fee; } +account_id_type transfer_to_blind_operation::fee_payer()const +{ + // TODO + return from; +} + +void transfer_to_blind_operation::get_required_auth( flat_set& active_auth_set, flat_set& )const +{ + // TODO +} + +void transfer_to_blind_operation::validate()const +{ + // TODO +} + +share_type transfer_to_blind_operation::calculate_fee( const fee_schedule_type& k )const +{ + // TODO + return 0; +} + +void transfer_to_blind_operation::get_balance_delta( balance_accumulator& acc, const operation_result& result )const +{ + // TODO +} + +account_id_type transfer_from_blind_operation::fee_payer()const +{ + // TODO + return to; +} + +void transfer_from_blind_operation::get_required_auth( flat_set& active_auth_set, flat_set& )const +{ + // TODO +} + +void transfer_from_blind_operation::validate()const +{ + // TODO +} + +share_type transfer_from_blind_operation::calculate_fee( const fee_schedule_type& k )const +{ + // TODO + return 0; +} + +void transfer_from_blind_operation::get_balance_delta( balance_accumulator& acc, const operation_result& result )const +{ + // TODO +} + /** * If fee_payer = temp_account_id, then the fee is paid by the surplus balance of inputs-outputs and * 100% of the fee goes to the network. */ account_id_type blind_transfer_operation::fee_payer()const { + // TODO return fee_payer_id; } -void blind_transfer_operation::get_required_auth(flat_set& active_auth_set, flat_set&)const +void blind_transfer_operation::get_required_auth( flat_set& active_auth_set, flat_set& )const { + // TODO + /* active_auth_set.insert( fee_payer_id ); active_auth_set.insert( from_account ); for( auto input : inputs ) @@ -953,13 +1010,16 @@ void blind_transfer_operation::get_required_auth(flat_set::tag::value ) active_auth_set.insert( input.owner.get() ); } + */ } /** * This method can be computationally intensive because it verifies that input commitments - output commitments add up to 0 */ -void blind_transfer_operation::validate()const +void blind_transfer_operation::validate()const { + // TODO + /* vector in(inputs.size()); vector out(outputs.size()); int64_t net_public = from_amount.value - to_amount.value; @@ -978,20 +1038,23 @@ void blind_transfer_operation::validate()const FC_ASSERT( info.max_value <= GRAPHENE_MAX_SHARE_SUPPLY ); } } + */ } -share_type blind_transfer_operation::calculate_fee( const fee_schedule_type& k )const +share_type blind_transfer_operation::calculate_fee( const fee_schedule_type& k )const { - auto size = 1024 + fc::raw::pack_size(*this); - return (k.blind_transfer_fee * size)/1024; + // TODO + return 0; } -void blind_transfer_operation::get_balance_delta( balance_accumulator& acc, - const operation_result& result)const +void blind_transfer_operation::get_balance_delta( balance_accumulator& acc, const operation_result& result)const { + // TODO + /* acc.adjust( fee_payer(), -fee ); acc.adjust( from_account, asset(-from_amount,fee.asset_id) ); acc.adjust( to_account, asset(to_amount,fee.asset_id) ); + */ } } } // namespace graphene::chain diff --git a/libraries/fc b/libraries/fc index dde8ed9d..f7cf9abe 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit dde8ed9d7ab49807f2556488c0815f3741b11e00 +Subproject commit f7cf9abe558a05c38091d0fce689aa2a91a993b5