Skip to content

Commit

Permalink
Merge pull request #50 from novasamatech/fix/default-types
Browse files Browse the repository at this point in the history
Return fixed type for parameter resolution
  • Loading branch information
ERussel authored Jan 20, 2024
2 parents 6ba51da + 6e5108d commit 6e12c75
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PODS:
- scrypt.c (0.1.1)
- secp256k1.c (0.1.2)
- Starscream (4.0.4)
- SubstrateSdk (1.15.0):
- SubstrateSdk (1.16.1):
- BigInt (~> 5.0)
- IrohaCrypto/ed25519 (~> 0.9.0)
- IrohaCrypto/Scrypt (~> 0.9.0)
Expand Down Expand Up @@ -81,7 +81,7 @@ SPEC CHECKSUMS:
scrypt.c: b42ae06183251329d2b2c620c226fb541a4a3592
secp256k1.c: db47b726585d80f027423682eb369729e61b3b20
Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9
SubstrateSdk: e807dde92cced208e05ae03ace1e65564f11a340
SubstrateSdk: 15ba30c832d76d336c4986acb3a57b10065ff8ab
SwiftLint: 4fa9579c63416865179bc416f0a92d55f009600d
TweetNacl: 3abf4d1d2082b0114e7a67410e300892448951e6
xxHash-Swift: 30bd6a7507b3b7348a277c49b1cb6346c2905ec7
Expand Down
2 changes: 1 addition & 1 deletion SubstrateSdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SubstrateSdk'
s.version = '1.16.0'
s.version = '1.16.1'
s.summary = 'Utility library that implements clients specific logic to interact with substrate based networks'

s.homepage = 'https://github.com/nova-wallet/substrate-sdk-ios'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ public enum RuntimeMetadataSearchEngine {
guard let concreteType = metadata.types.types.first(where: { $0.identifier == lookUpId }) else {
return nil
}

return concreteType.type.pathBasedName
return String(concreteType.identifier)
}

public static func find(type: String, in metadata: RuntimeMetadataV14, mode: RuntimeTypeMatchingMode) -> String? {
let types = findPortableTypes(for: type, in: metadata, mode: mode)

guard !types.isEmpty else {
guard let concreteType = types.first else {
return nil
}

if types.count > 1 {
return types.first?.type.pathBasedName
return concreteType.type.pathBasedName ?? String(concreteType.identifier)
} else {
return types.first.map { String($0.identifier) }
return String(concreteType.identifier)
}
}
}

0 comments on commit 6e12c75

Please sign in to comment.