提交 12036822 编写于 作者: B Bucky Kittinger

Fixed merge conflicts

上级 eb6e2914
......@@ -257,7 +257,6 @@ namespace stltest {
}
static void apply( account_name c, action_name act) {
require_auth(c);
eosio::dispatch<stltest::contract, message>(c,act);
}
};
......
......@@ -26,7 +26,7 @@ extern "C" {
}
WASM_TEST_HANDLER(test_action, assert_true_cf);
require_auth(code);
require_auth(code);
//test_types
WASM_TEST_HANDLER(test_types, types_size);
......
......@@ -1824,12 +1824,6 @@ transaction_trace chain_controller::__apply_transaction( transaction_metadata& m
context.results.applied_actions.back().auths_used = act.authorization.size() - context.unused_authorizations().size();
fc::move_append(result.action_traces, std::move(context.results.applied_actions));
fc::move_append(result.deferred_transaction_requests, std::move(context.results.deferred_transaction_requests));
/*
// check if all authorizations were used, special case a couple of native contracts
if (!(act.name == N(updateauth) || act.name == N(canceldelay)))
EOS_ASSERT( context.all_authorizations_used(), tx_irrelevant_auth, "actions should only require the authorizations needed for execution, unused : ${auth}",
("auth", context.unused_authorizations()) );
*/
}
update_resource_usage(result, meta);
......
......@@ -33,6 +33,7 @@ namespace eosio { namespace chain {
uint32_t region_id;
uint32_t cycle_index;
vector<data_access_info> data_access;
uint32_t auths_used;
fc::microseconds _profiling_us = fc::microseconds(0);
};
......
......@@ -349,6 +349,7 @@ BOOST_FIXTURE_TEST_CASE(action_tests, tester) { try {
trx.actions.push_back(act);
set_transaction_headers(trx);
trx.sign(get_private_key(N(testapi), "active"), chain_id_type());
trx.sign(get_private_key(N(acc3), "active"), chain_id_type());
trx.sign(get_private_key(N(acc4), "active"), chain_id_type());
auto res = push_transaction(trx);
......@@ -401,6 +402,7 @@ BOOST_FIXTURE_TEST_CASE(cf_action_tests, tester) { try {
produce_blocks(1);
cf_action cfa;
signed_transaction trx;
set_transaction_headers(trx);
// need at least one normal action
BOOST_CHECK_EXCEPTION(push_transaction(trx), tx_no_action,
[](const fc::assert_exception& e) {
......@@ -462,7 +464,6 @@ BOOST_FIXTURE_TEST_CASE(cf_action_tests, tester) { try {
trx.context_free_data.emplace_back(fc::raw::pack<uint32_t>(200));
trx.actions.push_back(act1);
set_tapos(trx);
// attempt to access non context free api
for (uint32_t i = 200; i <= 204; ++i) {
trx.context_free_actions.clear();
......@@ -481,28 +482,9 @@ BOOST_FIXTURE_TEST_CASE(cf_action_tests, tester) { try {
);
}
// attempt to access non context free api
for (uint32_t i = 200; i <= 204; ++i) {
trx.context_free_actions.clear();
trx.context_free_data.clear();
cfa.payload = i;
cfa.cfd_idx = 1;
action cfa_act({}, cfa);
dummy_action da = { DUMMY_ACTION_DEFAULT_A, DUMMY_ACTION_DEFAULT_B, DUMMY_ACTION_DEFAULT_C };
trx.context_free_actions.emplace_back(cfa_act);
trx.actions.emplace_back(pl, da);
trx.signatures.clear();
sigs = trx.sign(get_private_key(N(testapi), "active"), chain_id_type());
BOOST_CHECK_EXCEPTION(push_transaction(trx), transaction_exception,
[](const fc::assert_exception& e) {
return expect_assert_message(e, "context_free: only context free api's can be used in this context");
}
);
}
}
produce_block();
return;
// test send context free action
auto ttrace = CallFunction( *this, test_api_action<TEST_METHOD("test_transaction", "send_cf_action")>{}, {}, {N(testapi)}, 20000 );
BOOST_CHECK_EQUAL(ttrace.action_traces.size(), 2);
......@@ -518,6 +500,7 @@ BOOST_FIXTURE_TEST_CASE(cf_action_tests, tester) { try {
);
CALL_TEST_FUNCTION( *this, "test_transaction", "read_inline_action", {} );
CallFunction( *this, test_api_action<TEST_METHOD("test_transaction", "read_inline_cf_action")>{}, {}, {N(testapi)}, 20000 );
} FC_LOG_AND_RETHROW() }
......@@ -661,7 +644,7 @@ BOOST_FIXTURE_TEST_CASE(transaction_tests, tester) { try {
action act({}, tm);
trx.actions.push_back(act);
set_tapos(trx);
set_transaction_headers(trx);
BOOST_CHECK_EXCEPTION(push_transaction(trx), transaction_exception,
[](const fc::exception& e) {
return expect_assert_message(e, "transactions require at least one authorization");
......
......@@ -473,7 +473,7 @@ BOOST_FIXTURE_TEST_CASE( stl_test, tester ) try {
trx.actions.push_back(std::move(msg_act));
set_transaction_headers(trx);
trx.sign(get_private_key(N(bob), "active"), chain_id_type());
trx.sign(get_private_key(N(stltest), "active"), chain_id_type());
push_transaction(trx);
produce_block();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册