Skip to content

Commit 224b80c

Browse files
committed
Make checksum HexBinary
1 parent afd3c34 commit 224b80c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/std/src/query/wasm.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use schemars::JsonSchema;
22
use serde::{Deserialize, Serialize};
33

44
use crate::Binary;
5+
#[cfg(feature = "cosmwasm_1_2")]
6+
use crate::HexBinary;
57

68
use super::query_response::QueryResponseType;
79

@@ -80,7 +82,7 @@ pub struct CodeInfoResponse {
8082
/// The address that initially stored the code
8183
pub creator: String,
8284
/// The hash of the Wasm blob
83-
pub checksum: Binary,
85+
pub checksum: HexBinary,
8486
}
8587

8688
#[cfg(feature = "cosmwasm_1_2")]

packages/std/src/testing/mock.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,14 +1492,14 @@ mod tests {
14921492
}
14931493
#[cfg(feature = "cosmwasm_1_2")]
14941494
WasmQuery::CodeInfo { code_id } => {
1495+
use crate::{CodeInfoResponse, HexBinary};
14951496
let code_id = *code_id;
14961497
if code_id == 4 {
1497-
use crate::CodeInfoResponse;
14981498
let response = CodeInfoResponse {
14991499
code_id,
15001500
creator: "lalala".into(),
1501-
checksum: Binary::from_base64(
1502-
"hM8ggQ/UKcr1iJjDIQ/LcXWaJ77N2uCNvehmjqL0cl0=",
1501+
checksum: HexBinary::from_hex(
1502+
"84cf20810fd429caf58898c3210fcb71759a27becddae08dbde8668ea2f4725d",
15031503
)
15041504
.unwrap(),
15051505
};
@@ -1572,7 +1572,7 @@ mod tests {
15721572
match result {
15731573
SystemResult::Ok(ContractResult::Ok(value)) => assert_eq!(
15741574
value,
1575-
br#"{"code_id":4,"creator":"lalala","checksum":"hM8ggQ/UKcr1iJjDIQ/LcXWaJ77N2uCNvehmjqL0cl0="}"#
1575+
br#"{"code_id":4,"creator":"lalala","checksum":"84cf20810fd429caf58898c3210fcb71759a27becddae08dbde8668ea2f4725d"}"#
15761576
),
15771577
res => panic!("Unexpected result: {:?}", res),
15781578
}

0 commit comments

Comments
 (0)