This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
abi-gen/Py: fix call() return type incl. tx hash
Previously, generated wrappers for contract methods were including type hints that suggested that a call() (as opposed to a send_transaction()) might return either the underlying return type or a transaction hash. This doesn't make sense because a call() will never return a TX hash. Now, the type hint just has the return type of the underlying method.
- Loading branch information
Showing
3 changed files
with
16 additions
and
13 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
packages/abi-gen/templates/Python/partials/call_return_type.handlebars
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{~#if outputs~}} | ||
{{#if outputs.length}} | ||
{{#singleReturnValue}} | ||
{{#returnType outputs.0.type outputs.0.components}}{{~/returnType~}} | ||
{{/singleReturnValue}} | ||
{{^singleReturnValue}} | ||
Tuple[{{#each outputs}}{{#returnType type components}}{{/returnType}}{{#unless @last}}, {{/unless}}{{/each}}] | ||
{{~/singleReturnValue}} | ||
{{else}}None | ||
{{/if}} | ||
{{else}}None{{/if~}} |
This file contains 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
This file contains 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