Commit Graph

12 Commits

Author SHA1 Message Date
Sergi Delgado Segura bd1eb29f61 Adds Network::to_core_arg
This allows users to create `Network` instances from `bitcoind -chain` values
2022-12-08 06:33:24 -05:00
connormullett 519db4d951 add Network::to_core_arg() method 2022-11-18 23:12:10 -05:00
Tobin C. Harding e04a7a926d network: Run cargo fmt
We just removed the `bitcoin/src/network/` exclude from `rustfmt` config
file. Run the command `cargo +nightly fmt`.

No other changes than those introduced by `rustfmt`.
2022-11-18 13:11:09 +11:00
Tobin C. Harding 5a8a5ff6c9 Move debug_from_display to bitcoin_internals
This is an internal macro, now that we have the `internals` crate put
`debug_from_display` in it.
2022-10-20 06:15:23 +11:00
Noah d1b7dff094 return custom error from `Network::from_str` 2022-10-10 19:37:14 +11:00
Noah bfb4977be9 implement `AsMut<[u8]>` and `AsMut<[u8;4]>` for `Magic` 2022-09-29 16:04:37 +10:00
Noah 6e5e8d80a6 add error implementations for `ParseMagicError` and `UnknownMagic` 2022-09-28 19:43:10 +10:00
Noah a79c69894a new type network magic 2022-09-28 10:32:47 +10:00
Tobin C. Harding f429c22599 Remove user_enum macro
The `user_enum` macro is only used a single time. The macro includes
custom serde logic which can be trivially derived instead.

Remove the `user_enum` macro and just implement `Network` the old
fashioned way. Doing so simplifies the code.
2022-09-20 16:53:38 +10:00
Tobin C. Harding ad29084582 Add Network serde roundtrip test
In preparation for patching the `Network` serde impls; add a roundtrip
test for `serde` (de)serializing  the `Network` type.
2022-09-20 15:29:55 +10:00
Tobin C. Harding 7a1aa2098a Remove code deprecated last release
We give one release cycle for deprecating old code so as to make the
upgrade path easier for downstream users.

Remove code deprecated during the last release (v0.29.0).
2022-09-16 08:08:53 +10:00
Tobin C. Harding 022730bd8d Add a workspace to the top level directory.
Create a directory `bitcoin` and move into it the following as is with
no code changes:

- src
- Cargo.toml
- contrib
- test_data
- examples

Then do:

- Add a workspace to the repository root directory.
- Add the newly created `bitcoin` crate to the workspace.
- Exclude `fuzz` and `embedded` crates from the workspace.
- Add a contrib/test.sh script that runs contrib/test.sh in each
  sub-crate
- Fix the bitcoin/contrib/test.sh script
2022-09-13 08:44:57 +10:00
Renamed from src/network/constants.rs (Browse further)