-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
Custom names for exports #1482
Comments
AssemblyScript support custom external names only for imports via @external("canister_update", "go")
export function go(): void {
...
} But this not support by AS currently. But you can write custom transform routine which made possible use Useful examples how to use And add logic which transform from: (func $go (export "go") (type $t1) (result i32) i32.const 1) to (func $go (export "canister_update go") (type $t1) (result i32) i32.const 1) when exported function has |
Perfect, so I simply have to change the export name? That's all that the C example I linked to is doing? |
yes, they are just replace |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey, I'm pretty new to AssemblyScript, and not sure how to achieve what I want and if AssemblyScript already supports this. Essentially I am trying to compile AssemblyScript to Wasm to deploy to ICP (DFINITY). They have their own language Motoko that they have good support for, and they are coming out with Rust and C SDKs. I think I can get this to work for AssemblyScript, following one of the C examples they've open-sourced. Here's what I'm trying to achieve: https://github.com/dfinity/examples/blob/master/c/qr/qr.c#L67
I do not understand the syntax there exactly. It seems as if the go function's export name is being set to "canister_update go". How can I achieve this in AssemblyScript? I have successfully compiled my AssemblyScript and deployed it to a local ICP node, but now I can't call into my function because I have not adequately marked it as a canister update function.
The text was updated successfully, but these errors were encountered: