test-tube icon indicating copy to clipboard operation
test-tube copied to clipboard

Change of visibility in macro

Open 0xstepit opened this issue 9 months ago • 2 comments

The macro fn_execute change the visibility of the created function when pub is not specified.

($name:ident: $req:ty[$type_url:expr] => $res:ty) => {
    pub fn $name(
        &self,
        msg: $req,
        signer: &$crate::SigningAccount,
    ) -> $crate::RunnerExecuteResult<$res> {
        self.runner.execute(msg, $type_url, signer)
    }
};
($name:ident: $req:ty => $res:ty) => {
    pub fn $name(
        &self,
        msg: $req,
        signer: &$crate::SigningAccount,
    ) -> $crate::RunnerExecuteResult<$res> {
        self.runner.execute(msg, <$req>::TYPE_URL, signer)
    }
};

I saw that in fn_query the visibility is maintained. Is this intentional? Thanks!

0xstepit avatar May 11 '24 11:05 0xstepit

Nice catch! will work on it!

iboss-ptk avatar Jun 21 '24 03:06 iboss-ptk

@iboss-ptk here the fix https://github.com/osmosis-labs/test-tube/pull/55

0xstepit avatar Jun 22 '24 10:06 0xstepit