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

[x/programs] cannot run golang example tests #882

Closed
najeal opened this issue May 3, 2024 · 2 comments
Closed

[x/programs] cannot run golang example tests #882

najeal opened this issue May 3, 2024 · 2 comments

Comments

@najeal
Copy link
Contributor

najeal commented May 3, 2024

I don't know if it is the right way to do it but:

  • running : cargo build --target wasm32-unknown-unknown in rust counter example
  • moving the count.wasm file into fixtures
  • run go test -run TestCounterProgram in go counter example

I get this error:

counter_test.go:62
Error: Received unexpected error:
           incompatible import type for `state::get`

           Caused by:
              function types incompatible: expected func of type `(i64, i64) -> (i64)`, found func of type `(i32, i32, i32, i32) -> (i32)`
Test:   TestCounterProgram
@iFrostizz
Copy link
Contributor

This is probably because of the recent merge of #872 and you could have kept the old compiled target, did you moved the compiled binary from x/programs/rust/examples/token/build/wasm32-unknown-unknown/release/token.wasm ? to x/programs/tests/fixture/ (also make sure that you compile using --release)

@najeal
Copy link
Contributor Author

najeal commented May 4, 2024

Thank for your answer !
Yes I was moving the compiled binary into fixture.
Tried with --release after a restart, issue looks resolved and not reproducible anymore 😶

@najeal najeal closed this as completed May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants