mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 09:27:59 +00:00
impl MaybeEmpty for H256 and u64 (aka AccountId in prod/tests) (#665)
* impl MaybeEmpty for H256 and u64 (aka AccountId in prod/tests) * binaries
This commit is contained in:
@@ -112,9 +112,17 @@ pub trait MaybeEmpty {
|
||||
fn is_empty(&self) -> bool;
|
||||
}
|
||||
|
||||
impl<T: Default + PartialEq> MaybeEmpty for T {
|
||||
// AccountId is `u64` in tests
|
||||
impl MaybeEmpty for u64 {
|
||||
fn is_empty(&self) -> bool {
|
||||
*self == T::default()
|
||||
self.is_zero()
|
||||
}
|
||||
}
|
||||
|
||||
// AccountId is H256 in production
|
||||
impl MaybeEmpty for substrate_primitives::H256 {
|
||||
fn is_empty(&self) -> bool {
|
||||
self.is_zero()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user