Repository: LNP-BP/client_side_validation (language: rust)

Issue:
StrictEncoding issue with enum tuple struct field initialization
When fixing some clippy lints on the descriptor wallet, I ran into an issue here:

![Screenshot from 2022-02-09 12-30-55](https://user-images.githubusercontent.com/285690/153277402-0ccd25d7-ec99-43f5-baa7-7522ec966fb0.png)

Docs on the linter rule are here:
https://rust-lang.github.io/rust-clippy/master/index.html#init_numbered_fields

Normally I wouldn't file a feature request just to satisfy a linter, but this might be indicative of some sort of oversight. Feel free to close if we're comfortable with using `#![allow(clippy::init_numbered_fields)]` in all projects using strict encoding.



Discussion / hints:
Hm, not sure I understand what specifically linter does not like here and how it can be fixed. Any ideas?
sorry for closing, pressed the wrong button
It looks like this is a problem that might be fixed once 1.59 is released:
https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#new-lints

I noticed it goes away if the nightly toolchain is used.
1.59 got released. Can we close this issue?
No, it's just that the lint is in stable now. The issue persists. Sorry for confusing the matter, I misspoke earlier.

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f27594c8..84adf8b8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -23,6 +23,7 @@ jobs:
         uses: actions-rs/cargo@v1
         with:
           command: check
+          args: --workspace
   features:
     runs-on: ubuntu-latest
     strategy:
@@ -59,12 +60,9 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os: [ ubuntu-20.04, ubuntu-latest, macos-11.0, windows-latest ]
+        os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ]
     steps:
       - uses: actions/checkout@v2
-      - name: Install macos dependencies
-        if: startsWith(matrix.os, 'macos')
-        run: brew install pkg-config
       - name: Install rust stable
         uses: actions-rs/toolchain@v1
         with:
@@ -74,13 +72,13 @@ jobs:
         uses: actions-rs/cargo@v1
         with:
           command: check
-          args: --all-features
+          args: --workspace --all-targets --all-features
   toolchains:
     runs-on: ubuntu-latest
     strategy:
       fail-fast: false
       matrix:
-        toolchain: [ nightly, beta, stable, 1.56.0 ]
+        toolchain: [ nightly, beta, stable, 1.59.0 ]
     steps:
       - uses: actions/checkout@v2
       - name: Install rust ${{ matrix.toolchain }}
diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml
index 390a6e9c..9fd96f0e 100644
--- a/.github/workflows/codecov.yml
+++ b/.github/workflows/codecov.yml
@@ -30,7 +30,15 @@ jobs:
           RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
       - id: coverage
         name: Generate coverage
-        uses: actions-rs/grcov@v0.1.5
+        uses: actions-rs/grcov@0.2-proto
+        with:
+          args: >
+            -t lcov
+            --llvm
+            --ignore-not-existing
+            --ignore "/*"
+            -o ./target/lcov.info
+            ./target/debug/
       - name: Upload coverage to Codecov
         uses: codecov/codecov-action@v1
         with:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 9f1ed18e..b8979f05 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -39,15 +39,15 @@ jobs:
         name: Clippy
         with:
           command: clippy
-          args: --workspace --all-features
+          args: --workspace --all-features --all-targets
   doc:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
-      - name: Install rustc stable
+      - name: Install rustc nightly
         uses: actions-rs/toolchain@v1
         with:
-          toolchain: stable
+          toolchain: nightly
           override: true
           components: rust-docs
       - uses: actions-rs/cargo@v1
diff --git a/Cargo.lock b/Cargo.lock
index c5c3c6dc..87cf2ea7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -13,9 +13,9 @@ dependencies = [
 
 [[package]]
 name = "amplify"
-version = "3.12.0"
+version = "3.12.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47cfa6a69eeb140125a63e4f5ae1156a530f8744ea1d35aa1b8b5613e4d8b41d"
+checksum = "e45c604e86700ffea68a7d90c3ffb1508dad1120902f31dbb08afc942cf8acf3"
 dependencies = [
  "amplify_apfloat",
  "amplify_derive",
@@ -72,9 +72,9 @@ dependencies = [
 
 [[package]]
 name = "anyhow"
-version = "1.0.57"
+version = "1.0.58"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc"
+checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704"
 
 [[package]]
 name = "arrayvec"
@@ -103,15 +103,6 @@ version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
 
-[[package]]
-name = "base64-compat"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a8d4d2746f89841e49230dd26917df1876050f95abafafbe34f47cb534b88d7"
-dependencies = [
- "byteorder",
-]
-
 [[package]]
 name = "bech32"
 version = "0.8.1"
@@ -124,7 +115,6 @@ version = "0.28.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "05bba324e6baf655b882df672453dbbc527bc938cadd27750ae510aaccc3a66a"
 dependencies = [
- "base64-compat",
  "bech32",
  "bitcoin_hashes",
  "secp256k1",
@@ -139,48 +129,6 @@ dependencies = [
  "serde",
 ]
 
-[[package]]
-name = "bitcoin_hd"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d080f88bdc1827e569d305765bc407a7cc9b5d464d25e1d36fe2294f274507f"
-dependencies = [
- "amplify",
- "bitcoin",
- "miniscript",
- "slip132",
- "strict_encoding 1.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "bitcoin_onchain"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e9453484e54cffe3f9f0075b0ee862950621185475aecae8b2eef97ad4ff9d2"
-dependencies = [
- "amplify",
- "bitcoin",
- "bitcoin_hd",
- "chrono",
- "descriptors",
- "miniscript",
- "strict_encoding 1.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "bitcoin_scripts"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcfdf7d9a0b3af94a35b92daa2e3f1c5b02b7293b5938a4cd4cc426852e52249"
-dependencies = [
- "amplify",
- "bitcoin",
- "miniscript",
- "secp256k1",
- "stability",
- "strict_encoding 1.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "bitflags"
 version = "1.3.2"
@@ -234,7 +182,7 @@ dependencies = [
  "async-trait",
  "commit_verify",
  "single_use_seals",
- "strict_encoding 1.8.11",
+ "strict_encoding",
 ]
 
 [[package]]
@@ -253,11 +201,10 @@ dependencies = [
  "amplify",
  "bitcoin_hashes",
  "grin_secp256k1zkp",
- "psbt",
  "rand 0.8.5",
  "serde",
  "serde_with",
- "strict_encoding 1.8.11",
+ "strict_encoding",
 ]
 
 [[package]]
@@ -339,26 +286,11 @@ dependencies = [
  "syn",
 ]
 
-[[package]]
-name = "descriptors"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36afa2baa98f5205560c4e194c0f943546682b943bc96adbec54ed7e1bbf5cab"
-dependencies = [
- "amplify",
- "bitcoin",
- "bitcoin_hd",
- "bitcoin_scripts",
- "chrono",
- "miniscript",
- "strict_encoding 1.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "diff"
-version = "0.1.12"
+version = "0.1.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499"
+checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
 
 [[package]]
 name = "digest"
@@ -423,18 +355,6 @@ dependencies = [
  "syn",
 ]
 
-[[package]]
-name = "encoding_derive_helpers"
-version = "1.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc4ba8a88067b85c8714922db6e5f2af47b894d63b771dbb0c4d31d6607e9057"
-dependencies = [
- "amplify",
- "proc-macro2",
- "quote",
- "syn",
-]
-
 [[package]]
 name = "filetime"
 version = "0.2.16"
@@ -491,13 +411,13 @@ dependencies = [
 
 [[package]]
 name = "getrandom"
-version = "0.2.6"
+version = "0.2.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad"
+checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
 dependencies = [
  "cfg-if",
  "libc",
- "wasi 0.10.2+wasi-snapshot-preview1",
+ "wasi 0.11.0+wasi-snapshot-preview1",
 ]
 
 [[package]]
@@ -524,9 +444,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"
 
 [[package]]
 name = "hashbrown"
-version = "0.11.2"
+version = "0.12.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
+checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3"
 
 [[package]]
 name = "hermit-abi"
@@ -545,9 +465,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
 
 [[package]]
 name = "indexmap"
-version = "1.8.2"
+version = "1.9.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a"
+checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
 dependencies = [
  "autocfg",
  "hashbrown",
@@ -573,9 +493,9 @@ checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
 
 [[package]]
 name = "linked-hash-map"
-version = "0.5.4"
+version = "0.5.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
+checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
 
 [[package]]
 name = "log"
@@ -671,34 +591,18 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.39"
+version = "1.0.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f"
+checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
 dependencies = [
  "unicode-ident",
 ]
 
-[[package]]
-name = "psbt"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eebee19795c9b0e04dc3c34f77173b3715e21ae57cd9ec22bf17a08a90ffe004"
-dependencies = [
- "amplify",
- "bitcoin",
- "bitcoin_hd",
- "bitcoin_onchain",
- "bitcoin_scripts",
- "descriptors",
- "miniscript",
- "strict_encoding 1.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "quote"
-version = "1.0.18"
+version = "1.0.20"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
+checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
 dependencies = [
  "proc-macro2",
 ]
@@ -790,7 +694,7 @@ version = "0.6.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
 dependencies = [
- "getrandom 0.2.6",
+ "getrandom 0.2.7",
 ]
 
 [[package]]
@@ -817,7 +721,7 @@ version = "0.4.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
 dependencies = [
- "getrandom 0.2.6",
+ "getrandom 0.2.7",
  "redox_syscall",
  "thiserror",
 ]
@@ -859,9 +763,9 @@ dependencies = [
 
 [[package]]
 name = "rustversion"
-version = "1.0.6"
+version = "1.0.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
+checksum = "a0a5f7c728f5d284929a1cccb5bc19884422bfe6ef4d6c409da2c41838983fcf"
 
 [[package]]
 name = "ryu"
@@ -909,9 +813,9 @@ dependencies = [
 
 [[package]]
 name = "serde_json"
-version = "1.0.81"
+version = "1.0.82"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c"
+checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7"
 dependencies = [
  "itoa",
  "ryu",
@@ -989,26 +893,6 @@ dependencies = [
  "async-trait",
 ]
 
-[[package]]
-name = "slip132"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "086f81f7be78373eb07e9879fa77e49d52416bde18778f675698c5c7da6b296c"
-dependencies = [
- "amplify",
- "bitcoin",
-]
-
-[[package]]
-name = "stability"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce"
-dependencies = [
- "quote",
- "syn",
-]
-
 [[package]]
 name = "strict_encoding"
 version = "0.8.0"
@@ -1023,24 +907,10 @@ dependencies = [
  "miniscript",
  "rand 0.7.3",
  "serde",
- "strict_encoding_derive 1.7.6",
+ "strict_encoding_derive",
  "strict_encoding_test",
 ]
 
-[[package]]
-name = "strict_encoding"
-version = "1.8.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acd582d614348ea8ff707ab58b145e8cb504a929219f3efc2492bed62d27c4bb"
-dependencies = [
- "amplify",
- "bitcoin",
- "bitcoin_hashes",
- "chrono",
- "miniscript",
- "strict_encoding_derive 1.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "strict_encoding_derive"
 version = "0.8.0"
@@ -1048,31 +918,19 @@ dependencies = [
  "amplify",
  "amplify_syn",
  "compiletest_rs",
- "encoding_derive_helpers 1.7.6",
+ "encoding_derive_helpers",
  "proc-macro2",
- "strict_encoding 1.8.11",
+ "strict_encoding",
  "strict_encoding_test",
  "syn",
 ]
 
-[[package]]
-name = "strict_encoding_derive"
-version = "1.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3bc7b868cb00c8861784b7f463c984c4b2ad20d1f23cec5997ad9cb41e559239"
-dependencies = [
- "amplify_syn",
- "encoding_derive_helpers 1.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "proc-macro2",
- "syn",
-]
-
 [[package]]
 name = "strict_encoding_test"
 version = "0.8.0"
 dependencies = [
  "amplify",
- "strict_encoding 1.8.11",
+ "strict_encoding",
 ]
 
 [[package]]
@@ -1099,9 +957,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
 
 [[package]]
 name = "syn"
-version = "1.0.96"
+version = "1.0.98"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf"
+checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1166,11 +1024,12 @@ dependencies = [
 
 [[package]]
 name = "time"
-version = "0.1.43"
+version = "0.1.44"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
+checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
 dependencies = [
  "libc",
+ "wasi 0.10.0+wasi-snapshot-preview1",
  "winapi",
 ]
 
@@ -1191,9 +1050,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
 
 [[package]]
 name = "unicode-ident"
-version = "1.0.0"
+version = "1.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee"
+checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c"
 
 [[package]]
 name = "unicode-width"
@@ -1221,9 +1080,15 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
 
 [[package]]
 name = "wasi"
-version = "0.10.2+wasi-snapshot-preview1"
+version = "0.10.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
+
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 
 [[package]]
 name = "winapi"
diff --git a/Cargo.toml b/Cargo.toml
index bed8ea9c..36dc4b03 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,8 @@ homepage = "https://github.com/LNP-BP"
 keywords = ["lnp-bp", "cryptocurrency", "smart-contracts", "blockchain"]
 categories = ["cryptography::cryptocurrencies", "encoding", "parsing"]
 readme = "README.md"
-edition = "2018"
+edition = "2021"
+rust-version = "1.59.0"
 exclude = [".github", "commit_verify", "strict_encoding", "single_use_seals"]
 
 [lib]
diff --git a/README.md b/README.md
index 5a77a193..1a99d54a 100644
--- a/README.md
+++ b/README.md
@@ -25,9 +25,8 @@ possible applications designed by Giacomo Zucco. It was shaped into a protocol-
 level design by Dr Maxim Orlovsky with a big input from the community and
 implemented by him as this set of libraries.
 
-Minimum supported rust version for the library (MSRV) is 1.51 (if used without
-`crypto` feature because of `dalek` dependency requiring rust edition 2021),
-or 1.56 otherwise.
+Minimum supported rust version for the library (MSRV) is 1.59 and 2021 rust 
+edition.
 
 
 ## Documentation
diff --git a/commit_verify/Cargo.toml b/commit_verify/Cargo.toml
index 430084b8..4d5dfeec 100644
--- a/commit_verify/Cargo.toml
+++ b/commit_verify/Cargo.toml
@@ -9,7 +9,8 @@ homepage = "https://github.com/LNP-BP"
 keywords = ["lnp-bp", "cryptography", "smart-contracts", "commit-verify"]
 categories = ["cryptography", "encoding"]
 readme = "README.md"
-edition = "2018"
+edition = "2021"
+rust-version = "1.59.0"
 
 [lib]
 name = "commit_verify"
diff --git a/commit_verify/src/merkle.rs b/commit_verify/src/merkle.rs
index d8f7c577..0fa7fcf3 100644
--- a/commit_verify/src/merkle.rs
+++ b/commit_verify/src/merkle.rs
@@ -18,7 +18,6 @@
 //! [LNPBP-81]: https://github.com/LNP-BP/LNPBPs/blob/master/lnpbp-0081.md
 
 use std::io;
-use std::iter::FromIterator;
 
 use bitcoin_hashes::{sha256, Hash, HashEngine};
 
@@ -358,35 +357,35 @@ mod test {
         }
 
         let large = vec![Item(s!("none")); 3];
-        let vec: MerkleSource<Item> = large.clone().into();
+        let vec: MerkleSource<Item> = large.into();
         assert_eq!(
             vec.commit_serialize().to_hex(),
             "71ea45868fbd924061c4deb84f37ed82b0ac808de12aa7659afda7d9303e7a71"
         );
 
         let large = vec![Item(s!("none")); 5];
-        let vec: MerkleSource<Item> = large.clone().into();
+        let vec: MerkleSource<Item> = large.into();
         assert_eq!(
             vec.commit_serialize().to_hex(),
             "e255e0124efe0555fde0d932a0bc0042614129e1a02f7b8c0bf608b81af3eb94"
         );
 
         let large = vec![Item(s!("none")); 9];
-        let vec: MerkleSource<Item> = large.clone().into();
+        let vec: MerkleSource<Item> = large.into();
         assert_eq!(
             vec.commit_serialize().to_hex(),
             "6cd2d5345a654af4720bdcc637183ded8e432dc88f778b7d27c8d5a0e342c65f"
         );
 
         let large = vec![Item(s!("none")); 13];
-        let vec: MerkleSource<Item> = large.clone().into();
+        let vec: MerkleSource<Item> = large.into();
         assert_eq!(
             vec.commit_serialize().to_hex(),
             "3714c08c7c94a4ef769ad2cb7df9aaca1e1252d6599a02aff281c37e7242797d"
         );
 
         let large = vec![Item(s!("none")); 17];
-        let vec: MerkleSource<Item> = large.clone().into();
+        let vec: MerkleSource<Item> = large.into();
         assert_eq!(
             vec.commit_serialize().to_hex(),
             "6093dec47e5bdd706da01e4479cb65632eac426eb59c8c28c4e6c199438c8b6f"
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
new file mode 100644
index 00000000..292fe499
--- /dev/null
+++ b/rust-toolchain.toml
@@ -0,0 +1,2 @@
+[toolchain]
+channel = "stable"
diff --git a/single_use_seals/Cargo.toml b/single_use_seals/Cargo.toml
index d30cc563..fd25b8b2 100644
--- a/single_use_seals/Cargo.toml
+++ b/single_use_seals/Cargo.toml
@@ -9,7 +9,8 @@ homepage = "https://github.com/LNP-BP"
 keywords = ["lnp-bp", "cryptography", "smart-contracts", "single-use-seals"]
 categories = ["cryptography", "cryptography::cryptocurrencies"]
 readme = "README.md"
-edition = "2018"
+edition = "2021"
+rust-version = "1.59.0"
 
 [lib]
 name = "single_use_seals"
diff --git a/src/api.rs b/src/api.rs
index b4ec1868..74fd6cef 100644
--- a/src/api.rs
+++ b/src/api.rs
@@ -14,7 +14,6 @@
 
 use std::fmt::{self, Debug, Display, Formatter};
 use std::hash::Hash;
-use std::iter::FromIterator;
 use std::ops::AddAssign;
 
 use strict_encoding::{StrictDecode, StrictEncode};
diff --git a/strict_encoding/Cargo.toml b/strict_encoding/Cargo.toml
index 293e1903..32ed6885 100644
--- a/strict_encoding/Cargo.toml
+++ b/strict_encoding/Cargo.toml
@@ -9,7 +9,8 @@ homepage = "https://github.com/LNP-BP"
 keywords = ["lnp-bp", "strict-encoding", "networking", "bitcoin", "internet2"]
 categories = ["encoding", "parsing"]
 readme = "README.md"
-edition = "2018"
+edition = "2021"
+rust-version = "1.59.0"
 exclude = ["derive"]
 
 [lib]
diff --git a/strict_encoding/derive/Cargo.toml b/strict_encoding/derive/Cargo.toml
index 761119ef..c69bb709 100644
--- a/strict_encoding/derive/Cargo.toml
+++ b/strict_encoding/derive/Cargo.toml
@@ -9,7 +9,8 @@ homepage = "https://github.com/LNP-BP"
 keywords = ["lnp-bp", "strict-encoding", "networking", "internet2", "proc-macro"]
 categories = ["encoding", "parsing"]
 readme = "../README.md"
-edition = "2018"
+edition = "2021"
+rust-version = "1.59.0"
 
 [lib]
 proc-macro = true
diff --git a/strict_encoding/derive_helpers/Cargo.toml b/strict_encoding/derive_helpers/Cargo.toml
index 1d2e35e6..8d84745e 100644
--- a/strict_encoding/derive_helpers/Cargo.toml
+++ b/strict_encoding/derive_helpers/Cargo.toml
@@ -9,7 +9,8 @@ homepage = "https://github.com/LNP-BP"
 keywords = ["lnp-bp", "strict-encoding", "networking", "internet2", "proc-macro"]
 categories = ["encoding", "parsing"]
 readme = "../README.md"
-edition = "2018"
+edition = "2021"
+rust-version = "1.59.0"
 
 [lib]
 
diff --git a/strict_encoding/derive_helpers/src/decode.rs b/strict_encoding/derive_helpers/src/decode.rs
index 27698e19..72897e6a 100644
--- a/strict_encoding/derive_helpers/src/decode.rs
+++ b/strict_encoding/derive_helpers/src/decode.rs
@@ -140,7 +140,7 @@ fn decode_struct_impl(
 
     Ok(quote! {
         impl #impl_generics #import::#trait_name for #ident_name #ty_generics #where_clause {
-            #[inline]
+            #[allow(clippy::init_numbered_fields)]
             fn #decode_name<D: ::std::io::Read>(mut d: D) -> ::core::result::Result<Self, #import::Error> {
                 use #import::#trait_name;
                 #inner_impl
@@ -246,6 +246,7 @@ fn decode_enum_impl(
 
     Ok(quote! {
         impl #impl_generics #import::#trait_name for #ident_name #ty_generics #where_clause {
+            #[allow(clippy::init_numbered_fields)]
             fn #decode_name<D: ::std::io::Read>(mut d: D) -> ::core::result::Result<Self, #import::Error> {
                 use #import::#trait_name;
                 Ok(match #repr::#decode_name(&mut d)? {
diff --git a/strict_encoding/derive_helpers/src/param.rs b/strict_encoding/derive_helpers/src/param.rs
index 727644d2..5e32ed43 100644
--- a/strict_encoding/derive_helpers/src/param.rs
+++ b/strict_encoding/derive_helpers/src/param.rs
@@ -13,7 +13,6 @@
 // software. If not, see <https://opensource.org/licenses/Apache-2.0>.
 
 use std::collections::BTreeMap;
-use std::convert::{TryFrom, TryInto};
 
 use amplify::proc_attr::{
     ArgValue, ArgValueReq, AttrReq, LiteralClass, ParametrizedAttr, ValueClass,
diff --git a/strict_encoding/src/bitcoin.rs b/strict_encoding/src/bitcoin.rs
index edc81d95..c47aa153 100644
--- a/strict_encoding/src/bitcoin.rs
+++ b/strict_encoding/src/bitcoin.rs
@@ -1243,6 +1243,7 @@ pub(crate) mod test {
 
     #[test]
     fn test_amount() {
+        #[allow(clippy::inconsistent_digit_grouping)]
         let value = 19_356_465_2435_5767__u64;
         let amount = Amount::from_sat(value);
         let data = value.to_le_bytes();
diff --git a/strict_encoding/src/collections.rs b/strict_encoding/src/collections.rs
index a671088c..99ddba12 100644
--- a/strict_encoding/src/collections.rs
+++ b/strict_encoding/src/collections.rs
@@ -13,7 +13,6 @@
 // software. If not, see <https://opensource.org/licenses/Apache-2.0>.
 
 use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
-use std::convert::TryFrom;
 use std::fmt::Debug;
 use std::hash::Hash;
 use std::io;
diff --git a/strict_encoding/src/crypto.rs b/strict_encoding/src/crypto.rs
index c8a7443a..6664d3fd 100644
--- a/strict_encoding/src/crypto.rs
+++ b/strict_encoding/src/crypto.rs
@@ -226,7 +226,7 @@ mod test {
             0x79833565,
             blind.clone(),
             blind.clone(),
-            blind.clone(),
+            blind,
             None,
             None,
         );
diff --git a/strict_encoding/src/lib.rs b/strict_encoding/src/lib.rs
index a641b8a9..f0c9f6e9 100644
--- a/strict_encoding/src/lib.rs
+++ b/strict_encoding/src/lib.rs
@@ -84,10 +84,6 @@ mod primitives;
 mod slice32;
 pub mod strategies;
 
-#[deprecated(since = "1.6.1", note = "use strict_encoding_test crate instead")]
-#[macro_use]
-pub mod test_helpers;
-
 use std::io::Seek;
 use std::ops::Range;
 use std::path::Path;
diff --git a/strict_encoding/src/net.rs b/strict_encoding/src/net.rs
index deab61f9..3c2735a3 100644
--- a/strict_encoding/src/net.rs
+++ b/strict_encoding/src/net.rs
@@ -33,7 +33,6 @@
 //! - QUIC (more efficient UDP version)
 //! This list may be extended with future LNPBP-42 revisions
 
-use std::convert::TryFrom;
 use std::net::{
     IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6,
 };
@@ -660,8 +659,6 @@ impl Strategy for SocketAddrV6 {
 
 #[cfg(test)]
 mod test {
-    use std::convert::TryInto;
-
     use super::*;
     use crate::strict_deserialize;
 
@@ -1091,8 +1088,8 @@ mod test {
         .map(Result::unwrap);
 
         for ip in ips {
-            for port in vec![None, Some(32), Some(6432), Some(50001)] {
-                for transport in vec![
+            for port in [None, Some(32), Some(6432), Some(50001)] {
+                for transport in [
                     None,
                     Some(Transport::Tcp),
                     Some(Transport::Udp),
diff --git a/strict_encoding/src/pointers.rs b/strict_encoding/src/pointers.rs
index 9c268c4b..fc88c94e 100644
--- a/strict_encoding/src/pointers.rs
+++ b/strict_encoding/src/pointers.rs
@@ -179,7 +179,7 @@ pub mod test {
     fn test_error_propagation() {
         gen_strings().into_iter().for_each(|s| {
             let r = strict_serialize(&s).unwrap();
-            let p: Result<String, _> = strict_deserialize(&r[..1].to_vec());
+            let p: Result<String, _> = strict_deserialize(&r[..1]);
             assert!(p.is_err());
         })
     }


Test patch:
diff --git a/strict_encoding/derive/tests/basics.rs b/strict_encoding/derive/tests/basics.rs
index 232ed51f..d27b9353 100644
--- a/strict_encoding/derive/tests/basics.rs
+++ b/strict_encoding/derive/tests/basics.rs
@@ -54,7 +54,7 @@ fn unit_struct() -> Result {
     #[derive(Clone, PartialEq, Eq, Debug)]
     #[derive(StrictEncode, StrictDecode)]
     struct Strict(u16);
-    test_encoding_roundtrip(&Strict(0xcafe), [0xFe, 0xCA])?;
+    test_encoding_roundtrip(&Strict(0xcafe), [0xFE, 0xCA])?;
 
     #[derive(Clone, PartialEq, Eq, Debug)]
     #[derive(NetworkEncode, NetworkDecode)]
diff --git a/strict_encoding/derive/tests/common/mod.rs b/strict_encoding/derive/tests/common/mod.rs
index 88e5924d..05cc2d75 100644
--- a/strict_encoding/derive/tests/common/mod.rs
+++ b/strict_encoding/derive/tests/common/mod.rs
@@ -22,13 +22,13 @@ use strict_encoding_test::DataEncodingTestFailure;
 
 #[allow(dead_code)]
 pub fn compile_test(mode: &'static str) {
-    let mut config = compiletest::Config::default();
-
-    config.mode = mode.parse().expect("Invalid mode");
-    config.src_base = PathBuf::from(format!("tests/{}", mode));
-    config.link_deps(); // Populate config.target_rustcflags with dependencies on the path
-    config.clean_rmeta(); // If your tests import the parent crate, this helps with E0464
-
+    let mut config = compiletest::Config {
+        mode: mode.parse().expect("Invalid mode"),
+        src_base: PathBuf::from(format!("tests/{}", mode)),
+        ..default!()
+    };
+    config.link_deps();
+    config.clean_rmeta();
     compiletest::run_tests(&config);
 }
 
diff --git a/strict_encoding/derive/tests/structs.rs b/strict_encoding/derive/tests/structs.rs
new file mode 100644
index 00000000..6f5bf7be
--- /dev/null
+++ b/strict_encoding/derive/tests/structs.rs
@@ -0,0 +1,37 @@
+// LNP/BP client-side-validation foundation libraries implementing LNPBP
+// specifications & standards (LNPBP-4, 7, 8, 9, 42, 81)
+//
+// Written in 2019-2022 by
+//     Dr. Maxim Orlovsky <orlovsky@pandoracore.com>
+//
+// To the extent possible under law, the author(s) have dedicated all
+// copyright and related and neighboring rights to this software to
+// the public domain worldwide. This software is distributed without
+// any warranty.
+//
+// You should have received a copy of the Apache 2.0 License along with this
+// software. If not, see <https://opensource.org/licenses/Apache-2.0>.
+
+#[macro_use]
+extern crate amplify;
+#[macro_use]
+extern crate strict_encoding_test;
+
+mod common;
+
+use common::Result;
+use strict_encoding_test::test_encoding_roundtrip;
+
+#[test]
+fn struct_numbered_fields() -> Result {
+    #[derive(Clone, PartialEq, Eq, Debug)]
+    #[derive(StrictEncode, StrictDecode)]
+    struct NumberedFields(u8, String);
+
+    let fields = NumberedFields(7, s!("some"));
+    test_encoding_roundtrip(&fields, [
+        0x07, 0x04, 0x00, b's', b'o', b'm', b'e',
+    ])?;
+
+    Ok(())
+}
diff --git a/strict_encoding/src/test_helpers.rs b/strict_encoding/src/test_helpers.rs
deleted file mode 100644
index 547aa5f1..00000000
--- a/strict_encoding/src/test_helpers.rs
+++ /dev/null
@@ -1,543 +0,0 @@
-// LNP/BP client-side-validation foundation libraries implementing LNPBP
-// specifications & standards (LNPBP-4, 7, 8, 9, 42, 81)
-//
-// Written in 2019-2022 by
-//     Dr. Maxim Orlovsky <orlovsky@pandoracore.com>
-//
-// To the extent possible under law, the author(s) have dedicated all
-// copyright and related and neighboring rights to this software to
-// the public domain worldwide. This software is distributed without
-// any warranty.
-//
-// You should have received a copy of the Apache 2.0 License along with this
-// software. If not, see <https://opensource.org/licenses/Apache-2.0>.
-
-// TODO: #35 Remove from here upon v 2.0 release (the code is already a part
-//       of separate crate `strict_encoding_test`
-
-#![allow(deprecated)]
-
-//! Deprecated: use strict_encoding_test crate instead
-
-use std::fmt::Debug;
-
-use crate::{Error, StrictDecode, StrictEncode};
-
-/// Failures happening during strict encoding tests of enum encodings.
-///
-/// NB: These errors are specific for testing configuration and should not be
-/// used in non-test environment.
-#[derive(Clone, PartialEq, Debug, Display, Error)]
-pub enum EnumEncodingTestFailure<T>
-where
-    T: Clone + PartialEq + Debug,
-{
-    /// Failure during encoding enum variant
-    #[display("Failure during encoding enum variant `{0:?}`: {1:?}")]
-    EncoderFailure(T, Error),
-
-    /// Failure during decoding binary representation of enum variant
-    #[display(
-        "Failure during decoding binary representation of enum variant \
-         `{0:?}`: `{1:?}`
-        \tByte representation: {2:?}"
-    )]
-    DecoderFailure(T, Error, Vec<u8>),
-
-    /// Test case failure representing mismatch between enum variant produced
-    /// by decoding from the originally encoded enum variant
-    #[display(
-        "Roundtrip encoding of enum variant `{original:?}` results in \
-         different variant `{decoded:?}`"
-    )]
-    DecodedDiffersFromOriginal {
-        /// Original value, which was encoded
-        original: T,
-        /// The value resulting from decoding encoded `original` value
-        decoded: T,
-    },
-
-    /// Test case failure representing mismatch between expected enum variant
-    /// primitive value and the actual primitive value assigned to the enum
-    /// variant by the rust compiler
-    #[display(
-        "Expected value `{expected}` for enum variant \
-         `{enum_name}::{variant_name}` does not match the actual value \
-         `{actual}`"
-    )]
-    ValueMismatch {
-        /// Name of the enum being tested
-        enum_name: &'static str,
-        /// Name of the enum variant being tested
-        variant_name: &'static str,
-        /// Expected primitive value for the tested enum variant
-        expected: usize,
-        /// Actual primitive value of the tested enum variant
-        actual: usize,
-    },
-
-    /// Test case failure representing failed byte string representation of the
-    /// encoded enum variant
-    #[display(
-        "Enum variant `{enum_name}:{variant_name}` has incorrect encoding:
-        \tExpected: {expected:?}
-        \tActual: {actual:?}
-        "
-    )]
-    EncodedValueMismatch {
-        /// Name of the enum being tested
-        enum_name: &'static str,
-        /// Name of the enum variant being tested
-        variant_name: &'static str,
-        /// Expected encoded byte string for the tested enum variant
-        expected: Vec<u8>,
-        /// Actual encoded byte string of the tested enum variant
-        actual: Vec<u8>,
-    },
-
-    /// Test case failure representing incorrect decoder error during
-    /// processing out-of-enum range value
-    #[display(
-        "Decoding of out-of-enum-range value `{0}` results in incorrect \
-         decoder error `{1:?}`"
-    )]
-    DecoderWrongErrorOnUnknownValue(
-        /// Value which was decoded into an enum variant
-        u8,
-        /// Error which was produced during decoding that value
-        Error,
-    ),
-
-    /// Test case failure representing a out-of-enum range primitive value
-    /// still being interpreted as one of enum variants
-    #[display(
-        "Out-of-enum-range value `{0}` is interpreted as `{1:?}` enum variant \
-         by rust compiler"
-    )]
-    UnknownDecodesToVariant(
-        /// Value which was decoded into an enum variant
-        u8,
-        /// Enum variant resulting from decoding wrong value
-        T,
-    ),
-
-    /// Test case failure due to wrong `PartialEq` or `Eq` implementation:
-    /// enum variant is not equal to itself
-    #[display("Enum variant `{0:?}` is not equal to itself")]
-    FailedEq(#[doc = "Enum variant which is not equal to itself"] T),
-
-    /// Test case failure due to wrong `PartialEq` or `Eq` implementation:
-    /// two distinct enum variants are still equal
-    #[display("Two distinct enum variants `{0:?}` and `{1:?}` are equal")]
-    FailedNe(
-        /// First of two enum variants which are treated as equal
-        T,
-        /// Second of two enum variants which are treated as equal
-        T,
-    ),
-
-    /// Test case failure due to wrong `PartialOrd` or `Ord` implementation
-    /// happening when enum variants ordering is broken
-    #[display(
-        "Comparing enum variants `{0:?}` and `{1:?}` results in wrong ordering"
-    )]
-    FailedOrd(
-        /// First of two enum variants which are disordered. This variant
-        /// should smaller than the second one, but `Ord` operation
-        /// treats it as a larger one
-        T,
-        /// Second of two enum variants which are disordered. This variant
-        /// should larger than the second one, but `Ord` operation
-        /// treats it as a smaller one
-        T,
-    ),
-}
-
-/// Macro testing encodings of all enum variants.
-///
-/// NB: If the enum has primitive assigned values,
-/// [`test_encoding_enum_by_values`] should be used instead if this macro. If
-/// primitive values are `u8`-based, please use
-/// [`test_encoding_enum_u8_exhaustive`].
-///
-/// Macro expands into an expression of `Result<(),`
-/// [`EnumEncodingTestFailure`]`>` type.
-///
-/// # Covered test case
-///
-/// - Strict encoding must match little-endian encoding of the value
-/// - Roundtrip encoding-decoding of the enum variant must result in the
-///   original value
-#[macro_export]
-#[deprecated(since = "1.6.1", note = "use strict_encoding_test crate instead")]
-macro_rules! test_encoding_enum {
-    ($enum:path as $ty:ty; $( $item:path => $val:expr ),+) => {
-        test_encoding_enum!(strict_encoding => $enum as $ty; $( $item => $val ),+)
-    };
-    ($se:ident => $enum:path as $ty:ty; $( $item:path => $val:expr ),+) => {
-        Ok(())
-        $(
-            .and_then(|_| {
-                use $se::test_helpers::EnumEncodingTestFailure;
-                match $se::strict_serialize(&$item) {
-                    Ok(bytes) if bytes == &$val.to_le_bytes() => {
-                        let deser = $se::strict_deserialize(bytes.clone())
-                            .map_err(|e| EnumEncodingTestFailure::DecoderFailure(
-                                $item, e, bytes
-                            ))?;
-                        if deser != $item {
-                            Err(EnumEncodingTestFailure::DecodedDiffersFromOriginal {
-                                original: $item,
-                                decoded: deser,
-                            })
-                        } else {
-                            Ok(())
-                        }
-                    },
-                    Ok(wrong) => Err(EnumEncodingTestFailure::EncodedValueMismatch {
-                        enum_name: stringify!($enum),
-                        variant_name: stringify!($item),
-                        expected: $val.to_le_bytes().to_vec(),
-                        actual: wrong,
-                    }),
-                    Err(err) => Err(
-                        EnumEncodingTestFailure::EncoderFailure($item, err)
-                    ),
-                }
-            })
-        )+
-    }
-}
-
-/// Macro testing encodings of all enum variants for enums with assigned
-/// primitive integer values.
-///
-/// Macro expands into an expression of `Result<(),`
-/// [`EnumEncodingTestFailure`]`>` type.
-///
-/// Macro extends functionality of [`test_encoding_enum`] and should be used
-/// whenever enum has assigned primitive integer values. If the primitive values
-/// are of `u8` type, [`test_encoding_enum_u8_exhaustive`] should be used
-/// instead of this macro.
-///
-/// # Covered test cases
-///
-/// - Each enum variant must have a primitive value
-/// - Primitive value representing enum variant must be equal to strict encoding
-///   of the same variant. If a primitive enum value occupies of several bytes
-///   (`u16`, `u32` and other large integer types), strict encoding must match
-///   little-endian encoding of the value
-/// - Roundtrip encoding-decoding of the enum variant must result in the
-///   original value
-/// - Each enum variant must be equal to itself
-/// - Each enum variant must not be equal to any other enum variant
-/// - Enum variants must be ordered according to their primitive values
-#[macro_export]
-#[deprecated(since = "1.6.1", note = "use strict_encoding_test crate instead")]
-macro_rules! test_encoding_enum_by_values {
-    ($enum:path as $ty:ty; $( $item:path => $val:expr ),+) => {
-        test_encoding_enum_by_values!(strict_encoding => $enum as $ty; $( $item => $val ),+)
-    };
-    ($se:ident => $enum:path as $ty:ty; $( $item:path => $val:expr ),+) => {
-        test_encoding_enum!($se => $enum as $ty; $( $item => $val ),+)
-        $(
-            .and_then(|_| {
-                use $se::test_helpers::EnumEncodingTestFailure;
-                if $item as $ty != ($val) {
-                    return Err(EnumEncodingTestFailure::ValueMismatch {
-                        enum_name: stringify!($enum),
-                        variant_name: stringify!($item),
-                        expected: ($val) as usize,
-                        actual: $item as usize,
-                    })
-                }
-                Ok(())
-            })
-        )+
-            .and_then(|_| {
-                use $se::test_helpers::EnumEncodingTestFailure;
-                let mut all = ::std::collections::BTreeSet::new();
-                $( all.insert($item); )+
-                for (idx, a) in all.iter().enumerate() {
-                    if a != a {
-                        return Err(EnumEncodingTestFailure::FailedEq(*a));
-                    }
-                    for b in all.iter().skip(idx + 1) {
-                        if a == b || (*a as usize) == (*b as usize) {
-                            return Err(EnumEncodingTestFailure::FailedNe(*a, *b))
-                        }
-                        if (a >= b && (*a as usize) < (*b as usize)) ||
-                           (a <= b && (*a as usize) > (*b as usize)) {
-                            return Err(EnumEncodingTestFailure::FailedOrd(*a, *b))
-                        }
-                    }
-                }
-                Ok(())
-        })
-    }
-}
-
-/// Macro testing encoding of all possible enum values, covering full range of
-/// `u8` values, including enum out-of-range values.
-///
-/// Macro expands into an expression of `Result<(),`
-/// [`EnumEncodingTestFailure`]`>` type.
-///
-/// Macro extends functionality of [`test_encoding_enum_by_values`] and should
-/// be used whenever enum with assigned primitive values is represented by `u8`
-/// integers.
-///
-/// # Covered test cases
-///
-/// - Each enum variant must have a primitive value
-/// - Primitive value representing enum variant must be equal to strict encoding
-///   of the same variant. If a primitive enum value occupies of several bytes
-///   (`u16`, `u32` and other large integer types), strict encoding must match
-///   little-endian encoding of the value
-/// - Roundtrip encoding-decoding of the enum variant must result in the
-///   original value
-/// - Each enum variant must be equal to itself
-/// - Each enum variant must not be equal to any other enum variant
-/// - Enum variants must be ordered according to their primitive values
-/// - All 8-bit integers which do not match any of enum variants must not be
-///   decoded with strict decoder into a valid enum and their decoding must
-///   result in [`Error::EnumValueNotKnown`] error.
-#[macro_export]
-#[deprecated(since = "1.6.1", note = "use strict_encoding_test crate instead")]
-macro_rules! test_encoding_enum_u8_exhaustive {
-    ($enum:path; $( $item:path => $val:expr ),+) => {
-        test_encoding_enum_u8_exhaustive!(strict_encoding => $enum as u8; $( $item => $val ),+)
-    };
-    ($enum:path as $ty:ty; $( $item:path => $val:expr ),+) => {
-        test_encoding_enum_u8_exhaustive!(strict_encoding => $enum as $ty; $( $item => $val ),+)
-    };
-    ($se:ident => $enum:path; $( $item:path => $val:expr ),+) => {
-        test_encoding_enum_u8_exhaustive!($se => $enum as u8; $( $item => $val ),+)
-    };
-    ($se:ident => $enum:path as $ty:ty; $( $item:path => $val:expr ),+) => {
-        test_encoding_enum_by_values!($se => $enum as $ty; $( $item => $val ),+).and_then(|_| {
-            use $se::test_helpers::EnumEncodingTestFailure;
-            let mut set = ::std::collections::HashSet::new();
-            $( set.insert($val); )+
-            for x in 0..=u8::MAX {
-                if !set.contains(&x) {
-                    match $se::strict_deserialize(&[x]) {
-                        Err($se::Error::EnumValueNotKnown(stringify!($enum), a)) if a == x as usize => {},
-                        Err(err) => return Err(
-                            EnumEncodingTestFailure::DecoderWrongErrorOnUnknownValue(x, err)
-                        ),
-                        Ok(variant) => return Err(
-                            EnumEncodingTestFailure::UnknownDecodesToVariant(x, variant)
-                        ),
-                    }
-                }
-            }
-            Ok(())
-        })
-    }
-}
-
-/// Failures happening during strict encoding tests of struct and union
-/// encodings.
-///
-/// NB: These errors are specific for testing configuration and should not be
-/// used in non-test environment.
-#[derive(Clone, PartialEq, Debug, Display, Error)]
-pub enum DataEncodingTestFailure<T>
-where
-    T: StrictEncode + StrictDecode + PartialEq + Debug + Clone,
-{
-    /// Failure during encoding enum variant
-    #[display("Failure during encoding: {0:?}")]
-    EncoderFailure(#[doc = "Encoder error"] Error),
-
-    /// Failure during decoding binary representation of enum variant
-    #[display(
-        "Failure during decoding: `{0:?}`
-        \tByte representation: {1:#x?}"
-    )]
-    DecoderFailure(
-        #[doc = "Decoder error"] Error,
-        #[doc = "Byte string which failed to decode"] Vec<u8>,
-    ),
-
-    /// Failure of the strict encode implementation: encoder reports incorrect
-    /// length of the serialized data
-    #[display(
-        "Encoder reported incorrect length of the serialized data: \
-         `{returned}` instead of `{actual}`"
-    )]
-    EncoderReturnedWrongLength {
-        /// Actual length of the serialized data
-        actual: usize,
-        /// Incorrect length returned by the encoder
-        returned: usize,
-    },
-
-    /// Test case failure representing mismatch between object produced
-    /// by decoding from the originally encoded object
-    #[display(
-        "Roundtrip encoding of `{original:?}` produced different object \
-         `{transcoded:?}`"
-    )]
-    TranscodedObjectDiffersFromOriginal {
-        /// Original value, which was encoded
-        original: T,
-        /// The value resulting from decoding encoded `original` value
-        transcoded: T,
-    },
-
-    /// Test case failure representing mismatch between original test vector
-    /// and serialization of the object decoded from that test vector
-    #[display(
-        "Serialization of the object `{object:?}` decoded from a test vector \
-         results in a different byte string:
-        \tOriginal: {original:#x?}
-        \tSerialization: {transcoded:#x?}
-        "
-    )]
-    TranscodedVecDiffersFromOriginal {
-        /// Original test vector, which was decoded
-        original: Vec<u8>,
-        /// Byte string produced by encoding object, decoded from the test
-        /// vector
-        transcoded: Vec<u8>,
-        /// Object decoded from the test vector
-        object: T,
-    },
-}
-
-/// Test helper performing encode-decode roundtrip for a provided object. Object
-/// type must be `PartialEq + Clone + Debug`.
-///
-/// # Returns
-///
-/// If suceeds, encoded byte string representing the object. Otheriwse,
-/// [`DataEncodingTestFailure`] (see description below)
-///
-/// # Error
-///
-/// Errors on:
-/// - encoding or decoding failures;
-/// - if the original object is not equivalent to its decoded version;
-/// - if encoder returns number of bytes that does not match the length of the
-///   encoded data.
-///
-/// # Panics
-///
-/// Function does not panics and instead returns [`DataEncodingTestFailure`] for
-/// each type of test failures.
-#[inline]
-#[deprecated(since = "1.6.1", note = "use strict_encoding_test crate instead")]
-pub fn test_object_encoding_roundtrip<T>(
-    object: &T,
-) -> Result<Vec<u8>, DataEncodingTestFailure<T>>
-where
-    T: StrictEncode + StrictDecode + PartialEq + Clone + Debug,
-{
-    let mut encoded_object: Vec<u8> = vec![];
-    let written = object
-        .strict_encode(&mut encoded_object)
-        .map_err(DataEncodingTestFailure::EncoderFailure)?;
-    let len = encoded_object.len();
-    if written != len {
-        return Err(DataEncodingTestFailure::EncoderReturnedWrongLength {
-            actual: len,
-            returned: written,
-        });
-    }
-    let decoded_object =
-        T::strict_decode(&encoded_object[..]).map_err(|e| {
-            DataEncodingTestFailure::DecoderFailure(e, encoded_object.clone())
-        })?;
-    if &decoded_object != object {
-        return Err(
-            DataEncodingTestFailure::TranscodedObjectDiffersFromOriginal {
-                original: object.clone(),
-                transcoded: decoded_object,
-            },
-        );
-    }
-    Ok(encoded_object)
-}
-
-/// Test helper performing decode-eecode roundtrip for a provided test vector
-/// byte string.
-///
-/// # Returns
-///
-/// If suceeds, decoded object, which must have `PartialEq + Clone + Debug`
-/// type. Otheriwse, [`DataEncodingTestFailure`] (see description below)
-///
-/// # Error
-///
-/// Errors on:
-/// - encoding or decoding failures;
-/// - if the original test vector is not equivalent to its transcoded version;
-/// - if encoder returns number of bytes that does not match the length of the
-///   test vector.
-///
-/// # Panics
-///
-/// Function does not panics and instead returns [`DataEncodingTestFailure`] for
-/// each type of test failures.
-#[deprecated(since = "1.6.1", note = "use strict_encoding_test crate instead")]
-pub fn test_vec_decoding_roundtrip<T>(
-    test_vec: impl AsRef<[u8]>,
-) -> Result<T, DataEncodingTestFailure<T>>
-where
-    T: StrictEncode + StrictDecode + PartialEq + Clone + Debug,
-{
-    let test_vec = test_vec.as_ref();
-    let decoded_object = T::strict_decode(test_vec).map_err(|e| {
-        DataEncodingTestFailure::DecoderFailure(e, test_vec.to_vec())
-    })?;
-    let encoded_object = test_object_encoding_roundtrip(&decoded_object)?;
-    if test_vec != encoded_object {
-        return Err(
-            DataEncodingTestFailure::TranscodedVecDiffersFromOriginal {
-                original: test_vec.to_vec(),
-                transcoded: encoded_object,
-                object: decoded_object,
-            },
-        );
-    }
-    Ok(decoded_object)
-}
-
-/// Test helper performing double encode-decode roundtrip for an object
-/// and a matching binary encoding test vector. Object type must be
-/// `PartialEq + Clone + Debug`.
-///
-/// # Error
-///
-/// Errors on:
-/// - encoding or decoding failures;
-/// - if the original object is not equivalent to its decoded version;
-/// - if the original test vector is not equivalent to its transcoded version;
-/// - if encoder returns number of bytes that does not match the length of the
-///   test vector.
-///
-/// # Panics
-///
-/// Function does not panics and instead returns [`DataEncodingTestFailure`] for
-/// each type of test failures.
-#[deprecated(since = "1.6.1", note = "use strict_encoding_test crate instead")]
-pub fn test_encoding_roundtrip<T>(
-    object: &T,
-    test_vec: impl AsRef<[u8]>,
-) -> Result<(), DataEncodingTestFailure<T>>
-where
-    T: StrictEncode + StrictDecode + PartialEq + Clone + Debug,
-{
-    let decoded_object = test_vec_decoding_roundtrip(test_vec)?;
-    if object != &decoded_object {
-        return Err(
-            DataEncodingTestFailure::TranscodedObjectDiffersFromOriginal {
-                original: object.clone(),
-                transcoded: decoded_object,
-            },
-        );
-    }
-    Ok(())
-}
diff --git a/strict_encoding/test_helpers/Cargo.toml b/strict_encoding/test_helpers/Cargo.toml
index 170a1650..8e36cfdb 100644
--- a/strict_encoding/test_helpers/Cargo.toml
+++ b/strict_encoding/test_helpers/Cargo.toml
@@ -9,7 +9,8 @@ homepage = "https://github.com/LNP-BP"
 keywords = ["lnp-bp", "strict-encoding", "networking"]
 categories = ["encoding", "parsing"]
 readme = "../README.md"
-edition = "2018"
+edition = "2021"
+rust-version = "1.59.0"
 
 [lib]