Skip to content
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

2.1.6 #175

Merged
merged 3 commits into from
Apr 26, 2019
Merged

2.1.6 #175

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
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# Change Log

## [Unreleased](https://github.com/matter-labs/web3swift/tree/HEAD)
## [2.1.5](https://github.com/matter-labs/web3swift/tree/2.1.5) (2019-04-24)
[Full Changelog](https://github.com/matter-labs/web3swift/compare/2.1.4...2.1.5)

[Full Changelog](https://github.com/matter-labs/web3swift/compare/2.1.3...HEAD)
**Merged pull requests:**

- 2.1.4 [\#170](https://github.com/matter-labs/web3swift/pull/170) ([BaldyAsh](https://github.com/BaldyAsh))

## [2.1.4](https://github.com/matter-labs/web3swift/tree/2.1.4) (2019-04-24)
[Full Changelog](https://github.com/matter-labs/web3swift/compare/2.1.3...2.1.4)

**Fixed bugs:**

- Cannot load module 'Web3swift' as 'web3swift [\#133](https://github.com/matter-labs/web3swift/issues/133)

**Closed issues:**

- How to convert 21000 BigUInt estimated gas price into Wei ? [\#163](https://github.com/matter-labs/web3swift/issues/163)
- ENS Permanent Registrar Support [\#159](https://github.com/matter-labs/web3swift/issues/159)
- web3swift 2.1.3 [\#154](https://github.com/matter-labs/web3swift/issues/154)
- Sending ETH always results in zero value [\#149](https://github.com/matter-labs/web3swift/issues/149)
- WebSockets subscriptions [\#145](https://github.com/matter-labs/web3swift/issues/145)
Expand All @@ -18,6 +26,10 @@

**Merged pull requests:**

- Fix travis [\#169](https://github.com/matter-labs/web3swift/pull/169) ([BaldyAsh](https://github.com/BaldyAsh))
- Fix warnings [\#168](https://github.com/matter-labs/web3swift/pull/168) ([BaldyAsh](https://github.com/BaldyAsh))
- Added reverse registrar [\#165](https://github.com/matter-labs/web3swift/pull/165) ([BaldyAsh](https://github.com/BaldyAsh))
- WIP: ENS BaseRegistrar and RegistrarController support [\#162](https://github.com/matter-labs/web3swift/pull/162) ([BaldyAsh](https://github.com/BaldyAsh))
- Updated example to 2.1.3 [\#158](https://github.com/matter-labs/web3swift/pull/158) ([BaldyAsh](https://github.com/BaldyAsh))
- Documentation update [\#153](https://github.com/matter-labs/web3swift/pull/153) ([BaldyAsh](https://github.com/BaldyAsh))

Expand Down
4 changes: 2 additions & 2 deletions web3swift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "web3swift"
s.version = "2.1.4"
s.version = "2.1.6"
s.summary = "Web3 implementation in vanilla Swift for iOS ans macOS"

s.description = <<-DESC
Expand All @@ -17,7 +17,7 @@ s.swift_version = '5.0'
s.module_name = 'Web3swift'
s.ios.deployment_target = "9.0"
s.osx.deployment_target = "10.11"
s.source_files = "web3swift/{Promises,Web3,Contract,KeystoreManager,Transaction,Convenience,HookedFunctions,SwiftRLP,EthereumAddress,EthereumABI}/*.{h,swift}", "web3swift/Utils/**/*.swift" "web3swift/PrecompiledContracts/**/*.swift", "web3swift/web3swift.h"
s.source_files = "web3swift/{Promises,Web3,Contract,KeystoreManager,Transaction,Convenience,HookedFunctions,SwiftRLP,EthereumAddress,EthereumABI}/*.{h,swift}", "web3swift/Utils/{ENS,EIP,Hooks}/*.swift" "web3swift/PrecompiledContracts/**/*.swift", "web3swift/web3swift.h"
s.public_header_files = "web3swift/web3swift.h"
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }

Expand Down
30 changes: 15 additions & 15 deletions web3swift/Utils/ENS/ENS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,67 @@ import BigInt

public class ENS {

let web3: web3
var registry: Registry
var resolver: Resolver? = nil
var baseRegistrar: BaseRegistrar? = nil
var registrarController: ETHRegistrarController? = nil
var reverseRegistrar: ReverseRegistrar? = nil
public let web3: web3
public var registry: Registry
public var resolver: Resolver? = nil
public var baseRegistrar: BaseRegistrar? = nil
public var registrarController: ETHRegistrarController? = nil
public var reverseRegistrar: ReverseRegistrar? = nil

init?(web3: web3) {
public init?(web3: web3) {
self.web3 = web3
guard let registry = Registry(web3: web3) else {
return nil
}
self.registry = registry
}

func setENSResolver(_ resolver: Resolver) throws {
public func setENSResolver(_ resolver: Resolver) throws {
guard resolver.web3.provider.url == self.web3.provider.url else {
throw Web3Error.processingError(desc: "Resolver should use same provider as ENS")
}
self.resolver = resolver
}

func setENSResolver(withDomain domain: String) throws {
public func setENSResolver(withDomain domain: String) throws {
guard let resolver = try? self.registry.getResolver(forDomain: domain) else {
throw Web3Error.processingError(desc: "No resolver for this domain")
}
self.resolver = resolver
}

func setBaseRegistrar(_ baseRegistrar: BaseRegistrar) throws {
public func setBaseRegistrar(_ baseRegistrar: BaseRegistrar) throws {
guard baseRegistrar.web3.provider.url == self.web3.provider.url else {
throw Web3Error.processingError(desc: "Base registrar should use same provider as ENS")
}
self.baseRegistrar = baseRegistrar
}

func setBaseRegistrar(withAddress address: EthereumAddress) {
public func setBaseRegistrar(withAddress address: EthereumAddress) {
let baseRegistrar = BaseRegistrar(web3: web3, address: address)
self.baseRegistrar = baseRegistrar
}

func setRegistrarController(_ registrarController: ETHRegistrarController) throws {
public func setRegistrarController(_ registrarController: ETHRegistrarController) throws {
guard registrarController.web3.provider.url == self.web3.provider.url else {
throw Web3Error.processingError(desc: "Registrar controller should use same provider as ENS")
}
self.registrarController = registrarController
}

func setRegistrarController(withAddress address: EthereumAddress) {
public func setRegistrarController(withAddress address: EthereumAddress) {
let registrarController = ETHRegistrarController(web3: web3, address: address)
self.registrarController = registrarController
}

func setReverseRegistrar(_ reverseRegistrar: ReverseRegistrar) throws {
public func setReverseRegistrar(_ reverseRegistrar: ReverseRegistrar) throws {
guard reverseRegistrar.web3.provider.url == self.web3.provider.url else {
throw Web3Error.processingError(desc: "Registrar controller should use same provider as ENS")
}
self.reverseRegistrar = reverseRegistrar
}

func setReverseRegistrar(withAddress address: EthereumAddress) {
public func setReverseRegistrar(withAddress address: EthereumAddress) {
let reverseRegistrar = ReverseRegistrar(web3: web3, address: address)
self.reverseRegistrar = reverseRegistrar
}
Expand Down
6 changes: 3 additions & 3 deletions web3swift/Utils/ENS/ENSRegistry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import BigInt

public extension ENS {
class Registry {
let web3: web3
let registryContractAddress: EthereumAddress?
public let web3: web3
public let registryContractAddress: EthereumAddress?

init?(web3: web3) {
public init?(web3: web3) {
self.web3 = web3
switch web3.provider.network {
case .Mainnet?:
Expand Down
6 changes: 3 additions & 3 deletions web3swift/Utils/ENS/ENSResolver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import BigInt

public extension ENS {
class Resolver {
let web3: web3
let resolverContractAddress: EthereumAddress
public let web3: web3
public let resolverContractAddress: EthereumAddress

public enum ContentType: BigUInt {
case JSON = 1
Expand Down Expand Up @@ -56,7 +56,7 @@ public extension ENS {
return TransactionOptions.defaultOptions
}()

init(web3: web3, resolverContractAddress: EthereumAddress) {
public init(web3: web3, resolverContractAddress: EthereumAddress) {
self.web3 = web3
self.resolverContractAddress = resolverContractAddress
}
Expand Down
6 changes: 3 additions & 3 deletions web3swift/Utils/ENS/ENSReverseRegistrar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import BigInt

public extension ENS {
class ReverseRegistrar {
let web3: web3
let address: EthereumAddress
public let web3: web3
public let address: EthereumAddress

lazy var contract: web3.web3contract = {
let contract = self.web3.contract(Web3.Utils.reverseRegistrarABI, at: self.address, abiVersion: 2)
Expand All @@ -25,7 +25,7 @@ public extension ENS {
return TransactionOptions.defaultOptions
}()

init(web3: web3, address: EthereumAddress) {
public init(web3: web3, address: EthereumAddress) {
self.web3 = web3
self.address = address
}
Expand Down
6 changes: 3 additions & 3 deletions web3swift/Utils/ENS/ETHRegistrarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import BigInt

public extension ENS {
class ETHRegistrarController {
let web3: web3
let address: EthereumAddress
public let web3: web3
public let address: EthereumAddress

lazy var contract: web3.web3contract = {
let contract = self.web3.contract(Web3.Utils.ethRegistrarControllerABI, at: self.address, abiVersion: 2)
Expand All @@ -25,7 +25,7 @@ public extension ENS {
return TransactionOptions.defaultOptions
}()

init(web3: web3, address: EthereumAddress) {
public init(web3: web3, address: EthereumAddress) {
self.web3 = web3
self.address = address
}
Expand Down