rust-bitcoin-unsafe-fast/bitcoin/src/network
Andrew Poelstra c93e83e94b
Merge rust-bitcoin/rust-bitcoin#1428: Adds Network::from_core_arg and links it to Network::from_str
d7006ef80d Adds roundtrip tests for Network::from_core_arg (Sergi Delgado Segura)
bd1eb29f61 Adds Network::to_core_arg (Sergi Delgado Segura)

Pull request description:

  Comming from https://github.com/rust-bitcoin/rust-bitcoincore-rpc/pull/247

  `Network::from_str` only considers `rust-bitcoin` string as possible inputs to create a `Network` instance. This PR adds a new method to `Network`, `from_core_arg`, which is complementary to the existing `Network::to_core_arg`. This method allows the conversion between `bitcoind -network` string and `Network` variants.

  This also links `Network::from_str` to `Network::from_core_arg` so the default case on the former calls the latter, and an error is only returned if none of the cases match.

ACKs for top commit:
  Kixunil:
    ACK d7006ef80d
  apoelstra:
    ACK d7006ef80d

Tree-SHA512: 97a66f858a7d4a3642bdef9016457833cfc1181e276f7ead7c6b87f6fcdcb7c5d1cfdb4b621225b806bc5949c3c5cc6a32b7df934157542d7c79aa00a9e20f41
2022-12-08 15:12:40 +00:00
..
address.rs network: Run cargo fmt 2022-11-18 13:11:09 +11:00
constants.rs Merge rust-bitcoin/rust-bitcoin#1428: Adds Network::from_core_arg and links it to Network::from_str 2022-12-08 15:12:40 +00:00
message.rs network: Run cargo fmt 2022-11-18 13:11:09 +11:00
message_blockdata.rs network: Run cargo fmt 2022-11-18 13:11:09 +11:00
message_bloom.rs network: Run cargo fmt 2022-11-18 13:11:09 +11:00
message_compact_blocks.rs network: Run cargo fmt 2022-11-18 13:11:09 +11:00
message_filter.rs Add a workspace to the top level directory. 2022-09-13 08:44:57 +10:00
message_network.rs network: Run cargo fmt 2022-11-18 13:11:09 +11:00
mod.rs network: Run cargo fmt 2022-11-18 13:11:09 +11:00