Skip to content

Commit 6393a9e

Browse files
Witnesses for native scripts in reference inputs (#631)
* Witnesses for native scripts in reference inputs Addresses issue #626. * fix instances I misread the Agda error. There were too many instances, not too few! Removing an (apparently unused) instance in Scripts seems to fix the problem. * Rename `nonRefScripts` to `nativeScripts` --------- Co-authored-by: whatisRT <andre.knispel@iohk.io>
1 parent 424ab29 commit 6393a9e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Ledger/Conway/Conformance/Utxow.agda

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ data _⊢_⇀⦇_,UTXOW⦈_ where
3939
neededHashes = L.scriptsNeeded utxo txb
4040
txdatsHashes = dom txdats
4141
allOutHashes = L.getDataHashes (range txouts)
42+
nativeScripts = mapPartial isInj₁ (txscripts tx utxo)
4243
in
4344
∙ ∀[ (vk , σ) ∈ vkSigs ] isSigned vk (txidBytes txid) σ
44-
∙ ∀[ s ∈ mapPartial isInj₁ (txscripts tx utxo) ] validP1Script witsKeyHashes txvldt s
45+
∙ ∀[ s ∈ nativeScripts ] (hash s ∈ neededHashes validP1Script witsKeyHashes txvldt s)
4546
∙ L.witsVKeyNeeded utxo txb ⊆ witsKeyHashes
4647
∙ neededHashes \ refScriptHashes ≡ᵉ witsScriptHashes
4748
∙ inputHashes ⊆ txdatsHashes

src/Ledger/Script.lagda

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ record ScriptStructure : Type₁ where
159159

160160
field hashRespectsUnion :
161161
{A B Hash : Type} → Hashable A Hash → Hashable B Hash → Hashable (A ⊎ B) Hash
162-
⦃ Hash-P1Script ⦄ : Hashable P1Script ScriptHash
163162

164163
field ps : PlutusStructure
165164
open PlutusStructure ps public

src/Ledger/Utxow.lagda

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ data _⊢_⇀⦇_,UTXOW⦈_ where
161161
neededHashes = scriptsNeeded utxo txb
162162
txdatsHashes = dom txdats
163163
allOutHashes = getDataHashes (range txouts)
164+
nativeScripts = mapPartial isInj₁ (txscripts tx utxo)
164165
in
165166
∙ ∀[ (vk , σ) ∈ vkSigs ] isSigned vk (txidBytes txid) σ
166-
∙ ∀[ s ∈ mapPartial isInj₁ (txscripts tx utxo) ] validP1Script witsKeyHashes txvldt s
167+
∙ ∀[ s ∈ nativeScripts ] (hash s ∈ neededHashes → validP1Script witsKeyHashes txvldt s)
167168
∙ witsVKeyNeeded utxo txb ⊆ witsKeyHashes
168169
∙ neededHashes \ refScriptHashes ≡ᵉ witsScriptHashes
169170
∙ inputHashes ⊆ txdatsHashes

0 commit comments

Comments
 (0)