Skip to content

Commit 550db67

Browse files
committed
Revert capitalized names
1 parent a5ca3c0 commit 550db67

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

mintscript/src/checker/hashlock.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ impl HashlockChecker for StandardHashlockChecker {
6767
preimage: &[u8; 32],
6868
) -> Result<(), Self::Error> {
6969
match hash_challenge {
70-
HashChallenge::HASH160(expected_hash) => {
70+
HashChallenge::Hash160(expected_hash) => {
7171
let actual_hash = hash::<hash::Ripemd160, _>(hash::<hash::Sha256, _>(preimage));
7272

7373
ensure_hashes_equal(actual_hash.as_slice(), expected_hash)?;
7474
}
75-
HashChallenge::RIPEMD160(_)
76-
| HashChallenge::SHA1(_)
77-
| HashChallenge::SHA256(_)
78-
| HashChallenge::HASH256(_) => {
75+
HashChallenge::Ripemd160(_)
76+
| HashChallenge::Sha1(_)
77+
| HashChallenge::Sha256(_)
78+
| HashChallenge::Hash256(_) => {
7979
unimplemented!()
8080
}
8181
}

mintscript/src/script/display.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ impl WitnessScript {
7878
write!(f, "{algo}(0x{hash}, 0x{preimage})")
7979
};
8080
match hash_challenge {
81-
HashChallenge::RIPEMD160(hash) => write_fn("RIPEMD160", hash.as_slice()),
82-
HashChallenge::SHA1(hash) => write_fn("SHA1", hash.as_slice()),
83-
HashChallenge::SHA256(hash) => write_fn("SHA256", hash.as_slice()),
84-
HashChallenge::HASH160(hash) => write_fn("HASH160", hash.as_slice()),
85-
HashChallenge::HASH256(hash) => write_fn("HASH256", hash.as_slice()),
81+
HashChallenge::Ripemd160(hash) => write_fn("Ripemd160", hash.as_slice()),
82+
HashChallenge::Sha1(hash) => write_fn("Sha1", hash.as_slice()),
83+
HashChallenge::Sha256(hash) => write_fn("Sha256", hash.as_slice()),
84+
HashChallenge::Hash160(hash) => write_fn("Hash160", hash.as_slice()),
85+
HashChallenge::Hash256(hash) => write_fn("Hash256", hash.as_slice()),
8686
}
8787
}
8888
}

mintscript/src/script/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ impl Threshold {
124124

125125
#[derive(Clone, PartialEq, Eq, Debug)]
126126
pub enum HashChallenge {
127-
RIPEMD160([u8; 20]),
128-
SHA1([u8; 20]),
129-
SHA256([u8; 32]),
130-
HASH160([u8; 20]),
131-
HASH256([u8; 32]),
127+
Ripemd160([u8; 20]),
128+
Sha1([u8; 20]),
129+
Sha256([u8; 32]),
130+
Hash160([u8; 20]),
131+
Hash256([u8; 32]),
132132
}
133133

134134
/// Script together with witness data presumably satisfying the script.

mintscript/src/tests/hashlock_checker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn check_hashlock_160_ok(#[case] preimage: &str, #[case] hash: &str) {
7676
let hash = hex::decode(hash).unwrap().try_into().unwrap();
7777
let preimage = hex::decode(preimage).unwrap().try_into().unwrap();
7878

79-
let script = WitnessScript::hashlock(HashChallenge::HASH160(hash), preimage);
79+
let script = WitnessScript::hashlock(HashChallenge::Hash160(hash), preimage);
8080

8181
let context = EmptyContext;
8282
let mut checker = crate::ScriptChecker::full(context);
@@ -91,7 +91,7 @@ fn check_hashlock_160_random_values_mismatch(#[case] seed: Seed) {
9191
let preimage: [u8; 32] = std::array::from_fn(|_| rng.gen::<u8>());
9292
let hash: [u8; 20] = std::array::from_fn(|_| rng.gen::<u8>());
9393

94-
let script = WitnessScript::hashlock(HashChallenge::HASH160(hash), preimage);
94+
let script = WitnessScript::hashlock(HashChallenge::Hash160(hash), preimage);
9595

9696
let context = EmptyContext;
9797
let mut checker = crate::ScriptChecker::full(context);

0 commit comments

Comments
 (0)