-
Notifications
You must be signed in to change notification settings - Fork 288
Adding eosio structure attribute #1082
base: transaction-sponsorship
Are you sure you want to change the base?
Adding eosio structure attribute #1082
Conversation
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 see the changes for clang included in this PR.
tools/include/eosio/abigen.hpp
Outdated
@@ -257,6 +257,31 @@ namespace eosio { namespace cdt { | |||
_abi.tables.insert(t); | |||
} | |||
|
|||
void add_structure( const clang::CXXRecordDecl* decl ) { |
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'm a bit confused about this part.
I thought the idea of the new attribute was to flag data types to be included in the 'structs' section for abi conversions to be performed on it.
I don't see why we need another section that is duplicating the information.
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 noticed that eosio::table attribute is made available in both 'structs' section, and also in a separate section, and I assumed that different tools get that information from different sections. I was mimicking that implementation. I can remove the separate section, if my assumption is incorrect, leaving eosio::structure attribute only in 'structs' section. Please advice.
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.
Removed ABI generation of structures section avoiding duplication.
I was waiting for EOSIO/clang#40 to be approved, so I can update the clang submodule changes to this PR. @larryk85, can you please approve it. Thanks. |
The file structure_test.json is missing. |
Change Description
Adding eosio::structure custom attribute. Can be used for retrieving metadata. Example usage: struct [[eosio::structure]] fee_payer { /* fields */ };
API Changes
Documentation Additions
This PR is part of Transaction Sponsorship feature