mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-25 15:17:57 +00:00
Refactor: simplify module call definitions (#24)
* Refactor: simplify module call definitions * Fix compilation errors after merge * Add missing comments and remove unused imports * Now it compiles
This commit is contained in:
+1
-11
@@ -1,8 +1,4 @@
|
||||
use parity_scale_codec::{
|
||||
Encode,
|
||||
EncodeAsRef,
|
||||
HasCompact,
|
||||
};
|
||||
use parity_scale_codec::Encode;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Encoded(pub Vec<u8>);
|
||||
@@ -12,9 +8,3 @@ impl Encode for Encoded {
|
||||
self.0.to_owned()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn compact<T: HasCompact>(t: T) -> Encoded {
|
||||
let encodable: <<T as HasCompact>::Type as EncodeAsRef<'_, T>>::RefType =
|
||||
From::from(&t);
|
||||
Encoded(encodable.encode())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user