Fix build

This commit is contained in:
Vikram Rajkumar 2015-06-13 16:11:32 -04:00
parent bc76bd05fc
commit 488b385e72
3 changed files with 82 additions and 20 deletions

View file

@ -559,8 +559,7 @@ namespace graphene { namespace chain {
vector<blind_output> outputs; vector<blind_output> outputs;
account_id_type fee_payer()const; account_id_type fee_payer()const;
void get_required_auth( flat_set<account_id_type>& active_auth_set, void get_required_auth( flat_set<account_id_type>& active_auth_set, flat_set<account_id_type>& )const;
flat_set<account_id_type>& )const;
void validate()const; void validate()const;
share_type calculate_fee( const fee_schedule_type& k )const; share_type calculate_fee( const fee_schedule_type& k )const;
void get_balance_delta( balance_accumulator& acc, const operation_result& result = asset())const; void get_balance_delta( balance_accumulator& acc, const operation_result& result = asset())const;
@ -578,8 +577,7 @@ namespace graphene { namespace chain {
vector<blind_input> inputs; vector<blind_input> inputs;
account_id_type fee_payer()const; account_id_type fee_payer()const;
void get_required_auth( flat_set<account_id_type>& active_auth_set, void get_required_auth( flat_set<account_id_type>& active_auth_set, flat_set<account_id_type>& )const;
flat_set<account_id_type>& )const;
void validate()const; void validate()const;
share_type calculate_fee( const fee_schedule_type& k )const; share_type calculate_fee( const fee_schedule_type& k )const;
void get_balance_delta( balance_accumulator& acc, const operation_result& result = asset())const; void get_balance_delta( balance_accumulator& acc, const operation_result& result = asset())const;
@ -637,8 +635,7 @@ namespace graphene { namespace chain {
vector<blind_output> outputs; vector<blind_output> outputs;
account_id_type fee_payer()const; account_id_type fee_payer()const;
void get_required_auth( flat_set<account_id_type>& active_auth_set, void get_required_auth( flat_set<account_id_type>& active_auth_set, flat_set<account_id_type>& )const;
flat_set<account_id_type>& )const;
void validate()const; void validate()const;
share_type calculate_fee( const fee_schedule_type& k )const; share_type calculate_fee( const fee_schedule_type& k )const;
void get_balance_delta( balance_accumulator& acc, const operation_result& result = asset())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::custom_operation, (fee)(payer)(required_auths)(id)(data) )
FC_REFLECT( graphene::chain::void_result, ) 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) ) (from)(amount)(message)(check) )
FC_REFLECT( graphene::chain::blind_transfer_operation::blind_input, FC_REFLECT( graphene::chain::blind_input,
(commitment)(owner) ) (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) ) (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, FC_REFLECT( graphene::chain::blind_transfer_operation,
(fee)(fee_payer_id) (fee)(fee_payer_id)(inputs)(outputs) )
(from_account)(from_amount)
(to_account)(to_account_name)(to_address)(to_amount) )
FC_REFLECT_TYPENAME( graphene::chain::operation ) FC_REFLECT_TYPENAME( graphene::chain::operation )
FC_REFLECT_TYPENAME( fc::flat_set<graphene::chain::vote_id_type> ) FC_REFLECT_TYPENAME( fc::flat_set<graphene::chain::vote_id_type> )

View file

@ -935,17 +935,74 @@ share_type account_upgrade_operation::calculate_fee(const fee_schedule_type& k)
return k.membership_annual_fee; 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<account_id_type>& active_auth_set, flat_set<account_id_type>& )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<account_id_type>& active_auth_set, flat_set<account_id_type>& )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 * 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. * 100% of the fee goes to the network.
*/ */
account_id_type blind_transfer_operation::fee_payer()const account_id_type blind_transfer_operation::fee_payer()const
{ {
// TODO
return fee_payer_id; return fee_payer_id;
} }
void blind_transfer_operation::get_required_auth( flat_set<account_id_type>& active_auth_set, flat_set<account_id_type>& )const void blind_transfer_operation::get_required_auth( flat_set<account_id_type>& active_auth_set, flat_set<account_id_type>& )const
{ {
// TODO
/*
active_auth_set.insert( fee_payer_id ); active_auth_set.insert( fee_payer_id );
active_auth_set.insert( from_account ); active_auth_set.insert( from_account );
for( auto input : inputs ) for( auto input : inputs )
@ -953,6 +1010,7 @@ void blind_transfer_operation::get_required_auth(flat_set<account_id_
if( input.owner.which() == static_variant<address,account_id_type>::tag<account_id_type>::value ) if( input.owner.which() == static_variant<address,account_id_type>::tag<account_id_type>::value )
active_auth_set.insert( input.owner.get<account_id_type>() ); active_auth_set.insert( input.owner.get<account_id_type>() );
} }
*/
} }
/** /**
@ -960,6 +1018,8 @@ void blind_transfer_operation::get_required_auth(flat_set<account_id_
*/ */
void blind_transfer_operation::validate()const void blind_transfer_operation::validate()const
{ {
// TODO
/*
vector<commitment_type> in(inputs.size()); vector<commitment_type> in(inputs.size());
vector<commitment_type> out(outputs.size()); vector<commitment_type> out(outputs.size());
int64_t net_public = from_amount.value - to_amount.value; 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 ); 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); // TODO
return (k.blind_transfer_fee * size)/1024; return 0;
} }
void blind_transfer_operation::get_balance_delta( balance_accumulator& acc, void blind_transfer_operation::get_balance_delta( balance_accumulator& acc, const operation_result& result)const
const operation_result& result)const
{ {
// TODO
/*
acc.adjust( fee_payer(), -fee ); acc.adjust( fee_payer(), -fee );
acc.adjust( from_account, asset(-from_amount,fee.asset_id) ); acc.adjust( from_account, asset(-from_amount,fee.asset_id) );
acc.adjust( to_account, asset(to_amount,fee.asset_id) ); acc.adjust( to_account, asset(to_amount,fee.asset_id) );
*/
} }
} } // namespace graphene::chain } } // namespace graphene::chain

@ -1 +1 @@
Subproject commit dde8ed9d7ab49807f2556488c0815f3741b11e00 Subproject commit f7cf9abe558a05c38091d0fce689aa2a91a993b5