Skip to content

Commit 6a4d45b

Browse files
committed
chore: Update after review
1 parent f7f784a commit 6a4d45b

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

packages/std/src/binary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl Binary {
7676
}
7777

7878
pub fn to_hex(&self) -> String {
79-
hex::encode(self.0.clone())
79+
hex::encode(&self.0)
8080
}
8181
}
8282

packages/std/src/testing/mock.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,10 @@ impl Envs {
533533
},
534534
transaction: Some(TransactionInfo::new(
535535
3,
536-
Binary::from_hex("0102030405060708").unwrap(),
536+
Binary::from_hex(
537+
"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3",
538+
)
539+
.unwrap(),
537540
)),
538541
contract: ContractInfo {
539542
address: self.contract_address.clone(),
@@ -1467,7 +1470,10 @@ mod tests {
14671470
},
14681471
transaction: Some(TransactionInfo::new(
14691472
3,
1470-
Binary::from_hex("E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3").unwrap(),
1473+
Binary::from_hex(
1474+
"E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3"
1475+
)
1476+
.unwrap(),
14711477
)),
14721478
contract: ContractInfo {
14731479
address: Addr::unchecked(MOCK_CONTRACT_ADDR)

packages/std/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// Implements a hidden constructor for non-exhaustive structures that need
22
/// to be built in libraries like cw-multi-test.
33
macro_rules! impl_hidden_constructor {
4-
( $response:ty, $( $field: ident : $t: ty),* ) => {
5-
impl $response {
4+
( $type:ty, $( $field: ident : $t: ty),* ) => {
5+
impl $type {
66
/// Constructor for testing frameworks such as cw-multi-test.
77
/// This is required because the type is #[non_exhaustive].
88
/// As a contract developer you should not need this constructor since

packages/vm/src/instance.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ mod tests {
921921

922922
let report2 = instance.create_gas_report();
923923
assert_eq!(report2.used_externally, 251);
924-
assert_eq!(report2.used_internally, 17953755);
924+
assert_eq!(report2.used_internally, 18034325);
925925
assert_eq!(report2.limit, LIMIT);
926926
assert_eq!(
927927
report2.remaining,
@@ -1088,7 +1088,7 @@ mod tests {
10881088
.unwrap();
10891089

10901090
let init_used = orig_gas - instance.get_gas_left();
1091-
assert_eq!(init_used, 17954006);
1091+
assert_eq!(init_used, 18034576);
10921092
}
10931093

10941094
#[test]
@@ -1113,7 +1113,7 @@ mod tests {
11131113
.unwrap();
11141114

11151115
let execute_used = gas_before_execute - instance.get_gas_left();
1116-
assert_eq!(execute_used, 24613486);
1116+
assert_eq!(execute_used, 24624251);
11171117
}
11181118

11191119
#[test]
@@ -1156,6 +1156,6 @@ mod tests {
11561156
);
11571157

11581158
let query_used = gas_before_query - instance.get_gas_left();
1159-
assert_eq!(query_used, 11119756);
1159+
assert_eq!(query_used, 11105221);
11601160
}
11611161
}

packages/vm/src/testing/mock.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ pub fn mock_env() -> Env {
282282
},
283283
transaction: Some(TransactionInfo::new(
284284
3,
285-
Binary::from_hex("E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3").unwrap(),
285+
Binary::from_hex("E5469DACEC17CEF8A260FD37675ED87E7FB6A2B5AD95193C51308006C7E494B3")
286+
.unwrap(),
286287
)),
287288
contract: ContractInfo {
288289
address: Addr::unchecked(contract_addr),

0 commit comments

Comments
 (0)