未验证 提交 c3161af3 编写于 作者: W wanderingbort 提交者: GitHub

Merge pull request #4346 from noisy/account_name_exists_exception

More precise exception for "Cannot create account named..."
......@@ -92,7 +92,7 @@ void apply_eosio_newaccount(apply_context& context) {
}
auto existing_account = db.find<account_object, by_name>(create.name);
EOS_ASSERT(existing_account == nullptr, action_validate_exception,
EOS_ASSERT(existing_account == nullptr, account_name_exists_exception,
"Cannot create account named ${name}, as that name is already taken",
("name", create.name));
......
......@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE(block_with_invalid_tx_test)
validator.control->abort_block();
BOOST_REQUIRE_EXCEPTION(validator.control->push_block( copy_b ), fc::exception ,
[] (const fc::exception &e)->bool {
return e.code() == action_validate_exception::code_value ;
return e.code() == account_name_exists_exception::code_value ;
}) ;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册