async fn assert_neurons_can_only_be_donated_by_account_owner(nns_canisters: &NnsCanisters<'_>) {
    let gtc = &nns_canisters.genesis_token;

    let sign_cmd = move |msg: &[u8]| Ok(TEST_IDENTITY_3.sign(msg));

    let sender = Sender::ExternalHsm {
        pub_key: der_encode(&TEST_IDENTITY_3.public_key()),
        sign: Arc::new(sign_cmd),
    };

    // Assert that one user can't claim another user's neurons
    let donate_account_response: Result<Result<(), String>, String> = gtc
        .update_from_sender(
            "donate_account",
            candid,
            (TEST_IDENTITY_1.public_key_hex,),
            &sender,
        )
        .await;
    assert!(donate_account_response.unwrap().is_err());
}
/// Assert that users can't donate other users' neurons
///
/// Identity 3 tries to donate Identity 1's neurons, but fails to do so
Assert that users can't donate other users' neurons
Identity 3 tries to donate Identity 1's neurons, but fails to do so
Assert that users can ' t donate other users ' neurons Identity 3 tries to donate Identity 1 ' s neurons but fails to do so
async fn assert_neurons_can_only_be_donated_by_account_owner(nns_canisters: &NnsCanisters<'_>) {
    let gtc = &nns_canisters.genesis_token;
    let sign_cmd = move |msg: &[u8]| Ok(TEST_IDENTITY_3.sign(msg));
    let sender = Sender::ExternalHsm {
        pub_key: der_encode(&TEST_IDENTITY_3.public_key()),
        sign: Arc::new(sign_cmd),
    };
    // Assert that one user can't claim another user's neurons
    let donate_account_response: Result<Result<(), String>, String> = gtc
        .update_from_sender(
            "donate_account",
            candid,
            (TEST_IDENTITY_1.public_key_hex,),
            &sender,
        )
        .await;
    assert!(donate_account_response.unwrap().is_err());
}
async fn assert_neurons_can_only_be_donated_by_account_owner ( nns_canisters : & NnsCanisters < ' _ > ) { let gtc = & nns_canisters . genesis_token ; let sign_cmd = move | msg : & [ u8 ] | Ok ( TEST_IDENTITY_3 . sign ( msg ) ) ; let sender = Sender :: ExternalHsm { pub_key : der_encode ( & TEST_IDENTITY_3 . public_key ( ) ) , sign : Arc :: new ( sign_cmd ) , } ; // Assert that one user can't claim another user's neurons let donate_account_response : Result < Result < ( ) , String > , String > = gtc . update_from_sender ( " " , candid , ( TEST_IDENTITY_1 . public_key_hex , ) , & sender , ) . await ; assert ! ( donate_account_response unwrap ( ) is_err ( ) ) ; }
Assert that users can't donate other users' neurons
Identity 3 tries to donate Identity 1's neurons, but fails to do so
Assert that users can ' t donate other users ' neurons Identity 3 tries to donate Identity 1 ' s neurons but fails to do so
nns_canisters
&NnsCanisters<'_>
nns_canisters
&NnsCanisters<'_>