Merge rust-bitcoin/rust-bitcoin#1284: Import bitcoin hashes

9674bf29fe hashes: Fix clippy warnings (Tobin C. Harding)
b9643bf3e9 Import bitcoin_hashes crate into hashes (Tobin C. Harding)
580feab3f9 internals: Add CHANGELOG file (Tobin C. Harding)
bae64e156e Move CHANGELOG to bitcoin crate (Tobin C. Harding)
9a2c856be6 Update gitignore file (Tobin C. Harding)

Pull request description:

  #1337 was split out of this in an attempt to help review, I think we can merge this one though now it has some traction.

  We would like to bring the `bitcoin_hashes` crate into the `rust-bitcoin` repository. https://github.com/rust-bitcoin/rust-bitcoin/issues/550#issuecomment-1248071843

  Import `bitcoin_hashes` crate into `hashes`.

  Commit hash that was tip of `bitcoin_hashes` at time of import:

       commit 2a78c250f78d391599040223870a4d1d6f6f5482

  Please note the commit history of `bitcoin_hashes` is only preserved on the soon-to-be-archived `bitcoin_hashes` repository.

ACKs for top commit:
  sanket1729:
    ACK 9674bf29fe. Did my best to review the CI code, it looks good, and seems like we are testing everything when we add "hashes" to the root level `./contrib/tests.sh`. I would like other reviewers to confirm the same.
  apoelstra:
    ACK 9674bf29fe

Tree-SHA512: db3ce6adeb38430c5a9f372da16be9fb048c2e5cff646b701139fb4b5fa76e10261432284ede7fd139b75cd69bb124d55973ceb7eccaa996226a7be4cad9b68a
This commit is contained in:
Andrew Poelstra 2022-11-18 18:20:26 +00:00
commit 349a8a5b4e
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
501 changed files with 5981 additions and 17 deletions

View File

@ -29,7 +29,7 @@ jobs:
override: true override: true
profile: minimal profile: minimal
- name: fuzz - name: fuzz
run: cd fuzz && ./travis-fuzz.sh "${{ matrix.fuzz_target }}" run: cd bitcoin/fuzz && ./travis-fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}.rs" >executed_${{ matrix.fuzz_target }} - run: echo "${{ matrix.fuzz_target }}.rs" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
@ -46,5 +46,5 @@ jobs:
- name: Display structure of downloaded files - name: Display structure of downloaded files
run: ls -R run: ls -R
- run: find executed_* -type f -exec cat {} + | sort > executed - run: find executed_* -type f -exec cat {} + | sort > executed
- run: ls fuzz/fuzz_targets | sort > expected - run: ls bitcoin/fuzz/fuzz_targets | sort > expected
- run: diff expected executed - run: diff expected executed

View File

@ -16,6 +16,8 @@ jobs:
DO_LINT: true DO_LINT: true
AS_DEPENDENCY: true AS_DEPENDENCY: true
DO_NO_STD: true DO_NO_STD: true
DO_FEATURE_MATRIX: true # Currently only used in hashes crate.
DO_SCHEMARS_TESTS: true # Currently only used in hashes crate.
- rust: beta - rust: beta
env: env:
AS_DEPENDENCY: true AS_DEPENDENCY: true
@ -89,6 +91,9 @@ jobs:
Embedded: Embedded:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C link-arg=-Tlink.x"
CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel"
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -102,8 +107,44 @@ jobs:
override: true override: true
components: rust-src components: rust-src
target: thumbv7m-none-eabi target: thumbv7m-none-eabi
- name: Run - name: Run bitcoin/embedded
run: cd bitcoin/embedded && cargo run --target thumbv7m-none-eabi
- name: Run hashes/embedded no alloc
run: cd hashes/embedded && cargo run --target thumbv7m-none-eabi
- name: Run hashes/embedded with alloc
run: cd hashes/embedded && cargo run --target thumbv7m-none-eabi --features=alloc
ASAN:
name: Address sanitizer # hashes crate only.
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rust-src
- name: Running address sanitizer
env: env:
RUSTFLAGS: "-C link-arg=-Tlink.x" DO_ASAN: true
CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel" run: ./hashes/contrib/test.sh
run: cd embedded && cargo run --target thumbv7m-none-eabi
WASM:
name: WebAssembly Build # hashes crate only.
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v2
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Running WASM build
env:
DO_WASM: true
run: ./hashes/contrib/test.sh

27
.gitignore vendored
View File

@ -1,7 +1,22 @@
target # .gitignore for rust-bitcoin repository workspace.
Cargo.lock
dep_test
#fuzz # Lock files
fuzz/hfuzz_target Cargo.lock
fuzz/hfuzz_workspace internals/Cargo.lock
bitcoin/Cargo.lock
hashes/Cargo.lock
# Build artifacts
target
internals/target
bitcoin/target
hashes/target
# Test artifacts
bitcoin/dep_test
# Fuzz artifacts
bitcoin/fuzz/hfuzz_target
bitcoin/fuzz/hfuzz_workspace
hashes/fuzz/hfuzz_target
hashes/fuzz/hfuzz_workspace

View File

@ -1,3 +1,2 @@
[workspace] [workspace]
members = ["bitcoin", "internals"] members = ["bitcoin", "hashes", "internals"]
exclude = ["embedded", "fuzz"]

View File

@ -5,13 +5,17 @@ readme = "README.md"
name = "embedded" name = "embedded"
version = "0.1.0" version = "0.1.0"
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[dependencies] [dependencies]
cortex-m = "0.6.0" cortex-m = "0.6.0"
cortex-m-rt = "0.6.10" cortex-m-rt = "0.6.10"
cortex-m-semihosting = "0.3.3" cortex-m-semihosting = "0.3.3"
panic-halt = "0.2.0" panic-halt = "0.2.0"
alloc-cortex-m = "0.4.1" alloc-cortex-m = "0.4.1"
bitcoin = { path="../bitcoin", default-features = false, features = ["no-std", "secp-lowmemory"] } bitcoin = { path="../", default-features = false, features = ["no-std", "secp-lowmemory"] }
[[bin]] [[bin]]
name = "embedded" name = "embedded"

View File

@ -14,7 +14,7 @@ honggfuzz_fuzz = ["honggfuzz"]
[dependencies] [dependencies]
honggfuzz = { version = "0.5", optional = true, default-features = false } honggfuzz = { version = "0.5", optional = true, default-features = false }
afl = { version = "0.4", optional = true } afl = { version = "0.4", optional = true }
bitcoin = { path = "../bitcoin" } bitcoin = { path = "../" }
# Prevent this from interfering with workspaces # Prevent this from interfering with workspaces
[workspace] [workspace]

Some files were not shown because too many files have changed in this diff Show More