Coder Social home page Coder Social logo

Comments (2)

sleep-all-dae avatar sleep-all-dae commented on September 26, 2024
let _longhand_account_id = account_id_struct {
            name: name.parse().expect("Unable to parse Name"),
            domain_id: domain_id.parse().expect("Unable to parse domain id"),
        };

        let _id: AccountId = account_id
            .parse::<account_id_struct>()
            .expect("Unable to parse account id");

        let pub_key = PublicKey::from_str(
            "ed01207233BFC89DCBD68C19FDE6CE6158225298EC1131B6A130D1AEB454C1AB5183C1",
        )
        .unwrap();
      
       ##################################### Getting two errors from the line below
       // error: the trait bound `RegistrableBox: std::convert::From<IdentifiableBox>` is not satisfied
       //label: required by a bound introduced by this call

       //error: the trait bound `RegistrableBox: std::convert::From<IdentifiableBox>` is not satisfied
       //label: the trait `std::convert::From<IdentifiableBox>` is not implemented for `RegistrableBox`

        let _create_account = RegisterBox::new(IdentifiableBox::from(Account::new(_id, [pub_key])));
}

Hi, I am getting this above error even after I followed official documentation and the above example

from iroha-2-docs.

sleep-all-dae avatar sleep-all-dae commented on September 26, 2024

`
pub mod services_methods {

use iroha_crypto::PublicKey;
use iroha_data_model::{
    account::{Account, Id as account_id_struct},
    prelude::{AccountId, Domain, DomainId, Instruction, RegisterBox},
    IdentifiableBox,
};

pub fn create_new_account(account_id: String, domain_id: String, name: String) {
    let _longhand_account_id = account_id_struct {
        name: name.parse().expect("Unable to parse Name"),
        domain_id: domain_id.parse().expect("Unable to parse domain id"),
    };

    let _id: AccountId = account_id
        .parse::<AccountId>()
        .expect("Unable to parse account id");

    let pub_key = PublicKey::from_str(
        "ed01207233BFC89DCBD68C19FDE6CE6158225298EC1131B6A130D1AEB454C1AB5183C1",
    )
    .unwrap();

    let _create_account = RegisterBox::new(IdentifiableBox::from(Account::new(_id, [pub_key])));
}

}
`

above is the entire module.

from iroha-2-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.