From ceb429418ea1379b34938cb043548943555a6ef8 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Tue, 31 Aug 2021 08:34:31 +0000 Subject: [PATCH] test: mock CrossAccountId::from_eth --- --- a/pallets/nft/src/mock.rs +++ b/pallets/nft/src/mock.rs @@ -129,8 +129,11 @@ fn as_sub(&self) -> &u64 { &self.0 } - fn from_eth(_eth: sp_core::H160) -> Self { - unimplemented!() + fn from_eth(eth: sp_core::H160) -> Self { + let mut sub_raw = [0; 8]; + sub_raw.copy_from_slice(ð.0[0..8]); + let sub = u64::from_be_bytes(sub_raw); + Self(sub, eth) } fn as_eth(&self) -> &sp_core::H160 { &self.1 -- gitstuff