Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit f722a3b

Browse files
committed
Fixed Web3Units camelCase
Web3Units now uses rawValue Removed old objective-c support files
1 parent c32e017 commit f722a3b

10 files changed

+13
-288
lines changed

Sources/ObjectiveC/BigUInt+ObjC.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

Sources/ObjectiveC/EthereumAddress+ObjC.swift

Lines changed: 0 additions & 30 deletions
This file was deleted.

Sources/ObjectiveC/KeystoreManager+ObjC.swift

Lines changed: 0 additions & 23 deletions
This file was deleted.

Sources/ObjectiveC/PlainKeystore+ObjC.swift

Lines changed: 0 additions & 30 deletions
This file was deleted.

Sources/ObjectiveC/Web3+Eth+ObjC.swift

Lines changed: 0 additions & 31 deletions
This file was deleted.

Sources/ObjectiveC/Web3+HttpProvider+ObjC.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

Sources/ObjectiveC/Web3+Instance+ObjC.swift

Lines changed: 0 additions & 22 deletions
This file was deleted.

Sources/ObjectiveC/Web3+ObjC.swift

Lines changed: 0 additions & 27 deletions
This file was deleted.

Sources/Web3/Web3+Utils.swift

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,18 @@ public class Web3Utils {
1818
}
1919

2020
/// Various units used in Ethereum ecosystem
21-
public enum Web3Units {
22-
case eth
23-
case wei
24-
case Kwei
25-
case Mwei
26-
case Gwei
27-
case Microether
28-
case Finney
29-
30-
var decimals: Int {
31-
switch self {
32-
case .eth:
33-
return 18
34-
case .wei:
35-
return 0
36-
case .Kwei:
37-
return 3
38-
case .Mwei:
39-
return 6
40-
case .Gwei:
41-
return 9
42-
case .Microether:
43-
return 12
44-
case .Finney:
45-
return 15
46-
}
47-
}
21+
//typealias Web3Units.kWei = Web3Units.Kwei
22+
public enum Web3Units: Int {
23+
case eth = 18
24+
case wei = 0
25+
case kWei = 3
26+
case mWei = 6
27+
case gWei = 9
28+
case microEther = 12
29+
case finney = 15
30+
public var decimals: Int {
31+
return rawValue
32+
}
4833
}
4934

5035
extension Web3Utils {

web3swift.xcodeproj/project.pbxproj

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,7 @@
105105
1317BE01218C526C00D6D095 /* TransactionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1317BDE9218C526C00D6D095 /* TransactionTests.swift */; };
106106
1317BE02218C526C00D6D095 /* SECP256K1Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1317BDEA218C526C00D6D095 /* SECP256K1Tests.swift */; };
107107
1317BE03218C526C00D6D095 /* ObjectiveCTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1317BDEB218C526C00D6D095 /* ObjectiveCTests.swift */; };
108-
1353A30621945AE000B4E6D0 /* Web3+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353A2FD21945AE000B4E6D0 /* Web3+ObjC.swift */; };
109-
1353A30721945AE000B4E6D0 /* Web3+HttpProvider+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353A2FE21945AE000B4E6D0 /* Web3+HttpProvider+ObjC.swift */; };
110-
1353A30821945AE000B4E6D0 /* PlainKeystore+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353A2FF21945AE000B4E6D0 /* PlainKeystore+ObjC.swift */; };
111-
1353A30921945AE000B4E6D0 /* Web3+Instance+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353A30021945AE000B4E6D0 /* Web3+Instance+ObjC.swift */; };
112-
1353A30A21945AE000B4E6D0 /* EthereumAddress+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353A30121945AE000B4E6D0 /* EthereumAddress+ObjC.swift */; };
113-
1353A30B21945AE000B4E6D0 /* BigUInt+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353A30221945AE000B4E6D0 /* BigUInt+ObjC.swift */; };
114108
1353A30C21945AE000B4E6D0 /* web3swift.h in Headers */ = {isa = PBXBuildFile; fileRef = 1353A30321945AE000B4E6D0 /* web3swift.h */; settings = {ATTRIBUTES = (Public, ); }; };
115-
1353A30D21945AE000B4E6D0 /* KeystoreManager+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353A30421945AE000B4E6D0 /* KeystoreManager+ObjC.swift */; };
116-
1353A30E21945AE000B4E6D0 /* Web3+Eth+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1353A30521945AE000B4E6D0 /* Web3+Eth+ObjC.swift */; };
117109
/* End PBXBuildFile section */
118110

119111
/* Begin PBXContainerItemProxy section */
@@ -232,15 +224,7 @@
232224
1317BE25218C8A9F00D6D095 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
233225
1317BE26218C8A9F00D6D095 /* LICENSE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.md; sourceTree = "<group>"; };
234226
1317BE27218C8A9F00D6D095 /* web3swift.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = web3swift.podspec; sourceTree = "<group>"; };
235-
1353A2FD21945AE000B4E6D0 /* Web3+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Web3+ObjC.swift"; path = "Sources/ObjectiveC/Web3+ObjC.swift"; sourceTree = SOURCE_ROOT; };
236-
1353A2FE21945AE000B4E6D0 /* Web3+HttpProvider+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Web3+HttpProvider+ObjC.swift"; path = "Sources/ObjectiveC/Web3+HttpProvider+ObjC.swift"; sourceTree = SOURCE_ROOT; };
237-
1353A2FF21945AE000B4E6D0 /* PlainKeystore+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "PlainKeystore+ObjC.swift"; path = "Sources/ObjectiveC/PlainKeystore+ObjC.swift"; sourceTree = SOURCE_ROOT; };
238-
1353A30021945AE000B4E6D0 /* Web3+Instance+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Web3+Instance+ObjC.swift"; path = "Sources/ObjectiveC/Web3+Instance+ObjC.swift"; sourceTree = SOURCE_ROOT; };
239-
1353A30121945AE000B4E6D0 /* EthereumAddress+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "EthereumAddress+ObjC.swift"; path = "Sources/ObjectiveC/EthereumAddress+ObjC.swift"; sourceTree = SOURCE_ROOT; };
240-
1353A30221945AE000B4E6D0 /* BigUInt+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "BigUInt+ObjC.swift"; path = "Sources/ObjectiveC/BigUInt+ObjC.swift"; sourceTree = SOURCE_ROOT; };
241227
1353A30321945AE000B4E6D0 /* web3swift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = web3swift.h; path = Sources/ObjectiveC/web3swift.h; sourceTree = SOURCE_ROOT; };
242-
1353A30421945AE000B4E6D0 /* KeystoreManager+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "KeystoreManager+ObjC.swift"; path = "Sources/ObjectiveC/KeystoreManager+ObjC.swift"; sourceTree = SOURCE_ROOT; };
243-
1353A30521945AE000B4E6D0 /* Web3+Eth+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Web3+Eth+ObjC.swift"; path = "Sources/ObjectiveC/Web3+Eth+ObjC.swift"; sourceTree = SOURCE_ROOT; };
244228
/* End PBXFileReference section */
245229

246230
/* Begin PBXFrameworksBuildPhase section */
@@ -466,18 +450,9 @@
466450
1317BD66218C526300D6D095 /* ObjectiveC */ = {
467451
isa = PBXGroup;
468452
children = (
469-
1353A30221945AE000B4E6D0 /* BigUInt+ObjC.swift */,
470-
1353A30121945AE000B4E6D0 /* EthereumAddress+ObjC.swift */,
471-
1353A30421945AE000B4E6D0 /* KeystoreManager+ObjC.swift */,
472-
1353A2FF21945AE000B4E6D0 /* PlainKeystore+ObjC.swift */,
473-
1353A30521945AE000B4E6D0 /* Web3+Eth+ObjC.swift */,
474-
1353A2FE21945AE000B4E6D0 /* Web3+HttpProvider+ObjC.swift */,
475-
1353A30021945AE000B4E6D0 /* Web3+Instance+ObjC.swift */,
476-
1353A2FD21945AE000B4E6D0 /* Web3+ObjC.swift */,
477453
1353A30321945AE000B4E6D0 /* web3swift.h */,
478454
);
479-
name = ObjectiveC;
480-
path = ObjCSupport;
455+
path = ObjectiveC;
481456
sourceTree = "<group>";
482457
};
483458
1317BDD2218C526C00D6D095 /* Tests */ = {
@@ -682,10 +657,8 @@
682657
1317BD7F218C526300D6D095 /* Web3+JSONRPC.swift in Sources */,
683658
1317BDC8218C526300D6D095 /* Base58.swift in Sources */,
684659
1317BDB0218C526300D6D095 /* KeystoreManager.swift in Sources */,
685-
1353A30621945AE000B4E6D0 /* Web3+ObjC.swift in Sources */,
686660
1317BDB3218C526300D6D095 /* BIP32HDNode.swift in Sources */,
687661
1317BD97218C526300D6D095 /* Batching.swift in Sources */,
688-
1353A30D21945AE000B4E6D0 /* KeystoreManager+ObjC.swift in Sources */,
689662
1317BD8D218C526300D6D095 /* TxPool.swift in Sources */,
690663
1317BD7D218C526300D6D095 /* Web3+Personal.swift in Sources */,
691664
1317BD75218C526300D6D095 /* EthereumFilterEncodingExtensions.swift in Sources */,
@@ -706,14 +679,10 @@
706679
1317BDB7218C526300D6D095 /* BIP32KeystoreJSONStructure.swift in Sources */,
707680
1317BDB4218C526300D6D095 /* BIP39+WordLists.swift in Sources */,
708681
1317BDB9218C526300D6D095 /* EthereumAddress.swift in Sources */,
709-
1353A30921945AE000B4E6D0 /* Web3+Instance+ObjC.swift in Sources */,
710-
1353A30721945AE000B4E6D0 /* Web3+HttpProvider+ObjC.swift in Sources */,
711682
1317BDA9218C526300D6D095 /* ABIv2ParameterTypes.swift in Sources */,
712683
1317BD89218C526300D6D095 /* Web3+Options.swift in Sources */,
713-
1353A30B21945AE000B4E6D0 /* BigUInt+ObjC.swift in Sources */,
714684
1317BDA7218C526300D6D095 /* ABIv2TypeParser.swift in Sources */,
715685
1317BDAF218C526300D6D095 /* BlockExplorer.swift in Sources */,
716-
1353A30E21945AE000B4E6D0 /* Web3+Eth+ObjC.swift in Sources */,
717686
1317BDAC218C526300D6D095 /* SolidityDataWriter.swift in Sources */,
718687
1317BD83218C526300D6D095 /* Web3+Protocols.swift in Sources */,
719688
1317BD85218C526300D6D095 /* Web3+Eth.swift in Sources */,
@@ -728,13 +697,11 @@
728697
1317BDC1218C526300D6D095 /* String+Extension.swift in Sources */,
729698
1317BDA8218C526300D6D095 /* ABIv2Decoding.swift in Sources */,
730699
1317BDC0218C526300D6D095 /* CryptoExtensions.swift in Sources */,
731-
1353A30821945AE000B4E6D0 /* PlainKeystore+ObjC.swift in Sources */,
732700
1317BD80218C526300D6D095 /* Web3+Instance.swift in Sources */,
733701
1317BD6F218C526300D6D095 /* BloomFilter.swift in Sources */,
734702
1317BD73218C526300D6D095 /* EventFiltering.swift in Sources */,
735703
1317BD79218C526300D6D095 /* ERC721.swift in Sources */,
736704
1317BDC5218C526300D6D095 /* Data+Extension.swift in Sources */,
737-
1353A30A21945AE000B4E6D0 /* EthereumAddress+ObjC.swift in Sources */,
738705
1317BD8E218C526300D6D095 /* DecoderExtensions.swift in Sources */,
739706
1317BD8A218C526300D6D095 /* RLP.swift in Sources */,
740707
1317BDBE218C526300D6D095 /* RIPEMD160+StackOveflow.swift in Sources */,

0 commit comments

Comments
 (0)