fix clippy (#715)

* fix clippy

* remove used id in codegen

* fix clippy again
This commit is contained in:
Niklas Adolfsson
2022-11-11 12:03:23 +01:00
committed by GitHub
parent 33a9ec91af
commit 9235d5041c
10 changed files with 18 additions and 20 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ impl DecodeWithMetadata for DecodedValueThunk {
metadata: &Metadata,
) -> Result<Self::Target, Error> {
let mut v = Vec::with_capacity(bytes.len());
v.extend_from_slice(*bytes);
v.extend_from_slice(bytes);
*bytes = &[];
Ok(DecodedValueThunk {
type_id,
+1 -1
View File
@@ -68,7 +68,7 @@ where
let event_bytes = client
.rpc()
.storage(&*system_events_key().0, Some(block_hash))
.storage(&system_events_key().0, Some(block_hash))
.await?
.map(|e| e.0)
.unwrap_or_else(Vec::new);
+2 -2
View File
@@ -18,8 +18,8 @@ pub fn write_storage_address_root_bytes<Address: StorageAddress>(
addr: &Address,
out: &mut Vec<u8>,
) {
out.extend(&sp_core::twox_128(addr.pallet_name().as_bytes()));
out.extend(&sp_core::twox_128(addr.entry_name().as_bytes()));
out.extend(sp_core::twox_128(addr.pallet_name().as_bytes()));
out.extend(sp_core::twox_128(addr.entry_name().as_bytes()));
}
/// Outputs the [`storage_address_root_bytes`] as well as any additional bytes that represent
+1 -1
View File
@@ -138,7 +138,7 @@ impl<'a> TxPayload for DynamicTxPayload<'a> {
let pallet = metadata.pallet(&self.pallet_name)?;
let call_id = pallet.call_ty_id().ok_or(MetadataError::CallNotFound)?;
let call_value =
Value::unnamed_variant(self.call_name.to_owned(), self.fields.clone());
Value::unnamed_variant(self.call_name.clone(), self.fields.clone());
pallet.index().encode_to(out);
scale_value::scale::encode_as_type(&call_value, call_id, metadata.types(), out)?;