Resolve #99: Fix abigen with int expression template arguments#100
Merged
ScottBailey merged 3 commits intoAntelopeIO:mainfrom Mar 20, 2023
Merged
Resolve #99: Fix abigen with int expression template arguments#100ScottBailey merged 3 commits intoAntelopeIO:mainfrom
ScottBailey merged 3 commits intoAntelopeIO:mainfrom
Conversation
471ac19 to
255eca1
Compare
ScottBailey
reviewed
Mar 17, 2023
ScottBailey
suggested changes
Mar 17, 2023
Contributor
ScottBailey
left a comment
There was a problem hiding this comment.
Small style request, otherwise LGTM.
dimas1185
suggested changes
Mar 17, 2023
Contributor
dimas1185
left a comment
There was a problem hiding this comment.
looks good. please add a test to tests/abigen-pass directory. look at other examples, there are small *.json, *.abi and *.cpp to demonstrate how this works
Contributor
Author
|
Good call. Added a test which fails before the fix, and passes after. |
In my contracts, I use several template arguments which are expressions which resolve to integral values (such as an eosio::name) but are not literal integer values. This works great in my contracts, but causes abigen to fail. Fix abigen in cases where a template argument is an expression that resolves to an integer, but isn't an integer literal.
Add braces Co-authored-by: Scott B <Scott@TheBaileyFamily.org>
This test fails without the fix to issue AntelopeIO#99, and passes with it. The failure is a bit odd -- it doesn't fail because cdt-cpp crashes; rather, it fails because the crashed cdt-cpp did not output an abi file and therefore it cannot match the golden record... But hey, it does test the issue, just rather indirectly. =)
53fefe5 to
8dfff37
Compare
dimas1185
approved these changes
Mar 20, 2023
ScottBailey
approved these changes
Mar 20, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Resolve #99
In my contracts, I use several template arguments which are expressions which resolve to integral values (such as an
eosio::name) but are not literal integer values. This works great in my contracts, but causes abigen to fail.This PReq fixes abigen in such cases where a template argument is an expression that resolves to an integer, but isn't an integer literal.
API Changes
Documentation Additions