-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require dry-run trxs to have authorization and add tests #1489
Conversation
BOOST_REQUIRE_EQUAL(transaction_receipt::executed, trace->receipt->status); | ||
// now push for real | ||
trace = chain.push_transaction(trx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably check the status again after the real execution.
unittests/dry_run_trx_tests.cpp
Outdated
getage_data = abi_ser.variant_to_binary("getage", mutable_variant_object() | ||
("user", "alice"), | ||
abi_serializer::create_yield_function( abi_serializer_max_time )); | ||
produce_block(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we call produce_block()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason, removed.
send_db_api_transaction("insert"_n, insert_data, vector<permission_level>{{"alice"_n, config::active_name}}, transaction_metadata::trx_type::dry_run); | ||
|
||
// verify the dry-run insert was rolled back, use a read-only trx to query | ||
BOOST_CHECK_EXCEPTION(send_db_api_transaction("getage"_n, getage_data, {}, transaction_metadata::trx_type::read_only), fc::exception, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this combination of using read_only transaction.
Add requirement for dry-run/compute transactions to require authorization.
Add tests for dry-run/compute transactions.
Also some minor cleanup to unneeded includes.
Resolves #1083