-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: add wrapper subinvoke test case #1328
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
8 changes: 0 additions & 8 deletions
8
packages/test-cases/cases/wrappers/wasm-as/simple-subinvoke/invoke/polywrap.build.yaml
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
packages/test-cases/cases/wrappers/wasm-as/simple-subinvoke/invoke/polywrap.meta.yaml
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
packages/test-cases/cases/wrappers/wasm-as/simple-subinvoke/invoke/schema.graphql
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#import * into Add from "ens/add.eth" | ||
|
||
type Module { | ||
add(a: Int!, b: Int!): String! | ||
add(a: Int!, b: Int!): Int! | ||
} |
9 changes: 7 additions & 2 deletions
9
packages/test-cases/cases/wrappers/wasm-as/simple-subinvoke/invoke/src/index.ts
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import { Args_add, Add_Module } from "./wrap"; | ||
import { Args_add as ImportedArgs_add } from "./wrap/imported/Add_Module/serialization"; | ||
|
||
export function add(args: Args_add): string { | ||
Add_Module.add | ||
export function add(args: Args_add): i32 { | ||
let importedArgs: ImportedArgs_add = { | ||
a: args.a, | ||
b: args.b | ||
} | ||
return Add_Module.add(importedArgs).unwrap() | ||
} | ||
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
8 changes: 0 additions & 8 deletions
8
packages/test-cases/cases/wrappers/wasm-as/simple-subinvoke/subinvoke/polywrap.build.yaml
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
packages/test-cases/cases/wrappers/wasm-as/simple-subinvoke/subinvoke/polywrap.meta.yaml
This file was deleted.
Oops, something went wrong.
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? I'd prefer to have a different output for invoke and subinvoke. It'll be easy to debug and spot some horrible bugs that would be passed safely due to a buggy client implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it just to make it work and have a super simple example
Gotcha, if we just use the
add
method in theinvoke
and add1
to that result, would that be enough for you? Meaning that theinvoke
method would return the sum of two numbers + 1, and thesubinvoke
would just return the sum of two numbersThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that'd work. You can call it
add_and_increament
then