Skip to content

Commit

Permalink
style(swift): run swift format
Browse files Browse the repository at this point in the history
  • Loading branch information
mehcode committed Jun 17, 2022
1 parent 640b0cd commit 1ae6dd9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
14 changes: 6 additions & 8 deletions sdk/swift/Sources/Hedera/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ public class Client {
/// Gets the account that is, by default, paying for transactions and queries built with
/// this client.
public var payerAccountId: AccountId? {
get {
var shard: UInt64 = 0
var realm: UInt64 = 0
var num: UInt64 = 0
var shard: UInt64 = 0
var realm: UInt64 = 0
var num: UInt64 = 0

hedera_client_get_payer_account_id(ptr, &shard, &realm, &num)
hedera_client_get_payer_account_id(ptr, &shard, &realm, &num)

return AccountId(shard: shard, realm: realm, num: num)
}
return AccountId(shard: shard, realm: realm, num: num)
}

/// Sets the account that will, by default, be paying for transactions and queries built with
/// this client.
public func setPayerAccountId(_ payerAccountId: AccountId) {
hedera_client_set_payer_account_id(
ptr, payerAccountId.shard, payerAccountId.realm, payerAccountId.num)
ptr, payerAccountId.shard, payerAccountId.realm, payerAccountId.num)
}

/// Adds a signer that will, by default, sign for all transactions and queries built
Expand Down
8 changes: 4 additions & 4 deletions sdk/swift/Sources/Hedera/Request.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import Foundation

/// A transaction or query that can be executed on the Hedera network.
public protocol Request: Encodable {
associatedtype Response: Decodable;
associatedtype Response: Decodable

func execute(_ client: Client) async throws -> Response;
func execute(_ client: Client) async throws -> Response
}

public extension Request {
extension Request {
/// Execute this request against the provided client of the Hedera network.
func execute(_ client: Client) async throws -> Response {
public func execute(_ client: Client) async throws -> Response {
// encode self as a JSON request to pass to Rust
let requestBytes = try JSONEncoder().encode(self)
let request = String(data: requestBytes, encoding: .utf8)!
Expand Down
2 changes: 2 additions & 0 deletions sdk/swift/Sources/Hedera/TokenMintTransaction.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

/// Mint tokens to the token's treasury account.
public class TokenMintTransaction: Transaction {
/// Create a new `TokenMintTransaction`.
Expand Down
2 changes: 1 addition & 1 deletion sdk/swift/Sources/Hedera/TokenPauseTransaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
public class TokenPauseTransaction: Transaction {
/// Create a new `TokenPauseTransaction`.
public init(
tokenId: TokenId? = nil
tokenId: TokenId? = nil
) {
self.tokenId = tokenId
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/swift/Sources/Hedera/TokenUnpauseTransaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
public class TokenUnpauseTransaction: Transaction {
/// Create a new `TokenUnpauseTransaction`.
public init(
tokenId: TokenId? = nil
tokenId: TokenId? = nil
) {
self.tokenId = tokenId
}
Expand Down

0 comments on commit 1ae6dd9

Please sign in to comment.