Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABI formatting: change behaviour of "abi", introduce "abi_python" #995

Merged
merged 1 commit into from Aug 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions bin/vyper
Expand Up @@ -44,8 +44,9 @@ def get_asm(asm_list):
if __name__ == '__main__':

output_format = {}
output_format['abi'] = lambda code: compiler.mk_full_signature(code)
output_format['json'] = lambda code: json.dumps(compiler.mk_full_signature(code))
output_format['abi_python'] = lambda code: compiler.mk_full_signature(code)
output_format['abi'] = lambda code: json.dumps(compiler.mk_full_signature(code))
output_format['json'] = output_format['abi'] # for backwards compatibility
output_format['bytecode'] = lambda code: '0x' + compiler.compile(code).hex()
output_format['bytecode_runtime'] = lambda code: '0x' + compiler.compile(code, bytecode_runtime=True).hex()
output_format['ir'] = lambda code: optimizer.optimize(parse_to_lll(code))
Expand Down
4 changes: 3 additions & 1 deletion docs/compiling-a-contract.rst
Expand Up @@ -7,7 +7,9 @@ To compile a contract, use:

You can also compile to other formats such as ABI using the below format:
::
vyper -f ['abi', 'json', 'bytecode', 'bytecode_runtime', 'ir'] yourFileName.vy
vyper -f ['abi', 'abi_python', 'bytecode', 'bytecode_runtime', 'ir', 'asm'] yourFileName.vy

It is also possible to use the `-f json` option, which is a legacy alias for `-f abi`.

.. note::
Since .vy is not officially a language supported by any syntax highlighters or linters,
Expand Down