Skip to content

[Bug]: Ensure Tests Compile when stylus-sdk/stylus-test Feature is Enabled #793

@0xNeshi

Description

@0xNeshi

What happened?

When this feature is enabled on stylus-sdk, the tests cannot be built due to:

error[E0423]: expected function, tuple struct or tuple variant, found struct VM
   --> /Users/ayushboss/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/openzeppelin-stylus-0.3.0-rc.1/src/utils/storage_slot.rs:67:20
    |
67  |         let host = VM(stylus_sdk::host::WasmVM {});
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: /Users/ayushboss/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/stylus-sdk-0.9.0/src/host/mod.rs:329:9
    |
329 |         pub struct VM {
    |         ------------- VM defined here
    |
help: use struct literal syntax instead of calling
    |
67  -         let host = VM(stylus_sdk::host::WasmVM {});
67  +         let host = VM{host: stylus_sdk::host::WasmVM {}};
    |

For more information about this error, try rustc --explain E0423.
error: could not compile openzeppelin-stylus (lib) due to 1 previous error

Possibly related #730

platform

  • linux
  • windows
  • macos

Expected behavior

Unit tests should build with the stylus-sdk/stylus-test feature enabled.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: mediumDefault level of effort.type: bugSomething is not working as intended.

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions