Skip to content

Commit

Permalink
Revert formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgardo committed Feb 5, 2024
1 parent 0df69bb commit 0abc011
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Sources/ConcordiumSwiftSdk/Model/Chain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ public struct CryptographicParameters {

static func fromGrpcType(_ grpc: Concordium_V2_CryptographicParameters) -> CryptographicParameters {
CryptographicParameters(
onChainCommitmentKey: grpc.onChainCommitmentKey.hexadecimalString(),
bulletproofGenerators: grpc.bulletproofGenerators.hexadecimalString(),
genesisString: grpc.genesisString
onChainCommitmentKey: grpc.onChainCommitmentKey.hexadecimalString(),
bulletproofGenerators: grpc.bulletproofGenerators.hexadecimalString(),
genesisString: grpc.genesisString
)
}
}
36 changes: 18 additions & 18 deletions examples/GrpcCli/Sources/GrpcCli/GrpcCli.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ struct GrpcCli: AsyncParsableCommand {
var options: GrpcOptions

static var configuration = CommandConfiguration(
abstract: "A CLI for demonstrating and testing use of the gRPC client of the SDK.",
version: "1.0.0",
subcommands: [CryptographicParameters.self, Account.self]
abstract: "A CLI for demonstrating and testing use of the gRPC client of the SDK.",
version: "1.0.0",
subcommands: [CryptographicParameters.self, Account.self]
)

struct CryptographicParameters: AsyncParsableCommand {
static var configuration = CommandConfiguration(
abstract: "Display the cryptographic parameters of the chain."
abstract: "Display the cryptographic parameters of the chain."
)

@OptionGroup
Expand All @@ -71,7 +71,7 @@ struct GrpcCli: AsyncParsableCommand {
func run() async throws {
let res = try await withClient(target: root.options.target) {
try await $0.getCryptographicParameters(
at: block.block
at: block.block
)
}
print(res)
Expand All @@ -80,16 +80,16 @@ struct GrpcCli: AsyncParsableCommand {

struct Account: AsyncParsableCommand {
static var configuration = CommandConfiguration(
abstract: "Subcommands related to a particular account.",
subcommands: [NextSequenceNumber.self, Info.self]
abstract: "Subcommands related to a particular account.",
subcommands: [NextSequenceNumber.self, Info.self]
)

@OptionGroup
var account: AccountOption

struct NextSequenceNumber: AsyncParsableCommand {
static var configuration = CommandConfiguration(
abstract: "Display the next sequence number of the provided account."
abstract: "Display the next sequence number of the provided account."
)

@OptionGroup
Expand All @@ -101,7 +101,7 @@ struct GrpcCli: AsyncParsableCommand {
func run() async throws {
let res = try await withClient(target: root.options.target) {
try await $0.getNextAccountSequenceNumber(
of: account.account.address
of: account.account.address
)
}
print(res)
Expand All @@ -110,7 +110,7 @@ struct GrpcCli: AsyncParsableCommand {

struct Info: AsyncParsableCommand {
static var configuration = CommandConfiguration(
abstract: "Display info of the provided account."
abstract: "Display info of the provided account."
)

@OptionGroup
Expand All @@ -125,8 +125,8 @@ struct GrpcCli: AsyncParsableCommand {
func run() async throws {
let res = try await withClient(target: root.options.target) {
try await $0.getAccountInfo(
of: account.account.identifier,
at: block.block
of: account.account.identifier,
at: block.block
)
}
print(res)
Expand All @@ -135,7 +135,7 @@ struct GrpcCli: AsyncParsableCommand {

struct Transer: AsyncParsableCommand {
static var configuration = CommandConfiguration(
abstract: "Transfer amount between accounts."
abstract: "Transfer amount between accounts."
)

@OptionGroup
Expand All @@ -153,10 +153,10 @@ struct GrpcCli: AsyncParsableCommand {
func run() async throws {
let res = try await withClient(target: root.options.target) {
let sequenceNumber = try await $0.getNextAccountSequenceNumber(
of: sender.account.address
of: sender.account.address
)
try await $0.sendSimpleTransfer(from: sender.account.address, to: receiver.account.address, microCcdAmount: amount, sequenceNumber: SequenceNumber, privateKey: Curve25519.Signing.PrivateKey.getNextAccountSequenceNumber(
of: sender.account.address
of: sender.account.address
))
}
print(res)
Expand All @@ -171,9 +171,9 @@ func withClient<T>(target: ConnectionTarget, _ cmd: (ConcordiumNodeClient) async
try! group.syncShutdownGracefully()
}
let channel = try GRPCChannelPool.with(
target: target,
transportSecurity: .plaintext,
eventLoopGroup: group
target: target,
transportSecurity: .plaintext,
eventLoopGroup: group
)
defer {
try! channel.close().wait()
Expand Down

0 comments on commit 0abc011

Please sign in to comment.