rust-bitcoin / rust-bitcoincore-rpc

Rust RPC client library for the Bitcoin Core JSON-RPC API.
333 stars 245 forks source link

Deriving Deserialize for FundRawTransactionOptions #319

Open casey opened 10 months ago

casey commented 10 months ago

We have a mock bitcoin core rpc server which we use for tests. We want to use fundrawtransaction, but to do so, we need to implement Deserialize on FundRawTransactionOptions so that during testing, the test server can deserialize the RPC arguments.

It isn't possible to #[derive(Deserialize)] on FundRawTransactionOptions because the change_address field is an Option<Address>, and Address doesn't implement Deserialize, only Address<NetworkUnchecked> implements Deserialize.

Is there a workaround for this?