Skip to content

Commit daa0996

Browse files
committed
add missing 'script_hash' and 'verification_key_hash' generators.
1 parent e16d284 commit daa0996

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lib/cardano/fuzz.ak

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ pub fn credential() -> Fuzzer<Credential> {
130130

131131
/// Generate an arbitrary `Script` credential.
132132
pub fn script() -> Fuzzer<Credential> {
133-
script_with(bytearray_between(credential_hash_size, credential_hash_size))
133+
script_with(script_hash())
134+
}
135+
136+
/// Generate an arbitrary `ScriptHash`
137+
pub fn script_hash() -> Fuzzer<ScriptHash> {
138+
bytearray_between(credential_hash_size, credential_hash_size)
134139
}
135140

136141
/// Generate an arbitrary `Script` credential, specifying a hash `Fuzzer`.
@@ -150,9 +155,12 @@ pub fn script_with(script_hash: Fuzzer<ScriptHash>) -> Fuzzer<Credential> {
150155

151156
/// Generate an arbitrary `VerificationKey` credential.
152157
pub fn verification_key() -> Fuzzer<Credential> {
153-
verification_key_with(
154-
bytearray_between(credential_hash_size, credential_hash_size),
155-
)
158+
verification_key_with(verification_key_hash())
159+
}
160+
161+
/// Generate an arbitrary `VerificationKeyHash`.
162+
pub fn verification_key_hash() -> Fuzzer<VerificationKeyHash> {
163+
bytearray_between(credential_hash_size, credential_hash_size)
156164
}
157165

158166
/// Generate an arbitrary `VerificationKey` credential, specifying a hash `Fuzzer`.

0 commit comments

Comments
 (0)