Skip to content

Commit ae1203d

Browse files
committed
Change go-gen type mapping
1 parent 89c5dbe commit ae1203d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/go-gen/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub fn build_enum_variant(
198198
#[cfg(test)]
199199
mod tests {
200200
use cosmwasm_schema::cw_serde;
201-
use cosmwasm_std::{Binary, Empty, HexBinary, Uint128};
201+
use cosmwasm_std::{Binary, Checksum, Empty, HexBinary, Uint128};
202202

203203
use super::*;
204204

@@ -241,6 +241,7 @@ mod tests {
241241
binary: Binary,
242242
nested_binary: Vec<Option<Binary>>,
243243
hex_binary: HexBinary,
244+
checksum: Checksum,
244245
uint128: Uint128,
245246
}
246247

@@ -252,7 +253,8 @@ mod tests {
252253
r#"
253254
type SpecialTypes struct {
254255
Binary []byte `json:"binary"`
255-
HexBinary Checksum `json:"hex_binary"`
256+
Checksum Checksum `json:"checksum"`
257+
HexBinary string `json:"hex_binary"`
256258
NestedBinary []*[]byte `json:"nested_binary"`
257259
Uint128 string `json:"uint128"`
258260
}"#,

packages/go-gen/src/schema.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ pub fn custom_type_of(ty: &str) -> Option<&str> {
261261
match ty {
262262
"Uint128" => Some("string"),
263263
"Binary" => Some("[]byte"),
264-
"HexBinary" => Some("Checksum"),
264+
"HexBinary" => Some("string"),
265+
"Checksum" => Some("Checksum"),
265266
"Addr" => Some("string"),
266267
"Decimal" => Some("string"),
267268
"Decimal256" => Some("string"),

0 commit comments

Comments
 (0)