You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ClientState derive requires context type to be specified through a #[generics(...)] annotation. However, this doesn’t work if the context type is generic. For example, consider the following:
use ibc::core::client::context::client_state::ClientState;#[derive(ClientState)]#[generics(/* ... */)]enumAnyClientState{}structContext<'a>(&'a ());
What should be put inside of the generics annotation to make the code work? Using:
results in the proc macro failing to recognise the annotation and output the following message: AnyClientState must be annotated with #[generics(ClientValidationContext = <your ClientValidationContext>, ClientExecutionContext: <your ClientExecutionContext>)]: Multiple errors: (expected :``. Removing the generic argument as in:
Feature Summary
ClientState derive requires context type to be specified through a
#[generics(...)]
annotation. However, this doesn’t work if the context type is generic. For example, consider the following:What should be put inside of the generics annotation to make the code work? Using:
results in the proc macro failing to recognise the annotation and output the following message: AnyClientState must be annotated with
#[generics(ClientValidationContext = <your ClientValidationContext>, ClientExecutionContext: <your ClientExecutionContext>)]: Multiple errors: (expected
:``. Removing the generic argument as in:results in compilation failure:
Proposal
For my use case it would be enough if generic attributes were recognised after the type.
The text was updated successfully, but these errors were encountered: