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

Not able to clone Api Client #350

Closed
zktony opened this issue Dec 3, 2021 · 2 comments
Closed

Not able to clone Api Client #350

zktony opened this issue Dec 3, 2021 · 2 comments

Comments

@zktony
Copy link

zktony commented Dec 3, 2021

When i am trying to clone Subxt Api, I am getting this error :-

error[E0599]: no method named `clone` found for struct `RuntimeApi` in the current scope
   --> enclave/src/relayer/mod.rs:219:24
    |
22  | #[subxt::subxt(runtime_metadata_path = "metadata.scale")]
    | --------------------------------------------------------- method `clone` not found for this
...
219 |         let api1 = api.clone();
    |                        ^^^^^ method not found in `RuntimeApi<DefaultConfig>`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `clone`, perhaps you need to implement it:
            candidate #1: `Clone`

Is there any other way, I can share it with other modules?

@DaviRain-Su
Copy link

https://github.com/octopus-network/octopusxt/blob/fa5f4340f0cd5358dc9414a1b6a0235e76b69b06/src/call_ibc.rs#L30

I think you can pass Client types between functions like this, and I think this will solve your problem.

@jsdw
Copy link
Collaborator

jsdw commented May 13, 2022

It's possible to clone the Client nowadays I believe, so I'll close this, but pelase re-open if you have issues still!

@jsdw jsdw closed this as completed May 13, 2022
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

3 participants