提交 7bc2046d 编写于 作者: K Khaled Al-Hassanieh

Rebase on master, code cleaning

上级 8c4806e0
......@@ -2,7 +2,6 @@
* @file
* @copyright defined in eos/LICENSE.txt
*/
#if 0
#include <utility>
#include <vector>
#include <string>
......@@ -389,4 +388,3 @@ class dice : public eosio::contract {
};
EOSIO_ABI( dice, (offerbet)(canceloffer)(reveal)(claimexpired)(deposit)(withdraw) )
#endif
......@@ -184,9 +184,8 @@ namespace eosiosystem {
//set_resource_limits( tot_itr->owner, tot_itr->storage_bytes, tot_itr->net_weight.quantity, tot_itr->cpu_weight.quantity );
eosio::action act( eosio::permission_level{del.from,N(active)}, N(eosio.token), N(transfer),
std::make_tuple( del.from, N(eosio), total_stake, std::string("stake bandwidth") ) );
act.send();
eosio::inline_transfer(eosio::permission_level{del.from,N(active)}, N(eosio.token),
{ del.from, N(eosio), total_stake, std::string("stake bandwidth") } );
if ( asset(0) < del.stake_net_quantity + del.stake_cpu_quantity ) {
voting<SystemAccount>::increase_voting_power( del.from, del.stake_net_quantity + del.stake_cpu_quantity );
......@@ -283,11 +282,9 @@ namespace eosiosystem {
// allow people to get their tokens earlier than the 3 day delay if the unstake happened immediately after many
// consecutive missed blocks.
{
eosio::action act( eosio::permission_level{N(eosio),N(active)}, N(eosio.token), N(transfer),
std::make_tuple( N(eosio), req->owner, req->amount, std::string("unstake") ) );
act.send();
}
eosio::inline_transfer( eosio::permission_level{N(eosio),N(active)}, N(eosio.token),
{ N(eosio), req->owner, req->amount, std::string("unstake") });
refunds_tbl.erase( req );
}
};
......
......@@ -164,15 +164,11 @@ namespace eosiosystem {
p.per_block_payments.amount = 0;
});
{
eosio::action act( eosio::permission_level{N(eosio),N(active)}, N(eosio.token), N(transfer),
std::make_tuple( N(eosio), cr.owner, rewards, std::string("producer claiming rewards") ) );
act.send();
}
eosio::inline_transfer(eosio::permission_level{N(eosio),N(active)}, N(eosio.token),
{ N(eosio), cr.owner, rewards, std::string("producer claiming rewards") } );
}
static void apply( account_name receiver, account_name code, action_name act ) {
// if ( !eosio::dispatch<currency, typename currency::transfer, typename currency::issue>( code, act ) ) {
if( !eosio::dispatch<contract, typename delegate_bandwidth<SystemAccount>::delegatebw,
typename delegate_bandwidth<SystemAccount>::refund,
typename voting<SystemAccount>::regproxy,
......@@ -199,8 +195,6 @@ namespace eosiosystem {
contract().on( receiver, eosio::unpack_action_data<undelegatebw>() );
}
}
// }
} /// apply
};
......
......@@ -375,9 +375,11 @@ namespace eosiosystem {
auto issue_quantity = parameters.blocks_per_cycle * (parameters.payment_per_block + parameters.payment_to_eos_bucket);
{
eosio::action act( eosio::permission_level{N(eosio),N(active)}, N(eosio.token), N(issue),
std::make_tuple( N(eosio), issue_quantity, std::string("producer pay") ) );
act.send();
// eosio::action act( eosio::permission_level{N(eosio),N(active)}, N(eosio.token), N(issue),
// std::make_tuple( N(eosio), issue_quantity, std::string("producer pay") ) );
// act.send();
eosio::inline_issue(eosio::permission_level{N(eosio),N(active)}, N(eosio.token),
{ N(eosio), issue_quantity, std::string("producer pay") });
}
set_blockchain_parameters(parameters);
global_state_singleton::set(parameters);
......
......@@ -27,22 +27,6 @@
{"name":"quantity", "type":"asset"},
{"name":"memo", "type":"string"}
]
},{
"name": "inlineissue",
"base": "",
"fields": [
{"name":"quantity", "type":"asset"},
{"name":"memo", "type":"string"}
]
},{
"name": "inlinetransfer",
"base": "",
"fields": [
{"name":"from", "type":"account_name"},
{"name":"to", "type":"account_name"},
{"name":"quantity", "type":"asset"},
{"name":"memo", "type":"string"}
]
},{
"name": "account",
"base": "",
......
......@@ -75,4 +75,18 @@ namespace eosio {
account_name ram_payer );
};
typedef std::tuple<account_name, account_name, asset, string> transfer_args;
void inline_transfer( permission_level permissions, account_name code, transfer_args args )
{
action act( permissions, code, N(transfer), args );
act.send();
}
typedef std::tuple<account_name, asset, string> issue_args;
void inline_issue( permission_level permissions, account_name code, issue_args args )
{
action act( permissions, code, N(issue), args );
act.send();
}
} /// namespace eosio
#if 0
/**
* @file
* @copyright defined in eos/LICENSE.txt
......@@ -8,6 +7,7 @@
#include <eosiolib/transaction.hpp>
#include <eosiolib/currency.hpp>
namespace proxy {
using namespace eosio;
......@@ -97,7 +97,7 @@ extern "C" {
if (action == N(onerror)) {
apply_onerror(receiver, deferred_transaction::from_current_action());
} if( action == N(transfer) ) {
apply_transfer(receiver, code, unpack_action_data<eosiosystem::contract<N(eosio.system)>::currency::transfer_memo>());
// apply_transfer(receiver, code, unpack_action_data<eosiosystem::contract<N(eosio.system)>::currency::transfer_memo>());
}
} else if ( code == N(currency) ) {
if( action == N(transfer) ) {
......@@ -110,4 +110,3 @@ extern "C" {
}
}
}
#endif
......@@ -150,7 +150,7 @@ public:
// the balance is implied to be 0 if either the table or row does not exist
if (tbl) {
const auto *obj = db.find<contracts::key_value_object, contracts::by_scope_primary>(boost::make_tuple(tbl->id, symbol(SY(4,EOS)).value()));
const auto *obj = db.find<contracts::key_value_object, contracts::by_scope_primary>(boost::make_tuple(tbl->id, symbol(SY(4,EOS)).value() >> 8));
if (obj) {
//balance is the second field after symbol, so skip the symbol
fc::datastream<const char *> ds(obj->value.data(), obj->value.size());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册