Skip to content

Commit a45630c

Browse files
authored
Small fixes after #4570 (#4603)
## Motivation Changes from #4570 left a few small oversights. ## Proposal Fix an incorrect doc string, restore a deleted line from Cargo.toml, change the Debug implementation for CryptoHash (so that the commands printing out chain IDs are actually useful). ## Test Plan CI ## Release Plan - These changes should be backported to the latest `testnet` branch ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 4672cc4 commit a45630c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

CLI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Client implementation and command-line tool for the Linera blockchain
113113
* `assign` — Link the owner to the chain. Expects that the caller has a private key corresponding to the `public_key`, otherwise block proposals will fail when signing with it
114114
* `retry-pending-block` — Retry a block we unsuccessfully tried to propose earlier
115115
* `wallet` — Show the contents of the wallet
116-
* `chain` — Show the contents of the wallet
116+
* `chain` — Show the information about a chain
117117
* `project` — Manage Linera projects
118118
* `net` — Manage a local Linera Network
119119
* `storage` — Operation on the storage
@@ -1032,7 +1032,7 @@ Forgets the specified chain, including the associated key pair
10321032

10331033
## `linera chain`
10341034

1035-
Show the contents of the wallet
1035+
Show the information about a chain
10361036

10371037
**Usage:** `linera chain <COMMAND>`
10381038

linera-base/src/crypto/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl fmt::Display for CryptoHash {
168168

169169
impl fmt::Debug for CryptoHash {
170170
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
171-
write!(f, "{}", hex::encode(&self.0[..8]))
171+
write!(f, "{}", hex::encode(self.0))
172172
}
173173
}
174174

linera-base/src/identifiers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ impl fmt::Debug for AccountOwner {
4545
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4646
match self {
4747
Self::Reserved(byte) => f.debug_tuple("Reserved").field(byte).finish(),
48-
Self::Address32(hash) => write!(f, "Address32({:?}..)", hash),
49-
Self::Address20(bytes) => write!(f, "Address20({}..)", hex::encode(&bytes[..8])),
48+
Self::Address32(hash) => write!(f, "Address32({:?})", hash),
49+
Self::Address20(bytes) => write!(f, "Address20({})", hex::encode(bytes)),
5050
}
5151
}
5252
}

linera-base/src/unit_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ fn chain_ownership_test_case() -> ChainOwnership {
160160
fn account_owner_debug_format() {
161161
assert_eq!(&format!("{:?}", AccountOwner::Reserved(10)), "Reserved(10)");
162162
let addr32 = AccountOwner::Address32(CryptoHash::from([10u8; 32]));
163-
let debug32 = "Address32(0a0a0a0a0a0a0a0a..)";
163+
let debug32 = "Address32(0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a)";
164164
assert_eq!(&format!("{addr32:?}"), debug32);
165165
let addr20 = AccountOwner::Address20([10u8; 20]);
166-
let debug20 = "Address20(0a0a0a0a0a0a0a0a..)";
166+
let debug20 = "Address20(0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a)";
167167
assert_eq!(&format!("{addr20:?}"), debug20);
168168
}

linera-service/src/cli/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ pub enum ClientCommand {
927927
#[command(subcommand)]
928928
Wallet(WalletCommand),
929929

930-
/// Show the contents of the wallet.
930+
/// Show the information about a chain.
931931
#[command(subcommand)]
932932
Chain(ChainCommand),
933933

0 commit comments

Comments
 (0)