Skip to content

Commit

Permalink
fix: resolve errors 0.49.0-alpha.3
Browse files Browse the repository at this point in the history
Signed-off-by: Ricky Saechao <[email protected]>
  • Loading branch information
RickyLB committed Apr 11, 2024
1 parent f37ca41 commit ae59ee6
Show file tree
Hide file tree
Showing 28 changed files with 345 additions and 213 deletions.
2 changes: 1 addition & 1 deletion Sources/Hedera/Execute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private func executeAnyInner<E: Execute>(
?? .generateFrom(ctx.operatorAccountId!)
continue inner

case .UNRECOGNIZED(let value):
case .unrecognized(let value):
throw HError(
kind: .responseStatusUnrecognized,
description: "response status \(value) unrecognized"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Hedera/FeeSchedule/FeeDataType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extension FeeDataType: TryProtobufCodable {
case .tokenFungibleCommonWithCustomFees: self = .tokenFungibleCommonWithCustomFees
case .tokenNonFungibleUniqueWithCustomFees: self = .tokenNonFungibleUniqueWithCustomFees
case .scheduleCreateContractCall: self = .scheduleCreateContractCall
case .UNRECOGNIZED(let code):
case .unrecognized(let code):
throw HError.fromProtobuf("unrecognized FeeDataType `\(code)`")
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Hedera/FeeSchedule/RequestType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public enum RequestType {
case .transactionGetFastRecord: self = .tokenUpdateNfts

case .tokenUpdateNfts: self = .tokenUpdateNfts
case .UNRECOGNIZED(let code):
case .unrecognized(let code):
throw HError.fromProtobuf("unrecognized RequestType: `\(code)`")
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Hedera/FreezeType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extension FreezeType: TryProtobufCodable {
case .freezeUpgrade: self = .freezeUpgrade
case .freezeAbort: self = .freezeAbort
case .telemetryUpgrade: self = .telemetryUpgrade
case .UNRECOGNIZED(let value): throw HError.fromProtobuf("unrecognized FreezeType: `\(value)`")
case .unrecognized(let value): throw HError.fromProtobuf("unrecognized FreezeType: `\(value)`")
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Hedera/Status+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ extension Status: LosslessStringConvertible, CustomStringConvertible, Expressibl
}

public var description: String {
Self.nameMap[rawValue] ?? "UNRECOGNIZED \(rawValue)"
Self.nameMap[rawValue] ?? "unrecognized \(rawValue)"
}
}
8 changes: 4 additions & 4 deletions Sources/Hedera/Status.swift
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ public enum Status: Equatable {
case missingSerialNumbers // = 336

/// swift-format-ignore: AlwaysUseLowerCamelCase
case UNRECOGNIZED(Int32)
case unrecognized(Int32)

// minimal edit from protoc generated: (changed from `init?`)
// swiftlint:disable:next function_body_length
Expand Down Expand Up @@ -1249,7 +1249,7 @@ public enum Status: Equatable {
case 334: self = .tokenHasNoMetadataKey
case 335: self = .missingTokenMetadata
case 336: self = .missingSerialNumbers
default: self = .UNRECOGNIZED(rawValue)
default: self = .unrecognized(rawValue)
}
}

Expand Down Expand Up @@ -1550,14 +1550,14 @@ public enum Status: Equatable {
case .tokenHasNoMetadataKey: return 334
case .missingTokenMetadata: return 335
case .missingSerialNumbers: return 336
case .UNRECOGNIZED(let i): return i
case .unrecognized(let i): return i
}
}

}

extension Status: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
// The compiler won't synthesize support with the unrecognized case.
public static let allCases: [Status] = [
.ok,
.invalidTransaction,
Expand Down
6 changes: 3 additions & 3 deletions Sources/Hedera/Token/TokenInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ extension TokenInfo: TryProtobufCodable {
defaultFreezeStatus = true
case .unfrozen:
defaultFreezeStatus = false
case .UNRECOGNIZED(let value):
case .unrecognized(let value):
throw HError.fromProtobuf("Unrecognized defaultFreezeStatus: `\(value)`")
}

Expand All @@ -157,7 +157,7 @@ extension TokenInfo: TryProtobufCodable {
defaultKycStatus = true
case .revoked:
defaultKycStatus = false
case .UNRECOGNIZED(let value):
case .unrecognized(let value):
throw HError.fromProtobuf("Unrecognized defaultKycStatus: `\(value)`")
}

Expand All @@ -175,7 +175,7 @@ extension TokenInfo: TryProtobufCodable {
pauseStatus = true
case .unpaused:
pauseStatus = false
case .UNRECOGNIZED(let value):
case .unrecognized(let value):
throw HError.fromProtobuf("Unrecognized pauseStatus: `\(value)`")
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Hedera/Token/TokenSupplyType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extension TokenSupplyType: TryProtobufCodable {
self = .infinite
case .finite:
self = .finite
case .UNRECOGNIZED(let value):
case .unrecognized(let value):
throw HError.fromProtobuf("unrecognized TokenSupplyType: `\(value)`")
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Hedera/Token/TokenType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extension TokenType: TryProtobufCodable {
switch proto {
case .fungibleCommon: self = .fungibleCommon
case .nonFungibleUnique: self = .nonFungibleUnique
case .UNRECOGNIZED(let value):
case .unrecognized(let value):
throw HError.fromProtobuf("unrecognized token type \(value)")
}
}
Expand Down
56 changes: 28 additions & 28 deletions Sources/HederaProtobufs/Services/basic_types.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum Proto_TokenType: SwiftProtobuf.Enum {
/// Unique, not interchangeable with other tokens of the same type as they typically have
/// different values. Individually traced and can carry unique properties (e.g. serial number).
case nonFungibleUnique // = 1
case UNRECOGNIZED(Int)
case unrecognized(Int)

public init() {
self = .fungibleCommon
Expand All @@ -49,15 +49,15 @@ public enum Proto_TokenType: SwiftProtobuf.Enum {
switch rawValue {
case 0: self = .fungibleCommon
case 1: self = .nonFungibleUnique
default: self = .UNRECOGNIZED(rawValue)
default: self = .unrecognized(rawValue)
}
}

public var rawValue: Int {
switch self {
case .fungibleCommon: return 0
case .nonFungibleUnique: return 1
case .UNRECOGNIZED(let i): return i
case .unrecognized(let i): return i
}
}

Expand All @@ -66,7 +66,7 @@ public enum Proto_TokenType: SwiftProtobuf.Enum {
#if swift(>=4.2)

extension Proto_TokenType: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
// The compiler won't synthesize support with the unrecognized case.
public static let allCases: [Proto_TokenType] = [
.fungibleCommon,
.nonFungibleUnique,
Expand Down Expand Up @@ -113,7 +113,7 @@ public enum Proto_SubType: SwiftProtobuf.Enum {
///*
/// The resource prices are scoped to a ScheduleCreate containing a ContractCall.
case scheduleCreateContractCall // = 5
case UNRECOGNIZED(Int)
case unrecognized(Int)

public init() {
self = .default
Expand All @@ -127,7 +127,7 @@ public enum Proto_SubType: SwiftProtobuf.Enum {
case 3: self = .tokenFungibleCommonWithCustomFees
case 4: self = .tokenNonFungibleUniqueWithCustomFees
case 5: self = .scheduleCreateContractCall
default: self = .UNRECOGNIZED(rawValue)
default: self = .unrecognized(rawValue)
}
}

Expand All @@ -139,7 +139,7 @@ public enum Proto_SubType: SwiftProtobuf.Enum {
case .tokenFungibleCommonWithCustomFees: return 3
case .tokenNonFungibleUniqueWithCustomFees: return 4
case .scheduleCreateContractCall: return 5
case .UNRECOGNIZED(let i): return i
case .unrecognized(let i): return i
}
}

Expand All @@ -148,7 +148,7 @@ public enum Proto_SubType: SwiftProtobuf.Enum {
#if swift(>=4.2)

extension Proto_SubType: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
// The compiler won't synthesize support with the unrecognized case.
public static let allCases: [Proto_SubType] = [
.default,
.tokenFungibleCommon,
Expand All @@ -175,7 +175,7 @@ public enum Proto_TokenSupplyType: SwiftProtobuf.Enum {
/// Indicates that tokens of that type have an upper bound of maxSupply,
/// provided on token creation.
case finite // = 1
case UNRECOGNIZED(Int)
case unrecognized(Int)

public init() {
self = .infinite
Expand All @@ -185,15 +185,15 @@ public enum Proto_TokenSupplyType: SwiftProtobuf.Enum {
switch rawValue {
case 0: self = .infinite
case 1: self = .finite
default: self = .UNRECOGNIZED(rawValue)
default: self = .unrecognized(rawValue)
}
}

public var rawValue: Int {
switch self {
case .infinite: return 0
case .finite: return 1
case .UNRECOGNIZED(let i): return i
case .unrecognized(let i): return i
}
}

Expand All @@ -202,7 +202,7 @@ public enum Proto_TokenSupplyType: SwiftProtobuf.Enum {
#if swift(>=4.2)

extension Proto_TokenSupplyType: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
// The compiler won't synthesize support with the unrecognized case.
public static let allCases: [Proto_TokenSupplyType] = [
.infinite,
.finite,
Expand All @@ -228,7 +228,7 @@ public enum Proto_TokenFreezeStatus: SwiftProtobuf.Enum {
///*
/// UNDOCUMENTED
case unfrozen // = 2
case UNRECOGNIZED(Int)
case unrecognized(Int)

public init() {
self = .freezeNotApplicable
Expand All @@ -239,7 +239,7 @@ public enum Proto_TokenFreezeStatus: SwiftProtobuf.Enum {
case 0: self = .freezeNotApplicable
case 1: self = .frozen
case 2: self = .unfrozen
default: self = .UNRECOGNIZED(rawValue)
default: self = .unrecognized(rawValue)
}
}

Expand All @@ -248,7 +248,7 @@ public enum Proto_TokenFreezeStatus: SwiftProtobuf.Enum {
case .freezeNotApplicable: return 0
case .frozen: return 1
case .unfrozen: return 2
case .UNRECOGNIZED(let i): return i
case .unrecognized(let i): return i
}
}

Expand All @@ -257,7 +257,7 @@ public enum Proto_TokenFreezeStatus: SwiftProtobuf.Enum {
#if swift(>=4.2)

extension Proto_TokenFreezeStatus: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
// The compiler won't synthesize support with the unrecognized case.
public static let allCases: [Proto_TokenFreezeStatus] = [
.freezeNotApplicable,
.frozen,
Expand All @@ -283,7 +283,7 @@ public enum Proto_TokenKycStatus: SwiftProtobuf.Enum {
///*
/// UNDOCUMENTED
case revoked // = 2
case UNRECOGNIZED(Int)
case unrecognized(Int)

public init() {
self = .kycNotApplicable
Expand All @@ -294,7 +294,7 @@ public enum Proto_TokenKycStatus: SwiftProtobuf.Enum {
case 0: self = .kycNotApplicable
case 1: self = .granted
case 2: self = .revoked
default: self = .UNRECOGNIZED(rawValue)
default: self = .unrecognized(rawValue)
}
}

Expand All @@ -303,7 +303,7 @@ public enum Proto_TokenKycStatus: SwiftProtobuf.Enum {
case .kycNotApplicable: return 0
case .granted: return 1
case .revoked: return 2
case .UNRECOGNIZED(let i): return i
case .unrecognized(let i): return i
}
}

Expand All @@ -312,7 +312,7 @@ public enum Proto_TokenKycStatus: SwiftProtobuf.Enum {
#if swift(>=4.2)

extension Proto_TokenKycStatus: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
// The compiler won't synthesize support with the unrecognized case.
public static let allCases: [Proto_TokenKycStatus] = [
.kycNotApplicable,
.granted,
Expand All @@ -338,7 +338,7 @@ public enum Proto_TokenPauseStatus: SwiftProtobuf.Enum {
///*
/// Indicates that a Token is Unpaused.
case unpaused // = 2
case UNRECOGNIZED(Int)
case unrecognized(Int)

public init() {
self = .pauseNotApplicable
Expand All @@ -349,7 +349,7 @@ public enum Proto_TokenPauseStatus: SwiftProtobuf.Enum {
case 0: self = .pauseNotApplicable
case 1: self = .paused
case 2: self = .unpaused
default: self = .UNRECOGNIZED(rawValue)
default: self = .unrecognized(rawValue)
}
}

Expand All @@ -358,7 +358,7 @@ public enum Proto_TokenPauseStatus: SwiftProtobuf.Enum {
case .pauseNotApplicable: return 0
case .paused: return 1
case .unpaused: return 2
case .UNRECOGNIZED(let i): return i
case .unrecognized(let i): return i
}
}

Expand All @@ -367,7 +367,7 @@ public enum Proto_TokenPauseStatus: SwiftProtobuf.Enum {
#if swift(>=4.2)

extension Proto_TokenPauseStatus: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
// The compiler won't synthesize support with the unrecognized case.
public static let allCases: [Proto_TokenPauseStatus] = [
.pauseNotApplicable,
.paused,
Expand Down Expand Up @@ -680,7 +680,7 @@ public enum Proto_HederaFunctionality: SwiftProtobuf.Enum {
///*
/// Update the metadata of one or more NFT's of a specific token type.
case tokenUpdateNfts // = 88
case UNRECOGNIZED(Int)
case unrecognized(Int)

public init() {
self = .none
Expand Down Expand Up @@ -763,7 +763,7 @@ public enum Proto_HederaFunctionality: SwiftProtobuf.Enum {
case 86: self = .utilPrng
case 87: self = .transactionGetFastRecord
case 88: self = .tokenUpdateNfts
default: self = .UNRECOGNIZED(rawValue)
default: self = .unrecognized(rawValue)
}
}

Expand Down Expand Up @@ -844,7 +844,7 @@ public enum Proto_HederaFunctionality: SwiftProtobuf.Enum {
case .utilPrng: return 86
case .transactionGetFastRecord: return 87
case .tokenUpdateNfts: return 88
case .UNRECOGNIZED(let i): return i
case .unrecognized(let i): return i
}
}

Expand All @@ -853,7 +853,7 @@ public enum Proto_HederaFunctionality: SwiftProtobuf.Enum {
#if swift(>=4.2)

extension Proto_HederaFunctionality: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
// The compiler won't synthesize support with the unrecognized case.
public static let allCases: [Proto_HederaFunctionality] = [
.none,
.cryptoTransfer,
Expand Down
Loading

0 comments on commit ae59ee6

Please sign in to comment.