Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No addresses with label xxxxx #209

Closed
h10086733 opened this issue Apr 1, 2024 · 5 comments
Closed

No addresses with label xxxxx #209

h10086733 opened this issue Apr 1, 2024 · 5 comments

Comments

@h10086733
Copy link

cargo run ./examples/configurations/alice.yml
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
Running /home/qiyun/project/rust-dlc/target/debug/sample ./examples/configurations/alice.yml
Node public key: 033ef46ab0d0fc2d2fbee8d4e105e9a1f12bd12812ab3d81a169242e6f68292ee1

offercontract 033ef46ab0d0fc2d2fbee8d4e105e9a1f12bd12812ab3d81a169242e6f68292ee1@127.0.0.1:9000 ./examples/contracts/numerical_contract_input.json
Checking for messages
bitcore wallet
thread 'tokio-runtime-worker' panicked at sample/src/cli.rs:202:38:
Error sending offer: WalletError(RpcError(JsonRpc(Rpc(RpcError { code: -11, message: "No addresses with label d411a6ba677fb62a66a90d6298757e8327f72375c913a63b686ecd158adcab01", data: None }))))
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
thread 'main' panicked at sample/src/cli.rs:215:22:
called Result::unwrap() on an Err value: JoinError::Panic(Id(25), ...)

What is the reason for this?

@h10086733
Copy link
Author

fn derive_contract_signer(&self, keys_id: [u8; 32]) -> Result<Self::Signer, ManagerError> {
    println!("bitcore wallet");
    let label_map = self
        .client
        .lock()
        .unwrap()
        .call::<HashMap<Address<NetworkUnchecked>, Value>>(
            "getaddressesbylabel",
            &[Value::String(keys_id.to_lower_hex_string())],
        )
        .map_err(rpc_err_to_manager_err)?;

Is it feasible for me to successfully access the randomly generated keys_id by changing it to "bech32"?

fn get_new_change_address(&self) -> Result<Address, ManagerError> {
    println!("get_new_change_address ");
    Ok(self
        .client
        .lock()
        .unwrap()
        .call::<Address<NetworkUnchecked>>(
            "getrawchangeaddress",
            &[Value::Null, opt_into_json(Some(AddressType::Bech32))?],
        )
        .map_err(rpc_err_to_manager_err)?
        .assume_checked())
}

In addition, when I call getrawchangeaddress, it will call the data from the local main network. I changed it to rpc method and the request passed the test. Can I modify it like this?

Fn get_new_change.address (&self) ->Result<Address, ManagerError>{

Ok (self

. client

. lock()

. unwrap()

. get_raw_change.address (Some (AddressType: Bech32))

. map_err (rpc_err_to_manager_err)?

. assume_checked()

}

@Tibo-lg
Copy link
Contributor

Tibo-lg commented Apr 2, 2024

What is the reason for this?

Hard to say, maybe try to delete the data folder for both parties (should be called dlc_sample_alice and dlc_sample_bob) and try again see if it fixes it?

Also not sure I understand your other question, but I just realized that the tests for the sample are not set up as they should so I'll fix that and see if there is any issue.

@Tibo-lg
Copy link
Contributor

Tibo-lg commented Apr 3, 2024

@h10086733 I could reproduce the issue I will work on fixing it.

@Tibo-lg
Copy link
Contributor

Tibo-lg commented Apr 3, 2024

@h10086733 Can you check the branch from PR #210? I think it should fix the issues you had.

@h10086733
Copy link
Author

@h10086733 Can you check the branch from PR #210? I think it should fix the issues you had.

Well done! Thanks

@Tibo-lg Tibo-lg closed this as completed Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants