Skip to content

Commit

Permalink
Implement supertraits
Browse files Browse the repository at this point in the history
  • Loading branch information
lattejed committed Oct 21, 2022
1 parent 9c3a55e commit c0dbf6e
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions chains/nomad-substrate/src/aws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use subxt::{
crypto::{CryptoTypePublicPair, Derive, UncheckedFrom},
ecdsa, ByteArray, DeriveJunction, Pair as TraitPair, Public as TraitPublic,
},
sp_runtime::{CryptoType, MultiSignature, MultiSigner},
sp_runtime::{CryptoType, MultiSignature},
},
};
use tokio::time::sleep;
Expand Down Expand Up @@ -165,20 +165,20 @@ impl ByteArray for Public {
}

impl std::fmt::Display for Public {
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
todo!()
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{}", hex::encode(self.as_ref()))
}
}

impl AsRef<[u8]> for Public {
fn as_ref(&self) -> &[u8] {
todo!()
&self.0[..]
}
}

impl AsMut<[u8]> for Public {
fn as_mut(&mut self) -> &mut [u8] {
todo!()
&mut self.0[..]
}
}

Expand Down Expand Up @@ -206,13 +206,7 @@ impl TryFrom<&[u8]> for Public {

impl TraitPublic for Public {
fn to_public_crypto_pair(&self) -> CryptoTypePublicPair {
todo!()
}
}

impl From<Public> for MultiSigner {
fn from(_x: Public) -> Self {
todo!()
CryptoTypePublicPair(ecdsa::CRYPTO_ID, self.as_ref().to_vec())
}
}

Expand Down

0 comments on commit c0dbf6e

Please sign in to comment.