Repository navigation
Conversation
Signed-off-by: saket0187 <[email protected]>
Jean-Regis-M
left a comment
There was a problem hiding this comment.
tACK 29371ef
On Windows (Rust 1.100), the Caravan tests pass (9). With the parent's export.rs implementation and the new tests kept, both new tests fail (test_caravan_network_regtest_and_signet and test_caravan_import_ignores_unknown_key_fields), so each one covers its fix. Ignoring unknown key fields through #[serde(other)] plus IgnoredAny matches how the derived CaravanExport already treats unknown top-level fields.
One thing to be aware of with the regtest/signet aliases. I checked the uses of CaravanNetwork in src/. It's only stored on CaravanExport::network and never converted back to a bitcoin::Network, so nothing builds a wallet on the wrong chain from it. The information is gone after parsing, though: a regtest config reads back as Testnet, and serializing the export again writes "network": "testnet". That's the same lossy mapping From<bitcoin::Network> already uses, so it's consistent. But a caller that reads export.network to choose a chain would end up on testnet for a regtest config. A line in the Testnet variant's doc (or the changelog) saying signet and regtest configs land there too, and that the original network isn't kept, would make that explicit. Adding real Signet/Regtest variants would be the lossless option, but that's a breaking change and probably not worth it here.
|
Correction to my note above: the |
…network Signed-off-by: saket0187 <[email protected]>
|
Thanks for testing! |
caarloshenriq
left a comment
There was a problem hiding this comment.
tACK 6b45b8f
A real Caravan regtest export (with uuid, ledgerPolicyHmacs, per key method) now imports. Keys added with method: "text" still fail, since Caravan writes "bip32Path": "Unknown (...)" for them. Probably a follow up.
CaravanExport::from_strrejected configs downloaded from Caravan: hardware-wallet keys carry amethodfield, and regtest configs use a networkCaravanNetworkdidn't accept. Unknown key fields are now ignored, as the derivedCaravanExportalready does, andregtest/signetparse asTestnet, matchingFrom<bitcoin::Network>.Changelog notice