Skip to content

chore(typos): fix typos #795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
- Update libs versions, Cartfile and Pods dependencies [\#334](https://github.com/skywinder/web3swift/pull/334) ([AnnaYatsun1](https://github.com/AnnaYatsun1))
- fix crash when 'payable' nil [\#332](https://github.com/skywinder/web3swift/pull/332) ([xdozorx](https://github.com/xdozorx))
- Update README.md [\#331](https://github.com/skywinder/web3swift/pull/331) ([Iysbaera](https://github.com/Iysbaera))
- CrytoSwift update version 1.4.0 [\#327](https://github.com/skywinder/web3swift/pull/327) ([lzttxs](https://github.com/lzttxs))
- CryptoSwift update version 1.4.0 [\#327](https://github.com/skywinder/web3swift/pull/327) ([lzttxs](https://github.com/lzttxs))
- Update carthage libraries [\#325](https://github.com/skywinder/web3swift/pull/325) ([alex78pro](https://github.com/alex78pro))
- Gas estimate fix [\#324](https://github.com/skywinder/web3swift/pull/324) ([frostiq](https://github.com/frostiq))
- Update README.md [\#306](https://github.com/skywinder/web3swift/pull/306) ([manuG420](https://github.com/manuG420))
Expand Down Expand Up @@ -252,7 +252,7 @@
- received transaction id from geth node server but not able to see that transaction id at etherscan.io [\#200](https://github.com/skywinder/web3swift/issues/200)
- How do I fetch information such as balance, decimal,symbol and name of ERC20token ? [\#199](https://github.com/skywinder/web3swift/issues/199)
- Starscream 3.1.0 not compatible with Swift 5.0 [\#195](https://github.com/skywinder/web3swift/issues/195)
- How to Connect infuraWebsocket and subsribe particular event in swift? [\#193](https://github.com/skywinder/web3swift/issues/193)
- How to Connect infuraWebsocket and subscribe particular event in swift? [\#193](https://github.com/skywinder/web3swift/issues/193)
- Use of unresolved identifier 'Wallet' [\#192](https://github.com/skywinder/web3swift/issues/192)
- V in Signed Message Hash not being calculated properly [\#191](https://github.com/skywinder/web3swift/issues/191)
- Not possible to calculate fast, normal and cheap transaction fee ? [\#190](https://github.com/skywinder/web3swift/issues/190)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class WalletViewController: UIViewController {
}
} catch {
#if DEBUG
print("error creating keyStrore")
print("error creating keyStore")
print("Private key error.")
#endif
let alert = UIAlertController(title: "Error", message: "Please enter correct Private key", preferredStyle: .alert)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension RequestParameter: RawRepresentable {
/// to encode mixed type values array in JSON.
///
/// This protocol is used to implement custom `encode` method for that enum,
/// which encodes an array of self-assosiated values.
/// which encodes an array of self-associated values.
///
/// You're totally free to use explicit and more convenience member init as `RequestParameter.int(12)` in your code.
/// - Parameter rawValue: one of the supported types like `Int`, `UInt` etc.
Expand Down
16 changes: 8 additions & 8 deletions Sources/Web3Core/Structure/SECP256k1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ extension SECP256K1 {
} else if v >= 35 && v <= 38 {
v -= 35
}
let result = serializedSignature.withUnsafeBytes { (serRawBufferPtr: UnsafeRawBufferPointer) -> Int32? in
if let serRawPtr = serRawBufferPtr.baseAddress, serRawBufferPtr.count > 0 {
let serPtr = serRawPtr.assumingMemoryBound(to: UInt8.self)
let result = serializedSignature.withUnsafeBytes { (rawBufferPtr: UnsafeRawBufferPointer) -> Int32? in
if let rawPtr = rawBufferPtr.baseAddress, rawBufferPtr.count > 0 {
let ptr = rawPtr.assumingMemoryBound(to: UInt8.self)
return withUnsafeMutablePointer(to: &recoverableSignature) { (signaturePointer: UnsafeMutablePointer<secp256k1_ecdsa_recoverable_signature>) -> Int32 in
let res = secp256k1_ecdsa_recoverable_signature_parse_compact(context, signaturePointer, serPtr, v)
let res = secp256k1_ecdsa_recoverable_signature_parse_compact(context, signaturePointer, ptr, v)
return res
}
} else {
Expand All @@ -210,12 +210,12 @@ extension SECP256K1 {
guard let context = context else { return nil }
var serializedSignature = Data(repeating: 0x00, count: 64)
var v: Int32 = 0
let result = serializedSignature.withUnsafeMutableBytes { (serSignatureRawBufferPointer: UnsafeMutableRawBufferPointer) -> Int32? in
if let serSignatureRawPointer = serSignatureRawBufferPointer.baseAddress, serSignatureRawBufferPointer.count > 0 {
let serSignaturePointer = serSignatureRawPointer.assumingMemoryBound(to: UInt8.self)
let result = serializedSignature.withUnsafeMutableBytes { (signatureRawBufferPointer: UnsafeMutableRawBufferPointer) -> Int32? in
if let signatureRawPointer = signatureRawBufferPointer.baseAddress, signatureRawBufferPointer.count > 0 {
let typedSignaturePointer = signatureRawPointer.assumingMemoryBound(to: UInt8.self)
return withUnsafePointer(to: &recoverableSignature) { (signaturePointer: UnsafePointer<secp256k1_ecdsa_recoverable_signature>) -> Int32 in
withUnsafeMutablePointer(to: &v) { (vPtr: UnsafeMutablePointer<Int32>) -> Int32 in
let res = secp256k1_ecdsa_recoverable_signature_serialize_compact(context, serSignaturePointer, vPtr, signaturePointer)
let res = secp256k1_ecdsa_recoverable_signature_serialize_compact(context, typedSignaturePointer, vPtr, signaturePointer)
return res
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/web3swift/Tokens/ST20/Web3+SecurityToken.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protocol ISecurityToken: IST20, IOwnable {
/// Queries balances as of a defined checkpoint
func balanceOfAt(investor: EthereumAddress, checkpointId: BigUInt) async throws -> BigUInt

/// Creates a checkpoint that can be used to query historical balances / totalSuppy
/// Creates a checkpoint that can be used to query historical balances / totalSupply
func createCheckpoint(from: EthereumAddress) async throws -> WriteOperation

/// gets length of investors array
Expand Down
10 changes: 5 additions & 5 deletions Sources/web3swift/Utils/EIP/EIP681.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ extension Web3 {
switch targetAddress {
case .ethereumAddress(let ethereumAddress):
address = ethereumAddress.address
case let .ensAddress(ensAdress):
address = ensAdress
case let .ensAddress(ensAddress):
address = ensAddress
}
var link = "ethereum:\(address)\(chainID != nil ? "@\(chainID!.description)" : "")"
if let functionName = functionName, !functionName.isEmpty {
Expand Down Expand Up @@ -431,14 +431,14 @@ extension Web3 {
var nativeValueArray: [Any] = []

for value in rawValues {
let intermidiateValue = await parseFunctionArgument(type,
let intermediateValue = await parseFunctionArgument(type,
value,
chainID: chainID,
inputNumber: inputNumber)?
.parameter
.value
if let intermidiateValue = intermidiateValue {
nativeValueArray.append(intermidiateValue)
if let intermediateValue = intermediateValue {
nativeValueArray.append(intermediateValue)
}
}
nativeValue = nativeValueArray
Expand Down
2 changes: 1 addition & 1 deletion Sources/web3swift/Utils/ENS/ENSBaseRegistrar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public extension ENS {
return expirity
}

@available(*, message: "This function should not be used to check if a name can be registered by a user. To check if a name can be registered by a user, check name availablility via the controller")
@available(*, message: "This function should not be used to check if a name can be registered by a user. To check if a name can be registered by a user, check name availability via the controller")
public func isNameAvailable(name: BigUInt) async throws -> Bool {
guard let transaction = self.contract.createReadOperation("available", parameters: [name]) else { throw Web3Error.transactionSerializationError }

Expand Down
18 changes: 9 additions & 9 deletions Sources/web3swift/Web3/Web3+EIP1559.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public extension Web3 {
/// Block number: 13_773_000
case ArrowGlacier

var mainNetFisrtBlockNumber: BigUInt {
var mainNetFirstBlockNumber: BigUInt {
switch self {
case .Byzantium: return 4_370_000
case .Constantinople: return 7_280_000
Expand All @@ -154,28 +154,28 @@ public extension Web3 {
static func getChainVersion(of block: BigUInt) -> MainChainVersion {
// Iterate given block number over each ChainVersion block numbers
// to get the block's ChainVersion.
if block < MainChainVersion.Constantinople.mainNetFisrtBlockNumber {
if block < MainChainVersion.Constantinople.mainNetFirstBlockNumber {
return .Byzantium
// ~= means included in a given range
} else if MainChainVersion.Constantinople.mainNetFisrtBlockNumber..<MainChainVersion.Istanbul.mainNetFisrtBlockNumber ~= block {
} else if MainChainVersion.Constantinople.mainNetFirstBlockNumber..<MainChainVersion.Istanbul.mainNetFirstBlockNumber ~= block {
return .Constantinople
} else if MainChainVersion.Istanbul.mainNetFisrtBlockNumber..<MainChainVersion.MuirGlacier.mainNetFisrtBlockNumber ~= block {
} else if MainChainVersion.Istanbul.mainNetFirstBlockNumber..<MainChainVersion.MuirGlacier.mainNetFirstBlockNumber ~= block {
return .Istanbul
} else if MainChainVersion.MuirGlacier.mainNetFisrtBlockNumber..<MainChainVersion.Berlin.mainNetFisrtBlockNumber ~= block {
} else if MainChainVersion.MuirGlacier.mainNetFirstBlockNumber..<MainChainVersion.Berlin.mainNetFirstBlockNumber ~= block {
return .MuirGlacier
} else if MainChainVersion.Berlin.mainNetFisrtBlockNumber..<MainChainVersion.London.mainNetFisrtBlockNumber ~= block {
} else if MainChainVersion.Berlin.mainNetFirstBlockNumber..<MainChainVersion.London.mainNetFirstBlockNumber ~= block {
return .Berlin
} else if MainChainVersion.London.mainNetFisrtBlockNumber..<MainChainVersion.ArrowGlacier.mainNetFisrtBlockNumber ~= block {
} else if MainChainVersion.London.mainNetFirstBlockNumber..<MainChainVersion.ArrowGlacier.mainNetFirstBlockNumber ~= block {
return .London
} else if block >= MainChainVersion.ArrowGlacier.mainNetFisrtBlockNumber {
} else if block >= MainChainVersion.ArrowGlacier.mainNetFirstBlockNumber {
// Pass to the default return.
}
return .ArrowGlacier
}
}

extension Web3.MainChainVersion: Comparable {
public static func < (lhs: Web3.MainChainVersion, rhs: Web3.MainChainVersion) -> Bool { return lhs.mainNetFisrtBlockNumber < rhs.mainNetFisrtBlockNumber }
public static func < (lhs: Web3.MainChainVersion, rhs: Web3.MainChainVersion) -> Bool { return lhs.mainNetFirstBlockNumber < rhs.mainNetFirstBlockNumber }
}

extension Block {
Expand Down