gears icon indicating copy to clipboard operation
gears copied to clipboard

[BUG]: RoutingMessage macro requires dependencies to be added in the module it is applied

Open joneskm opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What happened?

An error is returned when applying the RoutingMessage macro to a struct if AcAddress is not imported into the module:

cannot find type `AccAddress` in this scope
...
consider importing this struct: `use proto_types::AccAddress;

Gears version

main

Steps to reproduce?

The following causes an error (un-commenting fixes the problem)

use gears_derive::RoutingMessage;
//use proto_types::AccAddress;
use serde::Serialize;

#[derive(Debug, Clone, RoutingMessage, Serialize)]
#[serde(untagged)]
pub enum Message {
    #[gears(url = "/cosmos.bank.v1beta1")]
    Bank(bank::Message),
}

joneskm avatar Jan 22 '24 16:01 joneskm