pub async fn announce_public_key(
        &self,
        signer: Pair,
        fingerprint: Vec<u8>,
        location: Vec<u8>,
    ) -> Result<(), Box<dyn std::error::Error>> {
        env_logger::init();
        let signer = PairSigner::<DefaultConfig, DefaultExtra<DefaultConfig>, _>::new(signer);

        let identity = self
            .runtime
            .tx()
            .keystore_module()
            .announce_key(fingerprint, location)
            .sign_and_submit_then_watch(&signer)
            .await?
            .wait_for_finalized_success()
            // FIXME: Should be in error enum with GenericError
            .await
            .unwrap();

        let identity_event =
            identity.find_first_event::<fennel::identity_module::events::IdentityCreated>()?;

        if let Some(event) = identity_event {
            println!("Identity Create success: {event:?}");
        } else {
            println!("Failed to find identity_module::Transfer Event");
        }
        Ok(())
    }
/// Upload a public key to Fennel Protocol.
Upload a public key to Fennel Protocol.
Upload a public key to Fennel Protocol .
pub async fn announce_public_key(
        &self,
        signer: Pair,
        fingerprint: Vec<u8>,
        location: Vec<u8>,
    ) -> Result<(), Box<dyn std::error::Error>> {
        env_logger::init();
        let signer = PairSigner::<DefaultConfig, DefaultExtra<DefaultConfig>, _>::new(signer);
        let identity = self
            .runtime
            .tx()
            .keystore_module()
            .announce_key(fingerprint, location)
            .sign_and_submit_then_watch(&signer)
            .await?
            .wait_for_finalized_success()
            // FIXME: Should be in error enum with GenericError
            .await
            .unwrap();
        let identity_event =
            identity.find_first_event::<fennel::identity_module::events::IdentityCreated>()?;
        if let Some(event) = identity_event {
            println!("Identity Create success: {event:?}");
        } else {
            println!("Failed to find identity_module::Transfer Event");
        }
        Ok(())
    }
pub async fn announce_public_key ( & self , signer : Pair , fingerprint : Vec < u8 > , location : Vec < u8 > , ) -> Result < ( ) , Box < dyn std :: error :: Error > > { env_logger :: init ( ) ; let signer = PairSigner :: < DefaultConfig , DefaultExtra < DefaultConfig > , _ > :: new ( signer ) ; let identity = self . runtime . tx ( ) . keystore_module ( ) . announce_key ( fingerprint , location ) . sign_and_submit_then_watch ( & signer ) . await ? . wait_for_finalized_success ( ) // FIXME: Should be in error enum with GenericError . await . unwrap ( ) ; let identity_event = identity . find_first_event :: < fennel :: identity_module :: events :: IdentityCreated > ( ) ? ; if let Some ( event ) = identity_event { println ! ( " " ) ; } else { println ! ( " " ) ; } Ok ( ( ) ) }
Upload a public key to Fennel Protocol.
Upload a public key to Fennel Protocol .
&self
signer
Pair
fingerprint
Vec<u8>
location
Vec<u8>
&self
signer
Pair
fingerprint
Vec<u8>
location
Vec<u8>