Skip to content

Commit

Permalink
Appeased clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Oct 22, 2024
1 parent f3f3330 commit 021f7e3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions smart-contracts/wasm-chain-integration/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,14 @@ impl<'a, R: RngCore, BackingStore: trie::BackingStoreLoad> machine::Host<Artifac
let mut cursor = Cursor::new(memory);
cursor.seek(SeekFrom::Start(ret_buf_start)).map_err(|_| anyhow!(seek_err))?;

let mut bytes = self
let bytes = self
.receive_entrypoint
.clone()
.context(unset_err("receive_entrypoint"))?
.to_string()
.into_bytes();

cursor.write(&mut bytes).map_err(|_| anyhow!(write_err))?;
cursor.write(&bytes).map_err(|_| anyhow!(write_err))?;
}
"verify_ed25519_signature" => {
let message_len = unsafe { stack.pop_u32() };
Expand Down Expand Up @@ -578,10 +578,10 @@ impl<'a, R: RngCore, BackingStore: trie::BackingStoreLoad> machine::Host<Artifac
cursor.read(&mut data)?;

hasher.update(&data);
let mut data_hash = hasher.finalize();
let data_hash = hasher.finalize();

cursor.seek(SeekFrom::Start(output_ptr)).map_err(|_| anyhow!(seek_err))?;
cursor.write(&mut data_hash).map_err(|_| anyhow!(write_err))?;
cursor.write(&data_hash).map_err(|_| anyhow!(write_err))?;
}
"hash_sha3_256" => {
let output_ptr = unsafe { stack.pop_u32() };
Expand All @@ -596,10 +596,10 @@ impl<'a, R: RngCore, BackingStore: trie::BackingStoreLoad> machine::Host<Artifac
cursor.read(&mut data)?;

hasher.update(&data);
let mut data_hash = hasher.finalize();
let data_hash = hasher.finalize();

cursor.seek(SeekFrom::Start(output_ptr)).map_err(|_| anyhow!(seek_err))?;
cursor.write(&mut data_hash).map_err(|_| anyhow!(write_err))?;
cursor.write(&data_hash).map_err(|_| anyhow!(write_err))?;
}
"hash_keccak_256" => {
let output_ptr = unsafe { stack.pop_u32() };
Expand All @@ -614,10 +614,10 @@ impl<'a, R: RngCore, BackingStore: trie::BackingStoreLoad> machine::Host<Artifac
cursor.read(&mut data)?;

hasher.update(&data);
let mut data_hash = hasher.finalize();
let data_hash = hasher.finalize();

cursor.seek(SeekFrom::Start(output_ptr)).map_err(|_| anyhow!(seek_err))?;
cursor.write(&mut data_hash).map_err(|_| anyhow!(write_err))?;
cursor.write(&data_hash).map_err(|_| anyhow!(write_err))?;
}
item_name => {
bail!("Unsupported host function call: {:?} {:?}", f.get_mod_name(), item_name)
Expand Down

0 comments on commit 021f7e3

Please sign in to comment.