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

marine test : allow to control service lifecycle #6

Open
dzmitry-lahoda opened this issue Aug 26, 2021 · 0 comments
Open

marine test : allow to control service lifecycle #6

dzmitry-lahoda opened this issue Aug 26, 2021 · 0 comments

Comments

@dzmitry-lahoda
Copy link

Description

  1. Declare 2 services form same wasm hash, so different file paths (my-service-1.wasm and my-service-2.wasm):
[[module]]
    name = "my-service-1"
    mem_pages_count = 1
    logger_enabled = true    
[[module]]
    name = "my-service-2"
    mem_pages_count = 1
    logger_enabled = true
  1. Will get in code:
tests::flow::my_service_1_structs::__m_generated_my_service_1::MGeneratedStructmy_service_1
tests::flow::my_service_2_structs::__m_generated_my_service_2::MGeneratedStructmy_service_2

Actual

Same wasm, 2 different Rust structs.

Expected

Can instance same module API 2 times which share same Rust types.

Solution:

[[module]]
    name = "my-service"
[[service]]
    name = "my-service_1"
    module = "my-service"
    mem_pages_count = 1
    logger_enabled = true
[[service]]
    name = "my-service_2"
    module = "my-service"
    mem_pages_count = 1
    logger_enabled = true    

In code

let mut s =my_service_1::new();
s =my_service_2::new();

Why?

I need test which checks replication logic.

@ValeryAntopol ValeryAntopol transferred this issue from fluencelabs/marine-rs-sdk Oct 11, 2021
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