Skip to content

Commit

Permalink
fix fmt and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
weilzkm committed Jan 11, 2025
1 parent 56cd779 commit 9f2583a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions emulator/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,8 @@ impl InstrumentedState {
u32::from_be_bytes(core::array::from_fn(|j| result[i * 4 + j]))
});
assert!(result.len() == 8);
for i in 0..result.len() {
self.state
.memory
.set_memory(a2 + ((i << 2) as u32), result[i]);
for (i, data) in result.iter().enumerate() {
self.state.memory.set_memory(a2 + ((i << 2) as u32), *data);
}
}
0xF0 => {
Expand Down
9 changes: 5 additions & 4 deletions runtime/precompiles/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ pub fn keccak(data: &[u8]) -> [u8; 32] {
let mut u32_array = Vec::new();

if len == 0 {
return [0xC5, 0xD2, 0x46, 0x01, 0x86, 0xF7, 0x23, 0x3C,
0x92, 0x7E, 0x7D, 0xB2, 0xDC, 0xC7, 0x03, 0xC0,
0xE5, 0 , 0xB6, 0x53, 0xCA, 0x82, 0x27, 0x3B,
0x7B, 0xFA, 0xD8, 0x04, 0x5D, 0x85, 0xA4, 0x70];
return [
0xC5, 0xD2, 0x46, 0x01, 0x86, 0xF7, 0x23, 0x3C, 0x92, 0x7E, 0x7D, 0xB2, 0xDC, 0xC7,
0x03, 0xC0, 0xE5, 0, 0xB6, 0x53, 0xCA, 0x82, 0x27, 0x3B, 0x7B, 0xFA, 0xD8, 0x04, 0x5D,
0x85, 0xA4, 0x70,
];
}

// 每 4 个字节转换为一个 u32
Expand Down

0 comments on commit 9f2583a

Please sign in to comment.