CityOfZion / neo-boa

Python compiler for the Neo2 Virtual Machine, see neo3-boa for NEO3
MIT License
69 stars 55 forks source link

Generate abi file #129

Closed meevee98 closed 4 years ago

meevee98 commented 4 years ago

What current issue(s) from Github does this address?

124

What problem does this PR solve? Implement the generation of the .abi.json needed to Neo Visual DevTracker provide a better developer experience for invoking smart contracts

How did you solve this problem? I implemented two decorators to identify the methods that should be included in the .abi.json with the information about parameters and return type:

Are there any special changes in the code that we should be aware of? When a decorator is used, the compiler didn't get the code of the method because it was used the first element in self.block in method.py. I implemented a method to get the index of the block with the code. Changes here and here.

Is there anything else we should know? The @abi_entry_point(types) can be used only once. If any @abi_method(types) decorator is used, it must have a method with @abi_entry_point(types) decorator

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.1%) to 89.835% when pulling f6ebb28070ece67d7c85f27a0420d9b4291b5a0b on simplitech:generate_abi_file into 86bdc57dbd99d66f4afacfe47a5aab2863bc58bf on CityOfZion:development.

ixje commented 4 years ago

fyi; building passes, travis is just not reporting results again https://travis-ci.org/github/CityOfZion/neo-boa/builds/681164498

melanke commented 4 years ago

I think this PR is good to go

ixje commented 4 years ago

I'm waiting for an "issue" elaboration on Discord before merging this.