Skip to content

Commit

Permalink
Merge pull request #1122 from novasamatech/fix/disable-metadata-hash
Browse files Browse the repository at this point in the history
Support metadata hash disable
  • Loading branch information
ERussel authored Jul 10, 2024
2 parents df05eef + 38378b5 commit 05c4ba0
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 05c4ba0

Please sign in to comment.