Skip to content

Commit

Permalink
allow ineffective stake recall #171
Browse files Browse the repository at this point in the history
  • Loading branch information
kaynarov committed Mar 6, 2020
1 parent 666fe54 commit aef1958
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions libraries/eosiolib/capi/eosio/privileged.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ void update_stake_proxied( uint64_t token_code_raw, capi_name account, int32_t f
__attribute__((eosio_wasm_import))
void recall_stake_proxied( uint64_t token_code_raw, capi_name grantor_name, capi_name recipient_name, int32_t pct );

__attribute__((eosio_wasm_import))
void recall_stake_proxied_soft( uint64_t token_code_raw, capi_name grantor_name, capi_name recipient_name, int32_t pct );

__attribute__((eosio_wasm_import))
uint64_t get_used_resources_cost( capi_name account );

Expand Down
9 changes: 7 additions & 2 deletions libraries/eosiolib/contracts/eosio/privileged.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ namespace eosio {
__attribute((eosio_wasm_import))
void recall_stake_proxied( uint64_t token_code_raw, uint64_t grantor_name, uint64_t recipient_name, int32_t pct );

__attribute((eosio_wasm_import))
void recall_stake_proxied_soft( uint64_t token_code_raw, uint64_t grantor_name, uint64_t recipient_name, int32_t pct );

__attribute((eosio_wasm_import))
uint64_t get_used_resources_cost( uint64_t account );
}
Expand Down Expand Up @@ -135,8 +138,10 @@ namespace eosio {
return internal_use_do_not_use::update_stake_proxied(token_code.raw(), account.value, force);
}

inline void recall_stake_proxied( symbol_code token_code, name grantor_name, name recipient_name, int32_t pct ) {
return internal_use_do_not_use::recall_stake_proxied(token_code.raw(), grantor_name.value, recipient_name.value, pct);
inline void recall_stake_proxied( symbol_code token_code, name grantor_name, name recipient_name, int32_t pct, bool zero_amount_allowed = false) {
return zero_amount_allowed ?
internal_use_do_not_use::recall_stake_proxied_soft(token_code.raw(), grantor_name.value, recipient_name.value, pct) :
internal_use_do_not_use::recall_stake_proxied (token_code.raw(), grantor_name.value, recipient_name.value, pct);
}

inline uint64_t get_used_resources_cost( name account ) {
Expand Down

0 comments on commit aef1958

Please sign in to comment.