Skip to content

Commit

Permalink
support metadata hash disable
Browse files Browse the repository at this point in the history
  • Loading branch information
ERussel committed Jul 5, 2024
1 parent df05eef commit 38378b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ struct ChainModel: Equatable, Hashable {
var supportsGenericLedgerApp: Bool {
additional?.supportsGenericLedgerApp?.boolValue ?? false
}

var disabledCheckMetadataHash: Bool {
additional?.disabledCheckMetadataHash?.boolValue ?? false
}
}

extension ChainModel: Identifiable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ extension MetadataHashOperationFactory: MetadataHashOperationFactoryProtocol {
connection: JSONRPCEngine,
runtimeProvider: RuntimeCodingServiceProtocol
) -> CompoundOperationWrapper<Data?> {
guard !chain.disabledCheckMetadataHash else {
return CompoundOperationWrapper.createWithResult(nil)
}

if let existingHash = cache.fetchValue(for: chain.chainId) {
return CompoundOperationWrapper.createWithResult(existingHash)
}
Expand Down

0 comments on commit 38378b5

Please sign in to comment.