diff --git a/Sources/Web3Core/EthereumAddress/EthereumAddress.swift b/Sources/Web3Core/EthereumAddress/EthereumAddress.swift index ddc54b963..01cae7b0c 100755 --- a/Sources/Web3Core/EthereumAddress/EthereumAddress.swift +++ b/Sources/Web3Core/EthereumAddress/EthereumAddress.swift @@ -9,8 +9,8 @@ import Foundation import CryptoSwift -public struct EthereumAddress: Equatable { - public enum AddressType { +public struct EthereumAddress: Equatable, Sendable { + public enum AddressType: Sendable { case normal case contractDeployment } diff --git a/Sources/Web3Core/KeystoreManager/BIP32Keystore.swift b/Sources/Web3Core/KeystoreManager/BIP32Keystore.swift index 1646f3631..5c8882cfc 100755 --- a/Sources/Web3Core/KeystoreManager/BIP32Keystore.swift +++ b/Sources/Web3Core/KeystoreManager/BIP32Keystore.swift @@ -62,7 +62,7 @@ public class BIP32Keystore: AbstractKeystore { private static let KeystoreParamsBIP32Version = 4 - public private (set) var addressStorage: PathAddressStorage + public private(set) var addressStorage: PathAddressStorage public convenience init?(_ jsonString: String) { let lowercaseJSON = jsonString.lowercased() diff --git a/Sources/Web3Core/Structure/Block/BlockNumber.swift b/Sources/Web3Core/Structure/Block/BlockNumber.swift index 524f371e3..39829e922 100644 --- a/Sources/Web3Core/Structure/Block/BlockNumber.swift +++ b/Sources/Web3Core/Structure/Block/BlockNumber.swift @@ -8,7 +8,7 @@ import Foundation import BigInt -public enum BlockNumber: CustomStringConvertible { +public enum BlockNumber: CustomStringConvertible, Sendable { case pending /// Latest block of a chain diff --git a/Sources/Web3Core/Transaction/CodableTransaction.swift b/Sources/Web3Core/Transaction/CodableTransaction.swift index 1246e2714..d6fc248f7 100644 --- a/Sources/Web3Core/Transaction/CodableTransaction.swift +++ b/Sources/Web3Core/Transaction/CodableTransaction.swift @@ -10,7 +10,7 @@ import BigInt /// Structure capable of carying the parameters for any transaction type. /// While most fields in this struct are optional, they are not necessarily /// optional for the type of transaction they apply to. -public struct CodableTransaction { +public struct CodableTransaction: Sendable { /// internal access only. The transaction envelope object itself that contains all the transaction data /// and type specific implementation internal var envelope: AbstractEnvelope diff --git a/Sources/Web3Core/Transaction/Envelope/AbstractEnvelope.swift b/Sources/Web3Core/Transaction/Envelope/AbstractEnvelope.swift index 0f75c75b7..c2a5cf1e0 100644 --- a/Sources/Web3Core/Transaction/Envelope/AbstractEnvelope.swift +++ b/Sources/Web3Core/Transaction/Envelope/AbstractEnvelope.swift @@ -21,7 +21,7 @@ import BigInt */ /// Enumeration for supported transaction types -public enum TransactionType: UInt, CustomStringConvertible, CaseIterable { +public enum TransactionType: UInt, CustomStringConvertible, CaseIterable, Sendable { /// For untyped and type 0 transactions EIP155 and older case legacy @@ -62,7 +62,7 @@ public enum EncodeType { /// All envelopes must conform to this protocol to work with `CodableTransaction` /// each implementation holds all the type specific data /// and implements the type specific encoding/decoding -protocol AbstractEnvelope: CustomStringConvertible { // possibly add Codable? +protocol AbstractEnvelope: CustomStringConvertible, Sendable { // possibly add Codable? /// The type of transaction this envelope represents var type: TransactionType { get } diff --git a/Sources/Web3Core/Transaction/Envelope/EIP2930Envelope.swift b/Sources/Web3Core/Transaction/Envelope/EIP2930Envelope.swift index 5034e4e76..b59a4548f 100644 --- a/Sources/Web3Core/Transaction/Envelope/EIP2930Envelope.swift +++ b/Sources/Web3Core/Transaction/Envelope/EIP2930Envelope.swift @@ -8,6 +8,7 @@ import Foundation import BigInt public struct EIP2930Envelope: EIP2718Envelope, EIP2930Compatible { + public let type: TransactionType = .eip2930 // common parameters for any transaction @@ -221,7 +222,7 @@ extension EIP2930Envelope { } } -public struct AccessListEntry: CustomStringConvertible, Codable { +public struct AccessListEntry: CustomStringConvertible, Codable, Sendable { var address: EthereumAddress var storageKeys: [BigUInt] diff --git a/Sources/Web3Core/Transaction/TransactionMetadata.swift b/Sources/Web3Core/Transaction/TransactionMetadata.swift index df95a84d7..0bf930c1e 100644 --- a/Sources/Web3Core/Transaction/TransactionMetadata.swift +++ b/Sources/Web3Core/Transaction/TransactionMetadata.swift @@ -11,7 +11,7 @@ import BigInt /// returned by nodes when reading a transaction /// from the blockchain. The data here is not /// part of the transaction itself -public struct TransactionMetadata { +public struct TransactionMetadata: Sendable { /// hash for the block that contains this transaction on chain public var blockHash: Data? diff --git a/Sources/web3swift/Tokens/ERC20/ERC20BasePropertiesProvider.swift b/Sources/web3swift/Tokens/ERC20/ERC20BasePropertiesProvider.swift index e786e1517..af906ed2f 100644 --- a/Sources/web3swift/Tokens/ERC20/ERC20BasePropertiesProvider.swift +++ b/Sources/web3swift/Tokens/ERC20/ERC20BasePropertiesProvider.swift @@ -15,7 +15,7 @@ public final class ERC20BasePropertiesProvider { var decimals: UInt8? private let contract: Web3.Contract - private (set) var hasReadProperties: Bool = false + private(set) var hasReadProperties: Bool = false init(contract: Web3.Contract) { self.contract = contract } diff --git a/Tests/web3swiftTests/localTests/EventloopTests.swift b/Tests/web3swiftTests/localTests/EventloopTests.swift index 2e8b0df25..318414bb6 100755 --- a/Tests/web3swiftTests/localTests/EventloopTests.swift +++ b/Tests/web3swiftTests/localTests/EventloopTests.swift @@ -15,7 +15,7 @@ class EventloopTests: XCTestCase { let expectation = self.expectation(description: "Waiting") func getBlockNumber(_ web3: Web3) async { do { - let blockNumber = try await web3.eth.blockNumber() + _ = try await web3.eth.blockNumber() ticksToWait = ticksToWait - 1 if ticksToWait == 0 { expectation.fulfill()