-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from nova-wallet/develop
v3.9.5
- Loading branch information
Showing
20 changed files
with
195 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
import Foundation | ||
import SubstrateSdk | ||
|
||
enum BlockchainWeight { | ||
typealias WeightV1 = StringScaleMapper<UInt64> | ||
|
||
struct WeightV2: Decodable { | ||
@StringCodable var refTime: UInt64 | ||
} | ||
} | ||
|
||
struct BlockWeights: Decodable { | ||
@StringCodable var maxBlock: UInt64 | ||
enum CodingKeys: String, CodingKey { | ||
case maxBlock | ||
} | ||
|
||
let maxBlock: UInt64 | ||
|
||
init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
|
||
if let weight = try? container.decode(BlockchainWeight.WeightV2.self, forKey: .maxBlock) { | ||
maxBlock = weight.refTime | ||
} else { | ||
maxBlock = try container.decode(BlockchainWeight.WeightV1.self, forKey: .maxBlock).value | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
...mmon/Services/ChainRegistry/RuntimeProviderPool/CustomNodes/WeightCompatabilityNode.swift
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...ervices/ChainRegistry/RuntimeProviderPool/CustomNodes/WeightCompatibilityTypeMapper.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.