Skip to content

Commit 75a7267

Browse files
Remove clock feature (#341)
* Remove `clock` feature * Tests can link with std * clippy config * add issue link * Fix clippy uninlined_format_args catch Co-authored-by: Farhad Shabani <[email protected]>
1 parent 3335d0d commit 75a7267

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

.github/workflows/rust.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- uses: actions-rs/clippy-check@v1
8686
with:
8787
token: ${{ secrets.GITHUB_TOKEN }}
88-
args: --no-default-features --features "clock" --all-targets # tests need the clock feature
88+
args: --no-default-features --lib
8989

9090
test-stable:
9191
runs-on: ubuntu-latest

crates/ibc/Cargo.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ std = [
3333
"num-traits/std",
3434
"uint/std",
3535
"primitive-types/std",
36-
"clock",
36+
"tendermint/clock",
3737
"tendermint/std",
3838
]
39-
clock = ["tendermint/clock", "time/std"]
4039
parity-scale-codec = ["dep:parity-scale-codec", "dep:scale-info"]
4140
borsh = ["dep:borsh"]
4241

@@ -45,7 +44,7 @@ val_exec_ctx = []
4544

4645
# This feature grants access to development-time mocking libraries, such as `MockContext` or `MockHeader`.
4746
# Depends on the `testgen` suite for generating Tendermint light blocks.
48-
mocks = ["tendermint-testgen", "clock", "cfg-if", "parking_lot"]
47+
mocks = ["tendermint-testgen", "tendermint/clock", "cfg-if", "parking_lot"]
4948
mocks-no-std = ["cfg-if"]
5049

5150
[dependencies]
@@ -101,4 +100,4 @@ test-log = { version = "0.2.10", features = ["trace"] }
101100
tendermint-rpc = { version = "0.28", features = ["http-client", "websocket-client"] }
102101
tendermint-testgen = { version = "0.28" } # Needed for generating (synthetic) light blocks.
103102
parking_lot = { version = "0.12.1" }
104-
cfg-if = { version = "1.0.0" }
103+
cfg-if = { version = "1.0.0" }

crates/ibc/src/core/ics02_client/handler/create_client.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ where
122122
)));
123123

124124
ctx.log_message(format!(
125-
"success: generated new client identifier: {}",
126-
client_id
125+
"success: generated new client identifier: {client_id}"
127126
));
128127

129128
Ok(())

crates/ibc/src/core/ics03_connection/handler/conn_open_init.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ where
6969
let conn_id_on_a = ConnectionId::new(ctx_a.connection_counter()?);
7070

7171
ctx_a.log_message(format!(
72-
"success: conn_open_init: generated new connection identifier: {}",
73-
conn_id_on_a
72+
"success: conn_open_init: generated new connection identifier: {conn_id_on_a}"
7473
));
7574

7675
{

crates/ibc/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
rust_2018_idioms
1212
)]
1313
#![forbid(unsafe_code)]
14+
// https://github.com/cosmos/ibc-rs/issues/342
15+
#![allow(clippy::result_large_err)]
1416
#![doc(html_root_url = "https://docs.rs/ibc/0.25.0")]
1517
//! This library implements the InterBlockchain Communication (IBC) protocol in Rust. IBC is
1618
//! a distributed protocol that enables communication between distinct sovereign blockchains.

crates/ibc/src/timestamp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl Timestamp {
139139
}
140140

141141
/// Returns a `Timestamp` representation of the current time.
142-
#[cfg(feature = "clock")]
142+
#[cfg(feature = "std")]
143143
pub fn now() -> Timestamp {
144144
Time::now().into()
145145
}

0 commit comments

Comments
 (0)