neo3-boa
neo3-boa copied to clipboard
fix script_container attribute access
Related issue fix #1273
Summary or solution description
script_container
is the only module attribute of the interop package that returns a class with more properties. The module analyser is changed to allow to capture the class properties.
In the case of importing the runtime
module and trying to do
x = runtime.script_container.hash
The code generator failed to generate code for getting the script_container
and only generated code for picking the hash
property. It now recursively generates for all attributes instead of just the first as the AST looks as follows
Assign(
targets=[
Name(id='x', ctx=Store())],
value=Attribute(
value=Attribute(
value=Name(id='runtime', ctx=Load()),
attr='script_container',
ctx=Load()),
attr='hash',
ctx=Load())),