ms-cli 0.3.0

Companion CLI for ms-codec — engrave-friendly BIP-39 entropy backups (the ms1 format).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! BIP-39 bad-checksum phrase → exit 1 with friendly message.

use assert_cmd::Command;
use predicates::prelude::*;

#[test]
fn encode_rejects_bad_bip39_checksum() {
    // Replace last word "about" with "ability" to break the BIP-39 checksum.
    let bad = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon ability";
    Command::cargo_bin("ms")
        .unwrap()
        .args(["encode", "--phrase", bad])
        .assert()
        .failure()
        .code(1)
        .stderr(predicate::str::contains("BIP-39 checksum failure"));
}