Skip to content

Commit 77a1c7e

Browse files
Move AnyCodingKeys to appropriate place
1 parent 4cbc68d commit 77a1c7e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Sources/web3swift/Convenience/Decodable+Extensions.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,6 @@
88
import BigInt
99
import Foundation
1010

11-
struct AnyCodingKey: CodingKey {
12-
var stringValue: String
13-
var intValue: Int?
14-
15-
init?(stringValue: String) {
16-
self.stringValue = stringValue
17-
}
18-
19-
init?(intValue: Int) {
20-
self.intValue = intValue
21-
self.stringValue = String(intValue)
22-
}
23-
}
24-
2511
extension KeyedDecodingContainer {
2612
/// Decodes a value of the given key from Hex to `DecodableFromHex`
2713
///

Sources/web3swift/Convenience/Encodable+Extensions.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77
//
88
import Foundation
99

10+
struct AnyCodingKey: CodingKey {
11+
var stringValue: String
12+
var intValue: Int?
13+
14+
init?(stringValue: String) {
15+
self.stringValue = stringValue
16+
}
17+
18+
init?(intValue: Int) {
19+
self.intValue = intValue
20+
self.stringValue = String(intValue)
21+
}
22+
}
23+
1024
extension KeyedEncodingContainer {
1125
/// Encodes the given value for the given key.
1226
///

0 commit comments

Comments
 (0)