Skip to content

Commit efcba61

Browse files
authored
deps: Switch to openrlp crate (#39)
* Switch to openrlp crate * Add explicit RLP tests
1 parent f3e5c91 commit efcba61

File tree

10 files changed

+274
-161
lines changed

10 files changed

+274
-161
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ jobs:
3030
- name: Stable with rustfmt and clippy
3131
uses: dtolnay/rust-toolchain@master
3232
with:
33-
components: rustfmt, clippy
3433
toolchain: ${{matrix.rust}}
3534
- name: Release build
3635
run: cargo build --release --all-features
36+
- name: Quick test
37+
run: cargo test --all-features
3738

3839
test:
3940
name: Test
@@ -45,10 +46,11 @@ jobs:
4546
persist-credentials: false
4647

4748
- uses: actions/setup-python@v5
48-
- name: Install stable toolchain
49-
uses: dtolnay/rust-toolchain@stable
49+
- name: Install nightly toolchain
50+
uses: dtolnay/rust-toolchain@nightly
5051
with:
51-
toolchain: stable
52+
toolchain: nightly
53+
components: rustfmt, clippy
5254

5355
- uses: pre-commit/[email protected]
5456
env:
@@ -62,7 +64,7 @@ jobs:
6264
run: cargo rdme --check
6365

6466
- name: Run tests with coverage
65-
run: RUST_BACKTRACE=1 cargo tarpaulin --out Xml --all-features
67+
run: RUST_BACKTRACE=1 cargo +nightly tarpaulin --out Xml --all-features --doc --tests
6668

6769
- name: Submit several transactions to chain
6870
run: |

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Possible header types:
1212
## v0.1.0
1313
- Breaking: bumped MSRV to 1.78.0
1414
- Breaking: upgraded most of direct dependencies
15+
- Breaking: switched to `fastrlp` RLP implementation
16+
- Bugfix: doctests were skipped in CI
1517

1618
## v0.1.0-beta.4
1719
- Fixed incorrect address encoding in presence of leading zeroes (#28).

Cargo.lock

Lines changed: 13 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[dependencies]
22
bip32 = {version = "0.5", default-features = false, features = ["alloc", "secp256k1-ffi"]}
33
blake2 = "0.10"
4-
bytes = "1.5"
4+
bytes = "1.10"
55
ethereum-types = "0.14"
6+
fastrlp = {version = "0.3.1", features = ["ethereum-types", "std"]}
67
itertools = "0.14"
7-
open-fastrlp = {version = "0.1", features = ["std", "ethereum-types"]}
88
rand = {version = "^0.9", features = ["std", "std_rng"], optional = true}
99
reqwest = {version = "0.12", features = ["json"], optional = true}
1010
rustc-hex = "2.1"
@@ -19,7 +19,7 @@ tiny-keccak = {version = "2.0", features = ["keccak"]}
1919
bloomfilter = "^3.0"
2020
ethabi = "^18.0"
2121
rand = "0.9.0"
22-
tokio = {version = "=1.38.1", features = ["full"]}
22+
tokio = {version = "1.38", features = ["full"]}
2323
# version_sync: to ensure versions in `Cargo.toml` and `README.md` are in sync
2424
version-sync = "0.9.4"
2525

src/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl Deref for Address {
3535
}
3636
}
3737
impl Encodable for Address {
38-
fn encode(&self, out: &mut dyn open_fastrlp::BufMut) {
38+
fn encode(&self, out: &mut dyn bytes::BufMut) {
3939
self.0.encode(out)
4040
}
4141
}

src/hdnode.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ impl From<bip32::Error> for HDNodeError {
164164
/// ```rust
165165
/// use thor_devkit::hdnode::{Mnemonic, Language, HDNode};
166166
/// use rand::RngCore;
167-
/// use rand::rngs::OsRng;
168167
///
169168
/// let mnemonic = Mnemonic::from_phrase(
170169
/// "ignore empty bird silly journey junior ripple have guard waste between tenant",
@@ -174,7 +173,7 @@ impl From<bip32::Error> for HDNodeError {
174173
/// let wallet = HDNode::build().mnemonic(mnemonic).build().expect("Must be buildable");
175174
/// // OR
176175
/// let mut entropy = [0u8; 64];
177-
/// OsRng.fill_bytes(&mut entropy);
176+
/// rand::rng().fill_bytes(&mut entropy);
178177
/// let other_wallet = HDNode::build().seed(entropy).build().expect("Must be buildable");
179178
/// ```
180179
#[derive(Clone, Default)]

0 commit comments

Comments
 (0)