Skip to content

Commit

Permalink
remove deprecated account_create_with_delegation operation
Browse files Browse the repository at this point in the history
  • Loading branch information
baabeetaa committed May 24, 2020
1 parent 445d998 commit 0d2ff06
Show file tree
Hide file tree
Showing 15 changed files with 0 additions and 284 deletions.
1 change: 0 additions & 1 deletion libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,6 @@ void database::initialize_evaluators()
_my->_evaluator_registry.register_evaluator< reset_account_evaluator >();
_my->_evaluator_registry.register_evaluator< set_reset_account_evaluator >();
_my->_evaluator_registry.register_evaluator< claim_reward_balance_evaluator >();
_my->_evaluator_registry.register_evaluator< account_create_with_delegation_evaluator >();
_my->_evaluator_registry.register_evaluator< delegate_vesting_shares_evaluator >();
_my->_evaluator_registry.register_evaluator< witness_set_properties_evaluator >();
_my->_evaluator_registry.register_evaluator< create_proposal_evaluator >();
Expand Down
1 change: 0 additions & 1 deletion libraries/chain/include/steem/chain/steem_evaluator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace steem { namespace chain {
using namespace steem::protocol;

STEEM_DEFINE_EVALUATOR( account_create )
STEEM_DEFINE_EVALUATOR( account_create_with_delegation )
STEEM_DEFINE_EVALUATOR( account_update )
STEEM_DEFINE_EVALUATOR( transfer )
STEEM_DEFINE_EVALUATOR( transfer_to_vesting )
Expand Down
5 changes: 0 additions & 5 deletions libraries/chain/steem_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,6 @@ void account_create_evaluator::do_apply( const account_create_operation& o )
});
}

void account_create_with_delegation_evaluator::do_apply( const account_create_with_delegation_operation& o )
{
FC_ASSERT( false, "Account creation with delegation is deprecated" );
}

void account_update_evaluator::do_apply( const account_update_operation& o )
{
FC_ASSERT( o.account != STEEM_TEMP_ACCOUNT, "Cannot update temp account." );
Expand Down
6 changes: 0 additions & 6 deletions libraries/chain/util/impacted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ struct get_impacted_account_visitor
_impacted.insert( op.creator );
}

void operator()( const account_create_with_delegation_operation& op )
{
_impacted.insert( op.new_account_name );
_impacted.insert( op.creator );
}

void operator()( const comment_operation& op )
{
_impacted.insert( op.author );
Expand Down
11 changes: 0 additions & 11 deletions libraries/plugins/account_by_key/account_by_key_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ struct pre_operation_visitor
_plugin.clear_cache();
}

void operator()( const account_create_with_delegation_operation& op )const
{
_plugin.clear_cache();
}

void operator()( const account_update_operation& op )const
{
_plugin.clear_cache();
Expand Down Expand Up @@ -85,12 +80,6 @@ struct post_operation_visitor
if( acct_itr ) _plugin.update_key_lookup( *acct_itr );
}

void operator()( const account_create_with_delegation_operation& op )const
{
auto acct_itr = _plugin._db.find< account_authority_object, by_account >( op.new_account_name );
if( acct_itr ) _plugin.update_key_lookup( *acct_itr );
}

void operator()( const account_update_operation& op )const
{
auto acct_itr = _plugin._db.find< account_authority_object, by_account >( op.account );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,52 +142,6 @@ namespace steem { namespace plugins { namespace condenser_api {
string json_metadata;
};

struct legacy_account_create_with_delegation_operation
{
legacy_account_create_with_delegation_operation() {}
legacy_account_create_with_delegation_operation( const account_create_with_delegation_operation op ) :
fee( legacy_asset::from_asset( op.fee ) ),
delegation( legacy_asset::from_asset( op.delegation ) ),
creator( op.creator ),
new_account_name( op.new_account_name ),
owner( op.owner ),
active( op.active ),
posting( op.posting ),
memo_key( op.memo_key ),
json_metadata( op.json_metadata )
{
extensions.insert( op.extensions.begin(), op.extensions.end() );
}

operator account_create_with_delegation_operation()const
{
account_create_with_delegation_operation op;
op.fee = fee;
op.delegation = delegation;
op.creator = creator;
op.new_account_name = new_account_name;
op.owner = owner;
op.active = active;
op.posting = posting;
op.memo_key = memo_key;
op.json_metadata = json_metadata;
op.extensions.insert( extensions.begin(), extensions.end() );
return op;
}

legacy_asset fee;
legacy_asset delegation;
account_name_type creator;
account_name_type new_account_name;
authority owner;
authority active;
authority posting;
public_key_type memo_key;
string json_metadata;

extensions_type extensions;
};

struct legacy_comment_options_operation
{
legacy_comment_options_operation() {}
Expand Down Expand Up @@ -903,7 +857,6 @@ namespace steem { namespace plugins { namespace condenser_api {
legacy_set_reset_account_operation,
legacy_claim_reward_balance_operation,
legacy_delegate_vesting_shares_operation,
legacy_account_create_with_delegation_operation,
legacy_witness_set_properties_operation,
legacy_account_update_operation,
legacy_create_proposal_operation,
Expand Down Expand Up @@ -1035,12 +988,6 @@ namespace steem { namespace plugins { namespace condenser_api {
return true;
}

bool operator()( const account_create_with_delegation_operation& op )const
{
l_op = legacy_account_create_with_delegation_operation( op );
return true;
}

bool operator()( const author_reward_operation& op )const
{
l_op = legacy_author_reward_operation( op );
Expand Down Expand Up @@ -1196,11 +1143,6 @@ struct convert_from_legacy_operation_visitor
return operation( delegate_vesting_shares_operation( op ) );
}

operation operator()( const legacy_account_create_with_delegation_operation& op )const
{
return operation( account_create_with_delegation_operation( op ) );
}

operation operator()( const legacy_author_reward_operation& op )const
{
return operation( author_reward_operation( op ) );
Expand Down Expand Up @@ -1351,18 +1293,6 @@ FC_REFLECT( steem::plugins::condenser_api::legacy_account_create_operation,
(memo_key)
(json_metadata) )

FC_REFLECT( steem::plugins::condenser_api::legacy_account_create_with_delegation_operation,
(fee)
(delegation)
(creator)
(new_account_name)
(owner)
(active)
(posting)
(memo_key)
(json_metadata)
(extensions) )

FC_REFLECT( steem::plugins::condenser_api::legacy_transfer_operation, (from)(to)(amount)(memo) )
FC_REFLECT( steem::plugins::condenser_api::legacy_transfer_to_vesting_operation, (from)(to)(amount) )
FC_REFLECT( steem::plugins::condenser_api::legacy_withdraw_vesting_operation, (account)(vesting_shares) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ struct operation_exec_info
operation_exec_info() {}

int64_t account_create_operation_exec_time = 57700;
int64_t account_create_with_delegation_operation_exec_time = 57700;
int64_t account_update_operation_exec_time = 14000;
int64_t account_witness_proxy_operation_exec_time = 117000;
int64_t account_witness_vote_operation_exec_time = 23000;
Expand Down Expand Up @@ -163,7 +162,6 @@ FC_REFLECT( steem::plugins::rc::state_object_size_info,

FC_REFLECT( steem::plugins::rc::operation_exec_info,
( account_create_operation_exec_time )
( account_create_with_delegation_operation_exec_time )
( account_update_operation_exec_time )
( account_witness_proxy_operation_exec_time )
( account_witness_vote_operation_exec_time )
Expand Down
11 changes: 0 additions & 11 deletions libraries/plugins/rc/rc_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,6 @@ struct pre_apply_operation_visitor
} FC_CAPTURE_AND_RETHROW( (*account)(*rc_account) )
}

void operator()( const account_create_with_delegation_operation& op )const
{
regenerate( op.creator );
}

void operator()( const transfer_to_vesting_operation& op )const
{
account_name_type target = op.to.size() ? op.to : op.from;
Expand Down Expand Up @@ -791,12 +786,6 @@ struct post_apply_operation_visitor
create_rc_account( _db, _current_time, op.new_account_name, op.fee );
}

void operator()( const account_create_with_delegation_operation& op )const
{
create_rc_account( _db, _current_time, op.new_account_name, op.fee );
_mod_accounts.emplace_back( op.creator );
}

void operator()( const create_claimed_account_operation& op )const
{
create_rc_account( _db, _current_time, op.new_account_name, _db.get_witness_schedule_object().median_props.account_creation_fee );
Expand Down
12 changes: 0 additions & 12 deletions libraries/plugins/rc/resource_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ struct count_operation_visitor
execution_time_count += _e.account_create_operation_exec_time;
}

void operator()( const account_create_with_delegation_operation& op )const
{
state_bytes_count +=
_w.account_object_base_size
+ _w.account_authority_object_base_size
+ get_authority_byte_count( op.owner )
+ get_authority_byte_count( op.active )
+ get_authority_byte_count( op.posting )
+ _w.vesting_delegation_object_base_size;
execution_time_count += _e.account_create_with_delegation_operation_exec_time;
}

void operator()( const account_witness_vote_operation& op )const
{
state_bytes_count += _w.witness_vote_object_base_size;
Expand Down
1 change: 0 additions & 1 deletion libraries/protocol/include/steem/protocol/operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace steem { namespace protocol {
set_reset_account_operation,
claim_reward_balance_operation,
delegate_vesting_shares_operation,
account_create_with_delegation_operation,
witness_set_properties_operation,
create_proposal_operation,
update_proposal_votes_operation,
Expand Down
31 changes: 0 additions & 31 deletions libraries/protocol/include/steem/protocol/steem_operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,6 @@ namespace steem { namespace protocol {
void get_required_active_authorities( flat_set<account_name_type>& a )const{ a.insert(creator); }
};


struct account_create_with_delegation_operation : public base_operation
{
asset fee;
asset delegation;
account_name_type creator;
account_name_type new_account_name;
authority owner;
authority active;
authority posting;
public_key_type memo_key;
string json_metadata;

extensions_type extensions;

void validate()const;
void get_required_active_authorities( flat_set<account_name_type>& a )const{ a.insert(creator); }
};

struct account_update_operation : public base_operation
{
account_name_type account;
Expand Down Expand Up @@ -789,18 +770,6 @@ FC_REFLECT( steem::protocol::account_create_operation,
(memo_key)
(json_metadata) )

FC_REFLECT( steem::protocol::account_create_with_delegation_operation,
(fee)
(delegation)
(creator)
(new_account_name)
(owner)
(active)
(posting)
(memo_key)
(json_metadata)
(extensions) )

FC_REFLECT( steem::protocol::account_update_operation,
(account)
(owner)
Expand Down
21 changes: 0 additions & 21 deletions libraries/protocol/steem_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,6 @@ namespace steem { namespace protocol {
FC_ASSERT( fee >= asset( 0, STEEM_SYMBOL ), "Account creation fee cannot be negative" );
}

void account_create_with_delegation_operation::validate() const
{
validate_account_name( new_account_name );
validate_account_name( creator );
FC_ASSERT( is_asset_type( fee, STEEM_SYMBOL ), "Account creation fee must be STEEM" );
FC_ASSERT( is_asset_type( delegation, VESTS_SYMBOL ), "Delegation must be VESTS" );

owner.validate();
active.validate();
posting.validate();

if( json_metadata.size() > 0 )
{
FC_ASSERT( fc::is_utf8(json_metadata), "JSON Metadata not formatted in UTF8" );
FC_ASSERT( fc::json::is_valid(json_metadata), "JSON Metadata not valid JSON" );
}

FC_ASSERT( fee >= asset( 0, STEEM_SYMBOL ), "Account creation fee cannot be negative" );
FC_ASSERT( delegation >= asset( 0, VESTS_SYMBOL ), "Delegation cannot be negative" );
}

void account_update_operation::validate() const
{
validate_account_name( account );
Expand Down
36 changes: 0 additions & 36 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,42 +1178,6 @@ condenser_api::legacy_signed_transaction wallet_api::create_account_with_keys(
return my->sign_transaction( tx, broadcast );
} FC_CAPTURE_AND_RETHROW( (creator)(new_account_name)(json_meta)(owner)(active)(memo)(broadcast) ) }

/**
* This method is used by faucets to create new accounts for other users which must
* provide their desired keys. The resulting account may not be controllable by this
* wallet.
*/
condenser_api::legacy_signed_transaction wallet_api::create_account_with_keys_delegated(
string creator,
condenser_api::legacy_asset steem_fee,
condenser_api::legacy_asset delegated_vests,
string new_account_name,
string json_meta,
public_key_type owner,
public_key_type active,
public_key_type posting,
public_key_type memo,
bool broadcast )const
{ try {
FC_ASSERT( !is_locked() );
account_create_with_delegation_operation op;
op.creator = creator;
op.new_account_name = new_account_name;
op.owner = authority( 1, owner, 1 );
op.active = authority( 1, active, 1 );
op.posting = authority( 1, posting, 1 );
op.memo_key = memo;
op.json_metadata = json_meta;
op.fee = steem_fee.to_asset();
op.delegation = delegated_vests.to_asset();

signed_transaction tx;
tx.operations.push_back(op);
tx.validate();

return my->sign_transaction( tx, broadcast );
} FC_CAPTURE_AND_RETHROW( (creator)(new_account_name)(json_meta)(owner)(active)(memo)(broadcast) ) }

condenser_api::legacy_signed_transaction wallet_api::request_account_recovery( string recovery_account, string account_to_recover, authority new_authority, bool broadcast )
{
FC_ASSERT( !is_locked() );
Expand Down
2 changes: 0 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ add_boost_test( chain_test
operation_tests/decline_voting_rights_apply
operation_tests/claim_reward_balance_validate
operation_tests/claim_reward_balance_authorities
operation_tests/account_create_with_delegation_authorities
operation_tests/account_create_with_delegation_apply
operation_tests/claim_reward_balance_apply
operation_tests/delegate_vesting_shares_validate
operation_tests/delegate_vesting_shares_authorities
Expand Down
Loading

0 comments on commit 0d2ff06

Please sign in to comment.