-
Notifications
You must be signed in to change notification settings - Fork 289
Fix not working --no-missing-ricardian-clause #1197
base: develop
Are you sure you want to change the base?
Conversation
tools/include/eosio/abigen.hpp
Outdated
@@ -729,6 +721,7 @@ namespace eosio { namespace cdt { | |||
public: | |||
explicit eosio_abigen_visitor(CompilerInstance *CI) { | |||
get_error_emitter().set_compiler_instance(CI); | |||
set_suppress_ricardian_warning(ag.suppress_ricardian_warnings); |
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 don't think you need this one. suppress_ricardian_warnings
above is taken from abigen
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.
Yes, when I wrote this patch, eosio_abigen_visitor
called eosio_abigen_visitor::parse_contracts
instead of abigen::parse_contracts
. This is obsolete now.
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.
got it. Yes, After some refactoring ricardian contracts generation was broken and recently it was fixed including this warning suppression.
So now other then correcting warning message there is nothing to do. Anyway if you'll add toolchain tests for this warning it will be helpful for future
// TODO | ||
std::cout << "Warning, action <"+get_action_name(decl)+"> does not have a ricardian contract\n"; | ||
if (!suppress_ricardian_warnings) | ||
CDT_CHECK_WARN(!rcs[get_action_name(decl)].empty(), "abigen_warning", decl->getLocation(), "Action <"+get_action_name(decl)+"> does not have a ricardian contract"); |
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.
what is the difference? Does it now outputs to stderr instead of stdout?
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.
Duplicated code. It seems original author intended replacing stdout warning message with CDT_CHECK_WARN macro when macro is implemented, but just added rather than replace it.
thanks for your contribution. basically you need just to create dummy contract with same name and check stderr/stdout in json. you can use regexp there. |
5accc84
to
ada19a0
Compare
Change Description
This PR makes
--no-missing-ricardian-clause
compile option work correctly.API Changes
Documentation Additions