Skip to content

Commit 4c93d39

Browse files
committed
fix: PlutusScript hash function bug
1 parent 28af481 commit 4c93d39

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

conway-cddl/yaml/conway.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ PlutusScript:
17731773
hash(language_version: number): ScriptHash {
17741774
let bytes = new Uint8Array(this.bytes().length + 1);
17751775
bytes[0] = language_version;
1776-
bytes.set(bytes, 1);
1776+
bytes.set(this.bytes(), 1);
17771777
let hash_bytes = cdlCrypto.blake2b224(bytes);
17781778
return new ScriptHash(hash_bytes);
17791779
}

src/generated.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10398,7 +10398,7 @@ export class PlutusScript {
1039810398
hash(language_version: number): ScriptHash {
1039910399
let bytes = new Uint8Array(this.bytes().length + 1);
1040010400
bytes[0] = language_version;
10401-
bytes.set(bytes, 1);
10401+
bytes.set(this.bytes(), 1);
1040210402
let hash_bytes = cdlCrypto.blake2b224(bytes);
1040310403
return new ScriptHash(hash_bytes);
1040410404
}

0 commit comments

Comments
 (0)