Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Adding eosio structure attribute #1082

Draft
wants to merge 9 commits into
base: transaction-sponsorship
Choose a base branch
from

Conversation

venu-block1
Copy link
Contributor

Change Description

Adding eosio::structure custom attribute. Can be used for retrieving metadata. Example usage: struct [[eosio::structure]] fee_payer { /* fields */ };

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

This PR is part of Transaction Sponsorship feature

Copy link
Contributor

@larryk85 larryk85 left a 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.

@@ -257,6 +257,31 @@ namespace eosio { namespace cdt {
_abi.tables.insert(t);
}

void add_structure( const clang::CXXRecordDecl* decl ) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@venu-block1
Copy link
Contributor Author

venu-block1 commented Apr 5, 2021

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.

@victorj8
Copy link
Contributor

The file structure_test.json is missing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants