Commit Graph

5477 Commits

Author SHA1 Message Date
merge-script c46171899a
Merge rust-bitcoin/rust-bitcoin#3551: primitives: Add missing re-exports
2b7cb04265 primitives: Add missing re-exports (Tobin C. Harding)

Pull request description:

  Add re-exports of types from `taproot` and `merkle_tree`.

ACKs for top commit:
  jamillambert:
    ACK 2b7cb04265
  apoelstra:
    ACK 2b7cb04265cdb2d62c1bcc645e19d8bafa132b4b; successfully ran local tests

Tree-SHA512: e837c8e7bfda3e8c5510a15ba19b2b0b433e9e87c961ab9ab81d134288b70bc98364007e8e610e7066732e16f72ea990a782cade9ead6b71ddc9b843753fa0ee
2024-11-01 15:23:39 +00:00
merge-script 112d75eed9
Merge rust-bitcoin/rust-bitcoin#3517: Remove `private_key_debug_is_obfuscated` test
7bff725494 Remove private_key_debug_is_obfuscated test (Diogo Canut)

Pull request description:

  Solves #3186.

ACKs for top commit:
  tcharding:
    ACK 7bff725494
  apoelstra:
    ACK 7bff725494bed02bed7f5d2af8278c89aaf73f40; successfully ran local tests; sure

Tree-SHA512: 68dcdc476ada7960eb224dd456010bc36a302472b8a8b4d1ea3ab9c6981550d7677a98516331d5e5ef636be0cdc7208c45278d70c506e04d067b997758fd4bcf
2024-11-01 14:20:46 +00:00
merge-script 8eacfd0191
Merge rust-bitcoin/rust-bitcoin#3557: Remove needless_borrows_for_generic_args
6aa8c2b023 Remove needless_borrows_for_generic_args (Tobin C. Harding)

Pull request description:

  This has been fixed and we use nightly to lint so we have access to the merged fix.

ACKs for top commit:
  apoelstra:
    ACK 6aa8c2b023619534437043e76ec4252f27295875; successfully ran local tests

Tree-SHA512: 011677b6c1a2dc6c63097cafd1682fab5d9bdd94133b872bdd49699a55c80a01a8e6e5e844ae1cfe1ca9da47a2ba2ed6b910719b1ccbb06e60e22ecb01ec0efc
2024-11-01 13:37:27 +00:00
merge-script 5ec0e5299b
Merge rust-bitcoin/rust-bitcoin#3377: Release tracking PR: `bitcoin_hashes 0.15.0`
80b5d8b7b3 hashes: Add changelog for release 0.15.0 (Tobin C. Harding)

Pull request description:

  The version has already been bumped on `master`.

  In preparation for releasing `hashes v0.15.0` add a changelog entry.

ACKs for top commit:
  apoelstra:
    ACK 80b5d8b7b36ea97007f062971a732ec8a512cfa5; successfully ran local tests; again lots of stuff!

Tree-SHA512: ab1bbdf7df819c587dc905e4cdcda2232ede2a495a0e395e5d6f6bd730a7c3c0675e05f8ab616e5e6dee0a87836ab486d025f80608e73b713007391711ef15ba
2024-11-01 12:22:57 +00:00
Tobin C. Harding 3f2e760d1f
Replace String with InputString in ParseIntError
Currently the `ParseIntError` contains an owned copy of the input
string, this is causing us to have to use `alloc` everywhere.

We already have a alloc-friendly string replacement type, the
`InputString` - use it.
2024-11-01 17:31:22 +11:00
Tobin C. Harding aa5c78430c
Replace invalidInteger with ParseIntError
We have a special type for wrapping integer parsing errors, use it.

To test this I added the following tests:

    #[test]
    pub fn debug_absolute_error_conversion_height() {
        let invalid_height = LOCK_TIME_THRESHOLD + 1;
        let _ = Height::from_consensus(invalid_height).unwrap();
    }

    #[test]
    pub fn debug_absolute_error_conversion_time() {
        let invalid_time =  LOCK_TIME_THRESHOLD - 1;
        let _ = Time::from_consensus(invalid_time).unwrap();
    }

    #[test]
    #[cfg(feature = "std")]
    pub fn debug_absolute_error_conversion_height_string() {
        let invalid_height = std::format!("{:x}", LOCK_TIME_THRESHOLD + 1);
        let _ = Height::from_hex(&invalid_height).unwrap();
    }

    #[test]
    #[cfg(feature = "std")]
    pub fn debug_absolute_error_conversion_time_string() {
        let invalid_time = std::format!("{:x}", LOCK_TIME_THRESHOLD - 1);
        let _ = Time::from_hex(&invalid_time).unwrap();
    }

    #[test]
    #[cfg(feature = "std")]
    pub fn debug_absolute_error_height_invalid_hex_string() {
        let _ = Height::from_hex("somerandomshit").unwrap();
    }

    #[test]
    #[cfg(feature = "std")]
    pub fn debug_absolute_error_time_invalid_hex_string() {
        let _ = Time::from_hex("somerandomshit").unwrap();
    }

Which resulted in the following output

Before:

---- locktime::absolute::tests::debug_absolute_error_conversion_height stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_conversion_height' panicked at units/src/locktime/absolute.rs:431:56:
called `Result::unwrap()` on an `Err` value: ConversionError { unit: Blocks, input: 500000001 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- locktime::absolute::tests::debug_absolute_error_conversion_height_string stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_conversion_height_string' panicked at units/src/locktime/absolute.rs:444:51:
called `Result::unwrap()` on an `Err` value: ParseHeightError(Conversion(500000001))

---- locktime::absolute::tests::debug_absolute_error_conversion_time stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_conversion_time' panicked at units/src/locktime/absolute.rs:437:52:
called `Result::unwrap()` on an `Err` value: ConversionError { unit: Seconds, input: 499999999 }

---- locktime::absolute::tests::debug_absolute_error_height_invalid_hex_string stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_height_invalid_hex_string' panicked at units/src/locktime/absolute.rs:457:52:
called `Result::unwrap()` on an `Err` value: ParseHeightError(InvalidInteger { source: ParseIntError { kind: InvalidDigit }, input: "somerandomshit" })

---- locktime::absolute::tests::debug_absolute_error_conversion_time_string stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_conversion_time_string' panicked at units/src/locktime/absolute.rs:451:47:
called `Result::unwrap()` on an `Err` value: ParseTimeError(Conversion(499999999))

---- locktime::absolute::tests::debug_absolute_error_time_invalid_hex_string stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_time_invalid_hex_string' panicked at units/src/locktime/absolute.rs:464:50:
called `Result::unwrap()` on an `Err` value: ParseTimeError(InvalidInteger { source: ParseIntError { kind: InvalidDigit }, input: "somerandomshit" })

After:

---- locktime::absolute::tests::debug_absolute_error_conversion_height stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_conversion_height' panicked at units/src/locktime/absolute.rs:432:56:
called `Result::unwrap()` on an `Err` value: ConversionError { unit: Blocks, input: 500000001 }

---- locktime::absolute::tests::debug_absolute_error_conversion_height_string stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_conversion_height_string' panicked at units/src/locktime/absolute.rs:445:51:
called `Result::unwrap()` on an `Err` value: ParseHeightError(Conversion(500000001))

---- locktime::absolute::tests::debug_absolute_error_conversion_time stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_conversion_time' panicked at units/src/locktime/absolute.rs:438:52:
called `Result::unwrap()` on an `Err` value: ConversionError { unit: Seconds, input: 499999999 }

---- locktime::absolute::tests::debug_absolute_error_conversion_time_string stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_conversion_time_string' panicked at units/src/locktime/absolute.rs:452:47:
called `Result::unwrap()` on an `Err` value: ParseTimeError(Conversion(499999999))

---- locktime::absolute::tests::debug_absolute_error_height_invalid_hex_string stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_height_invalid_hex_string' panicked at units/src/locktime/absolute.rs:458:52:
called `Result::unwrap()` on an `Err` value: ParseHeightError(ParseInt(ParseIntError { input: "somerandomshit", bits: 32, is_signed: false, source: ParseIntError { kind: InvalidDigit } }))

---- locktime::absolute::tests::debug_absolute_error_time_invalid_hex_string stdout ----
thread 'locktime::absolute::tests::debug_absolute_error_time_invalid_hex_string' panicked at units/src/locktime/absolute.rs:465:50:
called `Result::unwrap()` on an `Err` value: ParseTimeError(ParseInt(ParseIntError { input: "somerandomshit", bits: 32, is_signed: false, source: ParseIntError { kind: InvalidDigit } }))
2024-11-01 17:31:22 +11:00
Tobin C. Harding 9b7a706bfd
Remove From<ParseIntError>
The errors in `units::locktime::absolute` are complex, I'd like to make
them more simple so they are more understandable.

I have no clue why this is implemented - remove it.
2024-11-01 17:31:22 +11:00
Tobin C. Harding c90f4b6033
Fix bug in error output
`ParseTimeError` should say "block time" not "block height". This looks
like a cut'n pasta error because the `ParseHeightError` uses the same
string.
2024-11-01 17:31:21 +11:00
Tobin C. Harding c986b2f620
internals: Move error.rs to error/mod.rs
We use the `foo/mod.rs` style in this repo; `error.rs` is an anomaly,
move it to `error/mod.rs`.
2024-11-01 16:10:16 +11:00
Tobin C. Harding 6aa8c2b023
Remove needless_borrows_for_generic_args
This has been fixed and we use nightly to lint so we have access to the
merged fix.

Removing the attribute uncovers a bunch of real lint warnings, fix
them while we are at it.
2024-11-01 14:30:45 +11:00
merge-script 4c8347a7ac
Merge rust-bitcoin/rust-bitcoin#3544: Favour `to_vec` over `to_bytes`
a51768af3f key: Deprecate to_bytes (Tobin C. Harding)
3af3239ad0 script: Re-order functions (Tobin C. Harding)
db40297f87 script: deprecate to_bytes (Tobin C. Harding)
c5cd0db493 Revert the change to to_bytes (Tobin C. Harding)
dc2ca785d2 Add to_vec and deprecate to_bytes for array types (Tobin C. Harding)
a6b7ab32a8 Move impl_array_newtype to internal_macros (Tobin C. Harding)

Pull request description:

  Use `to_vec` and deprecate `to_bytes`, the opposite of what we did in #2585.

  For functions that return a `Vec` by first allocating use function name `to_vec`. This explicitly excludes:

  - Functions that return an array (`CompressedPublicKey::to_bytes`)
  - Functions that consume self and return a `Vec` without allocating (`ScriptBuf::into_bytes`)

  See #3025 for discussion and consensus.

  Close: #3025

ACKs for top commit:
  apoelstra:
    ACK a51768af3f3d4c8e138e1ded250800810bedc903; successfully ran local tests

Tree-SHA512: ee932c13ad2e09c2b76a7833b23c859df175aa307f56e673921f3ae8b5d865518c6f999749e3b627594457b3ca33301b777177ada3520cf006acc0f14e5dacf8
2024-11-01 00:55:15 +00:00
merge-script 8bc2f39fca
Merge rust-bitcoin/rust-bitcoin#3547: Remove more wildcard re-exports
0bf1910980 Remove wildcard from script self re-exports (Tobin C. Harding)
397a4b9382 Remove wildcard in push_bytes module (Tobin C. Harding)

Pull request description:

  We thought #3436 was done (well I thought it was), turns out I was wrong.

ACKs for top commit:
  jamillambert:
    ACK 0bf1910980
  apoelstra:
    ACK 0bf1910980a13005496244ec4d4adf0553afbc73; successfully ran local tests

Tree-SHA512: 131a4aa4a907099790d14cfc2d19305943a2270cf6852c7dd92e35ea69188c9a40797fb22fd2ed8b2fefc2d6380b884401b5e32f521711f0f7b2da610d0e332f
2024-10-31 23:51:50 +00:00
Diogo Canut 7bff725494 Remove private_key_debug_is_obfuscated test
The private_key_debug_is_obfuscated test is removed because it belongs
in the secp256k1 library, not in the bitcoin library. Keeping it here
is redundant and creates unnecessary maintenance.
2024-10-31 20:31:59 -03:00
merge-script dbb35c0960
Merge rust-bitcoin/rust-bitcoin#3545: Add no_std flag to the chacha20-poly1305 crate
26ed97877b Add no_std flag to the chacha20-poly1205 crate (Nick Johnson)

Pull request description:

  I unfortunately forgot to copy over the `no_std` configuration when I promoted the chacha20_poly1305 from an internal module (where it inherited the setting) to the main module of the new crate.

  This crate is using a slightly simpler no_std pattern than some other crates in the org. I like the simple approach, but can update it if consistency is valued in this case.

ACKs for top commit:
  tcharding:
    ACK 26ed97877b
  apoelstra:
    ACK 26ed97877bdbee0b9b67db52ff0d53b706361e08; successfully ran local tests

Tree-SHA512: ffa672b7593daa4148ef8584903939e976302138b0aae1f09de647885629e502bcb1380471b29d8cd28ae52a435e52bd22b231c6631528d17fe3090e7f56add7
2024-10-31 22:09:34 +00:00
merge-script 8af8bc7886
Merge rust-bitcoin/rust-bitcoin#3543: Bump hex-conservative to 0.3.0
7f289a9fdf Bump hex-conservative to 0.3.0 (Leo Nash)

Pull request description:

ACKs for top commit:
  tcharding:
    ACK 7f289a9fdf
  apoelstra:
    ACK 7f289a9fdf86604cc1ecfb31c6df0ea5bb175465; successfully ran local tests

Tree-SHA512: bf8543ef7dc9b7ec0d11659c0a53213be50b9bbae0e6ba6970a19d32b3d89025315fcae332c23d68582ef69ea5f8e6673192ff74316a1e3dc47521312bbc469e
2024-10-31 21:05:02 +00:00
Tobin C. Harding 2b7cb04265
primitives: Add missing re-exports
Add re-exports of types from `taproot` and `merkle_tree`.
2024-11-01 07:31:07 +11:00
Tobin C. Harding a51768af3f
key: Deprecate to_bytes
As we have been doing in other places deprecate `to_bytes` in favour of
`to_vec`. Note this is only for functions that return a `Vec`, the `key`
module has `CompressedKey::to_bytes` still as it returns an array.
2024-11-01 07:10:41 +11:00
Tobin C. Harding 3af3239ad0
script: Re-order functions
We want our code to be easy to read and our APIs discoverable, for those
of us who read source files the layout matters.

Put the constructors and getters at the top of the impl block.

Code move only, no logic changes.
2024-11-01 07:09:59 +11:00
Tobin C. Harding db40297f87
script: deprecate to_bytes
Deprecate the `Script::to_bytes` function in favour of `to_vec` as we
are doing elsewhere.

Note that `ScriptBuf` has `into_bytes` because it does not copy.
Potentially this should be deprecated in favour of `into_vec`?

Note that in regards to the `to_` prefix this naming as valid according
to convention because the `Script` type is borrowed and `to_vec` copies
the underlying bytes.
2024-11-01 07:09:53 +11:00
Tobin C. Harding c5cd0db493
Revert the change to to_bytes
During this release cycle we deprecated `to_vec` in favour of
`to_bytes`, we have since reversed our position on the name.

Remove the deprecation of `to_bytes` from the three types that had it
and use `to_vec`.
2024-11-01 07:09:11 +11:00
Tobin C. Harding dc2ca785d2
Add to_vec and deprecate to_bytes for array types
For the array wrapper types (eg `ShortId`) created with the
`impl_array_newtype` macro deprecated the `to_bytes` function and add a
`to_vec` function.

Discussed and decided upon in issue: #3025
2024-11-01 07:08:49 +11:00
merge-script d32bb20e6b
Merge rust-bitcoin/rust-bitcoin#3537: Fix macro feature gate
bafe11d7e4 Correctly feature gate impl_to_hex_from_lower_hex (Tobin C. Harding)
57769f5f28 Fix ugly rustfmt (Tobin C. Harding)

Pull request description:

  Fix macro feature gating.

  - Patch 1 is preparatory fixes to bot introduced formatting changes
  - Patch 2 is the macro fix

  Close: #3152

ACKs for top commit:
  apoelstra:
    ACK bafe11d7e492b12abaac305bda182cd6f820c558; successfully ran local tests

Tree-SHA512: 98709f362ad28c91d6e374ac5e6a8bed54de6b25df841b479732bccaf70d6bbf23be89522fd58cafca62dcf0cff9dbfdc35ff9a12225bb63beb79c55992378f4
2024-10-31 19:57:09 +00:00
merge-script fe8c6455a4
Merge rust-bitcoin/rust-bitcoin#3533: base58: Close all errors
c92290278e base58: Close all errors (Tobin C. Harding)

Pull request description:

  Currently we have a bunch of public errors in the `base58` crate. Only two are returned by public functions `decode()` and `decode_check()` (`Error` and `InvalidCharacterError` respectively).

  - Close the two public errors by adding private inner errors.
  - Add getters on the public errors to get the error data.
  - Make all other errors private.
  - Call `impl_from_infallible` for _all_ error types.

  Done as part of #3261

ACKs for top commit:
  apoelstra:
    ACK c92290278eaa4b4f062928c6bc6c2984e1ab7ba6; successfully ran local tests

Tree-SHA512: e2ecef89691b41dfcc8ea3ef02c3719c45c72dbb252c76eadd97d03e32518ac7e00a2623d753de947d607ac3edf785f1ffdef8178a4f17ac3e7fd26ee01031ab
2024-10-31 18:25:36 +00:00
merge-script b7fc091661
Merge rust-bitcoin/rust-bitcoin#3541: Re-organise the `amount` module
10ff979fbd amount: Move arbitrary impl (Tobin C. Harding)
d4d9311603 amount: Move SignedAmount to private signed module (Tobin C. Harding)
0fc0e8760b docs: Remove link from self (Tobin C. Harding)
13f9fd1b77 amount: Move Amount to private unsigned module (Tobin C. Harding)
2d4c0fa6c1 amount: Format serde file (Tobin C. Harding)
df96267342 amount: Move serde code to submodule (Tobin C. Harding)
87c9a3fd11 amount: Format tests file (Tobin C. Harding)
e0bc68042d amount: Move test code to submodule (Tobin C. Harding)
7e1269704d tests: Use from_sat (Tobin C. Harding)
cd5d1aba2f amount: Format verification file (Tobin C. Harding)
01f907b7a6 amount: Move verification code to submodule (Tobin C. Harding)
5ce827c5e0 amount: Move error code to submodule (Tobin C. Harding)
abc54d0343 Make amount module a directory (Tobin C. Harding)
851e4111ec Run the formatter (Tobin C. Harding)

Pull request description:

  This is the first 14 patches from #3539 in case that on is too ambitious. If that one gets NACK'ed then this can close too.

  I really really don't want to rebase this so I"m putting it up in case any of the last 5 patches from #3539 are contentious. if #3539 can go in as is then we can close this one.

ACKs for top commit:
  apoelstra:
    ACK 10ff979fbd76232ab28127600b7515bcf86467b9; successfully ran local tests; nice! All straightforward moves etc. Will one-ACK merge

Tree-SHA512: 8ebfac309969da52b78de37d9c55264332884c3a3966cae3f6ca5e154834aeb205d4e483dee8f934e72f67ec7cb84239232d052ac5c314c553feccf3a2380057
2024-10-31 16:16:30 +00:00
merge-script 5f3af4bab2
Merge rust-bitcoin/rust-bitcoin#3536: Use `doc(notable_trait)`
dfb76c1e15 Use doc(notable_trait) (Tobin C. Harding)

Pull request description:

  There is an unstable feature that puts up a little 'i' in a circle next to any function that returns a type that implements an notable trait. For us this means we can make the extension traits more discoverable.

  ref: https://doc.rust-lang.org/unstable-book/language-features/doc-notable-trait.html

  Close: #3232

ACKs for top commit:
  apoelstra:
    ACK dfb76c1e15933fe0058c1bb69c4b1b9acddceee8; successfully ran local tests

Tree-SHA512: 0fbc7a2a3c8c499a9276d1e86b9966a7ae6bd8a354aff5fd40aa11d07945db589b2a9c2cdfa43ddadfafcee706ae7f68cedc269f74622643307cc43cd07d554f
2024-10-31 15:01:19 +00:00
Tobin C. Harding 80b5d8b7b3
hashes: Add changelog for release 0.15.0
The version has already been bumped on `master`.

In preparation for releasing `hashes v0.15.0` add a changelog entry.
2024-10-31 17:14:26 +11:00
Tobin C. Harding 0bf1910980
Remove wildcard from script self re-exports
In the `script` module remove the wildcards and re-export stuff from
`self` explicitly in both `primitives` and `bitcoin`.

Internal change only, everything is re-exported.
2024-10-31 15:52:54 +11:00
Tobin C. Harding 397a4b9382
Remove wildcard in push_bytes module
Remove the wildcard even though it is only re-exporting things from
module code within the file.
2024-10-31 15:51:29 +11:00
Nick Johnson 26ed97877b Add no_std flag to the chacha20-poly1205 crate 2024-10-30 20:48:21 -07:00
Leo Nash 7f289a9fdf Bump hex-conservative to 0.3.0 2024-10-31 03:36:22 +00:00
Tobin C. Harding a6b7ab32a8
Move impl_array_newtype to internal_macros
The current feature gating is wrong, this bug is unreleased because it
was introduced #2585.

The `impl_array_newtype` macro is only used in the `bitcoin` crate, it
does not need to be in `internals`. Also, other crates have an `alloc`
feature which `bitcoin` does not have so if we ever need it in other
places we'll need a duplicate with the correct feature gating anyways.

Move the macro to `bitcoin::internal_macros` and remove the incorrect
`alloc` feature gating.
2024-10-31 14:15:41 +11:00
Tobin C. Harding c92290278e
base58: Close all errors
Currently we have a bunch of public errors in the `base58` crate. Only
two are returned by public functions `decode()` and
`decode_check()` (`Error` and `InvalidCharacterError` respectively).

- Close the two public errors by adding private inner errors.
- Add getters on the public errors to get the error data.
- Make all other errors private.
- Call `impl_from_infallible` for _all_ error types.

Done as part of #3261
2024-10-31 13:59:57 +11:00
Tobin C. Harding bafe11d7e4
Correctly feature gate impl_to_hex_from_lower_hex
Currently we feature gate code within the `impl_to_hex_from_lower_hex`
 macro on "alloc" but `bitcoin` does not have the "alloc" feature so
 this code is never built in. This can be seen by the lack of a
 `to_hex` function on `LeafVersion`.

Remove the feature gate from the macro and put it on the individual
call sites as needed.
2024-10-31 13:43:47 +11:00
Tobin C. Harding 57769f5f28
Fix ugly rustfmt
Fix some ugly formatting introduced by the fmt bot recently.

Whitespace only, no logic changes.
2024-10-31 13:38:27 +11:00
Tobin C. Harding dfb76c1e15
Use doc(notable_trait)
There is an unstable feature that puts up a little 'i' in a circle
next to any function that returns a type that implements an notable
trait. For us this means we can make the extension traits more
discoverable.

ref: https://doc.rust-lang.org/unstable-book/language-features/doc-notable-trait.html

Close: #3232
2024-10-31 13:33:28 +11:00
merge-script 3c16ed05c9
Merge rust-bitcoin/rust-bitcoin#3540: Automated daily update to rustc (to nightly-2024-10-30)
c80d0bfcc8 Automated update to Github CI to rustc nightly-2024-10-30 (Update Nightly Rustc Bot)

Pull request description:

  Automated update to Github CI workflow `rust.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  tcharding:
    ACK c80d0bfcc8

Tree-SHA512: 26ee5fd03019452f0f1be637faf0f5c9129e87d375aea046de82bb3b0a56ea6e8690a08b9d3cb0b9a81c59acb89c163d15825406794d8cfa062f22939f029b11
2024-10-31 13:28:07 +11:00
Tobin C. Harding 10ff979fbd
amount: Move arbitrary impl
In an effort to make the `unsigned` and `signed` files be diff'able move
the `arbitrary` code to be in the same place.

Code move only.
2024-10-31 12:57:08 +11:00
Tobin C. Harding d4d9311603
amount: Move SignedAmount to private signed module
In an effort to make the `amount` module more readable move the
`SignedAmount` type to a private submodule.

Re-export everything so this is not a breaking change.

Code move and re-exports only.
2024-10-31 12:57:08 +11:00
Tobin C. Harding 0fc0e8760b
docs: Remove link from self
When we move `SignedAmount` to a submodule linking to `self` introduces
a clippy warning, I'm not exactly sure why but lets remove the link in
preparation for the move.
2024-10-31 12:57:03 +11:00
Tobin C. Harding 13f9fd1b77
amount: Move Amount to private unsigned module
In an effort to make the `amount` module more readable move the `Amount`
type to a private submodule.

Re-export everything so this is not a breaking change.

Code move and re-exports only.
2024-10-31 12:56:40 +11:00
Update Nightly Rustc Bot c80d0bfcc8 Automated update to Github CI to rustc nightly-2024-10-30 2024-10-31 01:50:06 +00:00
Tobin C. Harding 2d4c0fa6c1
amount: Format serde file
Done as a separate patch so that the diff of the verification code move
was less noisy.
2024-10-31 12:29:21 +11:00
Tobin C. Harding df96267342
amount: Move serde code to submodule
No changes other than moving the module code.
2024-10-31 12:29:21 +11:00
Tobin C. Harding 87c9a3fd11
amount: Format tests file
Done as a separate patch so that the diff of the verification code move
was less noisy.
2024-10-31 12:29:21 +11:00
Tobin C. Harding e0bc68042d
amount: Move test code to submodule
In preparation for splitting the two amounts into separate files; move
the `amount` module code to a submodule.

Internal change only.
2024-10-31 12:29:20 +11:00
Tobin C. Harding 7e1269704d
tests: Use from_sat
Stop using private constructor in unit tests, use `from_sat` instead.
2024-10-31 12:29:20 +11:00
Tobin C. Harding cd5d1aba2f
amount: Format verification file
Done as a separate patch so that the diff of the verification code move
was less noisy.
2024-10-31 12:29:20 +11:00
Tobin C. Harding 01f907b7a6
amount: Move verification code to submodule
Code move only, no other changes.
2024-10-31 12:29:20 +11:00
Tobin C. Harding 5ce827c5e0
amount: Move error code to submodule
There is _a lot_ of error types in the `amount` module. Move them to a
separate `error` module.

Add a bunch of `pub(super)` to keep things private to the `amount`
module.

Eventually we will want to close all these errors.
2024-10-31 12:29:16 +11:00
merge-script 05d9ccb261
Merge rust-bitcoin/rust-bitcoin#3525: Release tracking PR: `chacha20-poly1305` v0.1.0
7d6ed16dfc Add changelog to chacha20-poly1305 crate (Nick Johnson)

Pull request description:

  The initial release for the `chacha20-poly1305` crate. No other preparation needed for release since the version, `v0.1.0`, is already set in Cargo.toml.

ACKs for top commit:
  tcharding:
    ACK 7d6ed16dfc
  storopoli:
    ACK 7d6ed16dfc
  apoelstra:
    ACK 7d6ed16dfc9e8549bcf3d73af9aae7cd13904643; successfully ran local tests

Tree-SHA512: b9b42f59f7515e1cce63601ecaf33ba11eb594ec359e436babb1e7bed299f2244cae5e4760af9534f47023d5491d718f2cbd4808a6a15deab2aaf671305b817f
2024-10-30 23:00:03 +00:00