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

Remove Env from the contract extern functions #1402

Open
leighmcculloch opened this issue Dec 6, 2024 · 0 comments
Open

Remove Env from the contract extern functions #1402

leighmcculloch opened this issue Dec 6, 2024 · 0 comments

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Dec 6, 2024

I noticed today while debugging generated contract functions that there's a warning on the Env that is included in the extern contract function signatures saying that:

warning: `extern` fn uses type `Env`, which is not FFI-safe
   --> tests/account/src/lib.rs:309:14
    |
309 |         env: soroban_sdk::Env,
    |              ^^^^^^^^^^^^^^^^ not FFI-safe
    |

We could omit the Env in this function since we can instantiate it at the start of the function in Wasm builds.

Once upon a time both the test framework and real invocations when built to Wasm went through the same function which is why the Env was a parameter, but since then the extern function now only gets used externally when built to Wasm, so the parameter is unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant