Skip to content

Commit 1b38229

Browse files
committed
Use TypeScript polyfill
1 parent 4e8d217 commit 1b38229

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

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

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

43-
cw_schema::NodeType::Decimal { precision: _, signed: _ } => {
43+
cw_schema::NodeType::Decimal {
44+
precision: _,
45+
signed: _,
46+
} => {
4447
// ToDo: Actually use a decimal type here
4548
"String".into()
4649
}
@@ -49,7 +52,7 @@ fn expand_node_name<'a>(
4952
cw_schema::NodeType::HexBinary => {
5053
// ToDo: Actually use a hex-encoded binary type here
5154
"String".into()
52-
},
55+
}
5356
cw_schema::NodeType::Timestamp => "cosmrs::tendermint::Time".into(),
5457
cw_schema::NodeType::Unit => "()".into(),
5558
}

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@ fn expand_node_name<'a>(
3939

4040
cw_schema::NodeType::Decimal { .. } => "z.string()".into(),
4141
cw_schema::NodeType::Address => "z.string()".into(),
42-
cw_schema::NodeType::Checksum => todo!(),
43-
cw_schema::NodeType::HexBinary => todo!(),
42+
cw_schema::NodeType::Checksum => {
43+
// ToDo: Use actual checksum types
44+
"z.string()".into()
45+
}
46+
cw_schema::NodeType::HexBinary => {
47+
// ToDo: Actually use a binary decoding hex type
48+
"z.string()".into()
49+
}
4450
cw_schema::NodeType::Timestamp => {
4551
// ToDo: Replace with better type
4652
"z.string()".into()

packages/cw-schema-codegen/tests/typescript.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ fn assert_validity() {
135135

136136
// make sure the dependencies are installed
137137
let install_status = Command::new("npm")
138-
.arg("i")
139-
.current_dir(&e2e_dir)
140-
.status()
141-
.unwrap();
142-
assert!(install_status.success());
138+
.arg("i")
139+
.current_dir(&e2e_dir)
140+
.status()
141+
.unwrap();
142+
assert!(install_status.success());
143143

144144
let random_data: [u8; 255] = rand::random();
145145
let mut unstructured = arbitrary::Unstructured::new(&random_data);

0 commit comments

Comments
 (0)