CU-3cr16nu - Add a new field on each type-value object on JSON manife… #991
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.
…st file generation to better describe the specific type/format of that field.
Summary or solution description
Added more types to better indicate what sort of parameters the smart contract has.
Now, when compiling a smart contract, if the user wants to they can use one of the added types to hint the type on the manifest.
List
s,Dict
s andUnion
also have a hint indicating the items types.Using
Optional
now adds anullable
on the parameter or return on the manifest.How to Reproduce
neo3-boa/boa3_test/test_sc/generation_test/ManifestTypeHintFromStrToAddress.py
Lines 1 to 7 in d43c0a3
Tests
neo3-boa/boa3_test/tests/compiler_tests/test_file_generation.py
Lines 780 to 1096 in d43c0a3
Platform:
(Optional) Additional context
Tring to use the method
to_script_hash()
on strings that when turned into bytes doesn't have length 20 or is not an Address, will end up in a runtime error. An issue will be created to verify this behaviour and fix this if needed.