Skip to content
New issue

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

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

Already on GitHub? # to your account

getaddressifo is untested #57

Open
tcharding opened this issue Feb 11, 2025 · 2 comments
Open

getaddressifo is untested #57

tcharding opened this issue Feb 11, 2025 · 2 comments

Comments

@tcharding
Copy link
Member

tcharding commented Feb 11, 2025

Something is wrong with the pubkeys field of the getaddressinfo method.

The Core v17 docs for it are

  "pubkeys"                     (string, optional) Array of pubkeys associated with the known redeemscript (only if "script" is "multisig")
    [
      "pubkey"
      ,...
    ]

And we have an Option<Vec<String>> type for the field. It was suggested that we may need #[serde(default)] but I tried that to no avail. I also wondered if the docs were wrong and tried Option<String>.

In intergration_test we have a test that is feature gated out with #[cfg(feature = "TODO")] (search for get_address_info).

@apoelstra
Copy link
Member

serde(default) is about deserialization.

If you want to skip the field when serializing you can use #[serde(skip_serializing_if = "Option::is_none")].

@tcharding
Copy link
Member Author

The bug, unless I'm mad, is with deserializing the data returned by core into the GetAddressInfo struct. The current code looks right, I guess I'm doing something brain dead someplace though.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants