osmosis-labs / osmosis-rust

Rust libraries for osmosis
Apache License 2.0
59 stars 52 forks source link

Make int type field optional on demand #91

Closed iboss-ptk closed 11 months ago

iboss-ptk commented 11 months ago

For case like #88, the int field allowed to be empty.

Todo

Modify this transformer to also take src: &Path, descriptor: &FileDescriptorSet, with that we can use get_type_url in the transformer and allow us to specify optional int field (hence empty string) like so

 transformers::allow_serde_int_as_str(src, s, descriptor, 
   // optional int fields
   vec![
    ("/osmosis.incentives.MsgCreateGauge", vec!["pool_id"])
  ]
)

as opposed to [original]

iboss-ptk commented 11 months ago

This is intended to be a fix for #89 but it does not seems to worth the hack as for that case, just passing pool_id = 0 works