-
Notifications
You must be signed in to change notification settings - Fork 3.8k
process generated transactions #227
process generated transactions #227
Conversation
template<> | ||
void check_output(const types::Message& expected, const types::Message& actual) { | ||
try { | ||
check_output(expected.code, actual.code); |
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 don't you move the try{ } catch{} . into check_output and pass the "in .x" as a const char* 3rd argument? I think it would make the code more readable.
/** | ||
* clear all common data | ||
*/ | ||
inline |
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.
put inline on same line as return statement.
types::transfer{sender, recipient, amount}); | ||
auto info = get_info(); | ||
trx.expiration = info.head_block_time + 100; //chain.head_block_time() + 100; | ||
trx.set_reference_block(info.head_block_id); | ||
transaction_helpers::set_reference_block(trx, info.head_block_id); |
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.
I find the name transaction_helpers long, I feel we should say "using transaction_helpers" unless there is clear possibility of name conflict.
@@ -1116,9 +1117,9 @@ R"( | |||
trx.messages.resize(1); | |||
trx.messages[0].code = config::EosContractName; | |||
trx.messages[0].authorization.emplace_back(types::AccountPermission{"simplecoin","active"}); | |||
trx.setMessage(0, "setcode", handler); | |||
transaction_helpers::set_message(trx, 0, "setcode", handler); |
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.
perhaps renaming the methods . transaction_set_message rather than transaction_helpers::set_message if we are going to be verbose everywhere. If follows the naming convention one would use for a object-oriented C api.
resolves #174
test cases will be easier to write and more meaningful once there is contract support for sync and async transactions. However I wanted to go ahead and review what was working without impacting the existing code/tests.