Skip to content

Commit

Permalink
Update Manifest instructions Equality check (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
GhenadieVP committed Sep 20, 2023
1 parent 1050f65 commit 245ed60
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/EngineKit/HashableExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ extension Instruction: Hashable {
(.dropAuthZoneProofs, .dropAuthZoneProofs),
(.dropAuthZoneRegularProofs, .dropAuthZoneRegularProofs),
(.dropAuthZoneSignatureProofs, .dropAuthZoneSignatureProofs),
(.dropAllProofs, .dropAllProofs):
(.dropAllProofs, .dropAllProofs),
(.dropNamedProofs, .dropNamedProofs):
return true
case let (.pushToAuthZone(lhs), .pushToAuthZone(rhs)):
return lhs == rhs
Expand All @@ -190,6 +191,8 @@ extension Instruction: Hashable {
return lhs == rhs
case let (.dropProof(lhs), .dropProof(rhs)):
return lhs == rhs
case let (.assertWorktopContainsAny(lhs), .assertWorktopContainsAny(rhs)):
return lhs == rhs
case let (.createProofFromBucketOfAmount(lhsBucketId, lhsAmount), .createProofFromBucketOfAmount(rhsBucketId, rhsAmount)):
return lhsBucketId == rhsBucketId && lhsAmount == rhsAmount
case let (.createProofFromBucketOfNonFungibles(lhsBucketId, lhsIds), .createProofFromBucketOfNonFungibles(rhsBucketId, rhsIds)):
Expand All @@ -203,6 +206,10 @@ extension Instruction: Hashable {
let (.callMetadataMethod(lhsAddress, lhsMethodName, lhsArgs), .callMetadataMethod(rhsAddress, rhsMethodName, rhsArgs)),
let (.callRoleAssignmentMethod(lhsAddress, lhsMethodName, lhsArgs), .callRoleAssignmentMethod(rhsAddress, rhsMethodName, rhsArgs)):
return lhsAddress == rhsAddress && lhsMethodName == rhsMethodName && lhsArgs == rhsArgs
case let (.allocateGlobalAddress(lhsPackageAddress, lhsbBlueprintName), .allocateGlobalAddress(rhsPackageAddress, rhsBlueprintName)):
return lhsPackageAddress == rhsPackageAddress && lhsbBlueprintName == rhsBlueprintName
case let (.callDirectVaultMethod(lhsAddress, lhsMethodName, lhsArgs), .callDirectVaultMethod(rhsAddress, rhsMethodName, rhsArgs)):
return lhsAddress == rhsAddress && lhsMethodName == rhsMethodName && lhsArgs == rhsArgs
default:
return false
}
Expand Down

0 comments on commit 245ed60

Please sign in to comment.