Skip to content

Commit

Permalink
Explicitly add public memberwise initializer for Address, ARUnit, and…
Browse files Browse the repository at this point in the history
… Tag
  • Loading branch information
lukereichold committed Sep 24, 2020
1 parent 6defb59 commit 2cc72a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 9 additions & 2 deletions Sources/Transaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ public typealias TransactionId = String
public typealias Base64EncodedString = String

public extension Transaction {

struct PriceRequest {
var bytes: Int = 0
var target: Address?
}

struct Tag: Codable {
let name: String
let value: String
public let name: String
public let value: String

public init(name: String, value: String) {
self.name = name
self.value = value
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions Sources/Wallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public struct Wallet {
public struct Address: Equatable, CustomStringConvertible {
public let address: String
public var description: String { address }

public init(address: String) {
self.address = address
}
}

extension Address {
Expand All @@ -71,8 +75,8 @@ extension Address {
public typealias Amount = Measurement<ARUnit>

public final class ARUnit: Dimension {
static let AR = ARUnit(symbol: "AR", converter: UnitConverterLinear(coefficient: 1e12))
static let winston = ARUnit(symbol: "winston", converter: UnitConverterLinear(coefficient: 1.0))
public static let AR = ARUnit(symbol: "AR", converter: UnitConverterLinear(coefficient: 1e12))
public static let winston = ARUnit(symbol: "winston", converter: UnitConverterLinear(coefficient: 1.0))

override public class func baseUnit() -> Self {
return winston as! Self
Expand Down

0 comments on commit 2cc72a1

Please sign in to comment.