pub async fn handle(home: &Home, project_path: &Path, network: Url) -> Result<()> {
    let client = DevApiClient::new(reqwest::Client::new(), network)?;
    if !home.get_latest_key_path().exists() {
        return Err(anyhow!(
            "An account hasn't been created yet! Run shuffle account first."
        ));
    }
    let new_account_key = load_key(home.get_latest_key_path());
    println!("Using Public Key {}", &new_account_key.public_key());
    let derived_address =
        AuthenticationKey::ed25519(&new_account_key.public_key()).derived_address();
    println!(
        "Sending txn from address {}",
        derived_address.to_hex_literal()
    );

    let account_seq_number = client.get_account_sequence_number(derived_address).await?;
    let mut new_account = LocalAccount::new(derived_address, new_account_key, account_seq_number);

    let compiled_package = build_move_package(project_path.join(MAIN_PKG_PATH).as_ref())?;
    for module in compiled_package
        .transitive_compiled_modules()
        .compute_dependency_graph()
        .compute_topological_order()?
    {
        let module_id = module.self_id();
        if module_id.address() != &new_account.address() {
            println!("Skipping Module: {}", module_id);
            continue;
        }
        println!("Deploying Module: {}", module_id);
        let mut binary = vec![];
        module.serialize(&mut binary)?;

        let hash = send_module_transaction(&client, &mut new_account, binary).await?;
        check_txn_executed_from_hash(&client, hash.as_str()).await?;
    }

    Ok(())
}
/// Deploys shuffle's main Move Package to the sender's address.
Deploys shuffle's main Move Package to the sender's address.
Deploys shuffle ' s main Move Package to the sender ' s address .
pub async fn handle(home: &Home, project_path: &Path, network: Url) -> Result<()> {
    let client = DevApiClient::new(reqwest::Client::new(), network)?;
    if !home.get_latest_key_path().exists() {
        return Err(anyhow!(
            "An account hasn't been created yet! Run shuffle account first."
        ));
    }
    let new_account_key = load_key(home.get_latest_key_path());
    println!("Using Public Key {}", &new_account_key.public_key());
    let derived_address =
        AuthenticationKey::ed25519(&new_account_key.public_key()).derived_address();
    println!(
        "Sending txn from address {}",
        derived_address.to_hex_literal()
    );
    let account_seq_number = client.get_account_sequence_number(derived_address).await?;
    let mut new_account = LocalAccount::new(derived_address, new_account_key, account_seq_number);
    let compiled_package = build_move_package(project_path.join(MAIN_PKG_PATH).as_ref())?;
    for module in compiled_package
        .transitive_compiled_modules()
        .compute_dependency_graph()
        .compute_topological_order()?
    {
        let module_id = module.self_id();
        if module_id.address() != &new_account.address() {
            println!("Skipping Module: {}", module_id);
            continue;
        }
        println!("Deploying Module: {}", module_id);
        let mut binary = vec![];
        module.serialize(&mut binary)?;
        let hash = send_module_transaction(&client, &mut new_account, binary).await?;
        check_txn_executed_from_hash(&client, hash.as_str()).await?;
    }
    Ok(())
}
pub async fn handle ( home : & Home , project_path : & Path , network : Url ) -> Result < ( ) > { let client = DevApiClient :: new ( reqwest :: Client :: new ( ) , network ) ? ; if ! home . get_latest_key_path ( ) . exists ( ) { return Err ( anyhow ! ( " " ) ) ; } let new_account_key = load_key ( home . get_latest_key_path ( ) ) ; println ! ( " " new_account_key public_key ( ) ) ; let derived_address = AuthenticationKey :: ed25519 ( & new_account_key . public_key ( ) ) . derived_address ( ) ; println ! ( " " derived_address to_hex_literal ( ) ) ; let account_seq_number = client . get_account_sequence_number ( derived_address ) . await ? ; let mut new_account = LocalAccount :: new ( derived_address , new_account_key , account_seq_number ) ; let compiled_package = build_move_package ( project_path . join ( MAIN_PKG_PATH ) . as_ref ( ) ) ? ; for module in compiled_package . transitive_compiled_modules ( ) . compute_dependency_graph ( ) . compute_topological_order ( ) ? { let module_id = module . self_id ( ) ; if module_id . address ( ) != & new_account . address ( ) { println ! ( " " module_id ) ; continue ; } println ! ( " " module_id ) ; let mut binary = vec ! [ ] ; module . serialize ( & mut binary ) ? ; let hash = send_module_transaction ( & client , & mut new_account , binary ) . await ? ; check_txn_executed_from_hash ( & client , hash . as_str ( ) ) . await ? ; } Ok ( ( ) ) }
Deploys shuffle's main Move Package to the sender's address.
Deploys shuffle ' s main Move Package to the sender ' s address .
home
&Home
project_path
&Path
network
Url
home
&Home
project_path
&Path
network
Url