Skip to content

Commit 4e8d217

Browse files
committed
Add polyfill types to Rust codegen
1 parent dcbc887 commit 4e8d217

File tree

1 file changed

+9
-3
lines changed
  • packages/cw-schema-codegen/src/rust

1 file changed

+9
-3
lines changed

packages/cw-schema-codegen/src/rust/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,18 @@ fn expand_node_name<'a>(
4040
}
4141
cw_schema::NodeType::Enum { .. } => node.name.as_ref().into(),
4242

43-
cw_schema::NodeType::Decimal { precision, signed } => todo!(),
43+
cw_schema::NodeType::Decimal { precision: _, signed: _ } => {
44+
// ToDo: Actually use a decimal type here
45+
"String".into()
46+
}
4447
cw_schema::NodeType::Address => "cosmrs::AccountId".into(),
4548
cw_schema::NodeType::Checksum => "cosmrs::tendermint::Hash".into(),
46-
cw_schema::NodeType::HexBinary => todo!(),
49+
cw_schema::NodeType::HexBinary => {
50+
// ToDo: Actually use a hex-encoded binary type here
51+
"String".into()
52+
},
4753
cw_schema::NodeType::Timestamp => "cosmrs::tendermint::Time".into(),
48-
cw_schema::NodeType::Unit => Cow::Borrowed("()"),
54+
cw_schema::NodeType::Unit => "()".into(),
4955
}
5056
}
5157

0 commit comments

Comments
 (0)