pub async fn create_identity(
        &self,
        pair: Pair,
    ) -> Result<Vec<u32>, Box<dyn std::error::Error>> {
        println!("Submit a new identity to the Fennel network.");
        env_logger::init();
        let mut vec: Vec<u32> = Vec::new();

        let signer = PairSigner::<DefaultConfig, DefaultExtra<DefaultConfig>, _>::new(pair);

        let identity = self
            .runtime
            .tx()
            .identity_module()
            .create_identity()
            .sign_and_submit_then_watch(&signer)
            .await?
            .wait_for_finalized_success()
            .await
            .unwrap();

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

        if let Some(event) = identity_event {
            match event {
                fennel::identity_module::events::IdentityCreated(a, _) => {
                    println!("Fennel Protocol Identity successfully created.");
                    vec.push(a);
                    return Ok(vec);
                }
            }
        } else {
            println!("Failed to find identity_module::Transfer Event");
        }
        Ok(vec)
    }
/// Submit a new identity to the Fennel network.
Submit a new identity to the Fennel network.
Submit a new identity to the Fennel network .
pub async fn create_identity(
        &self,
        pair: Pair,
    ) -> Result<Vec<u32>, Box<dyn std::error::Error>> {
        println!("Submit a new identity to the Fennel network.");
        env_logger::init();
        let mut vec: Vec<u32> = Vec::new();
        let signer = PairSigner::<DefaultConfig, DefaultExtra<DefaultConfig>, _>::new(pair);
        let identity = self
            .runtime
            .tx()
            .identity_module()
            .create_identity()
            .sign_and_submit_then_watch(&signer)
            .await?
            .wait_for_finalized_success()
            .await
            .unwrap();
        let identity_event =
            identity.find_first_event::<fennel::identity_module::events::IdentityCreated>()?;
        if let Some(event) = identity_event {
            match event {
                fennel::identity_module::events::IdentityCreated(a, _) => {
                    println!("Fennel Protocol Identity successfully created.");
                    vec.push(a);
                    return Ok(vec);
                }
            }
        } else {
            println!("Failed to find identity_module::Transfer Event");
        }
        Ok(vec)
    }
pub async fn create_identity ( & self , pair : Pair , ) -> Result < Vec < u32 > , Box < dyn std :: error :: Error > > { println ! ( " " ) ; env_logger :: init ( ) ; let mut vec : Vec < u32 > = Vec :: new ( ) ; let signer = PairSigner :: < DefaultConfig , DefaultExtra < DefaultConfig > , _ > :: new ( pair ) ; let identity = self . runtime . tx ( ) . identity_module ( ) . create_identity ( ) . sign_and_submit_then_watch ( & signer ) . await ? . wait_for_finalized_success ( ) . await . unwrap ( ) ; let identity_event = identity . find_first_event :: < fennel :: identity_module :: events :: IdentityCreated > ( ) ? ; if let Some ( event ) = identity_event { match event { fennel :: identity_module :: events :: IdentityCreated ( a , _ ) => { println ! ( " " ) ; vec . push ( a ) ; return Ok ( vec ) ; } } } else { println ! ( " " ) ; } Ok ( vec ) }
Submit a new identity to the Fennel network.
Submit a new identity to the Fennel network .
&self
pair
Pair
&self
pair
Pair