Skip to content

Commit 6869702

Browse files
chore: simplified func encode(forSignature: Bool = false, chainID: BigUInt? = nil) to be a one-line function
1 parent c786c30 commit 6869702

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/Core/Transaction/EthereumTransaction.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,7 @@ extension EthereumTransaction {
399399

400400
@available(*, deprecated, message: "use encode() instead")
401401
public func encode(forSignature: Bool = false, chainID: BigUInt? = nil) -> Data? {
402-
if forSignature == true { return self.envelope.encode(for: .signature) }
403-
return self.envelope.encode(for: .transaction)
402+
envelope.encode(for: forSignature ? .signature : .transaction)
404403
}
405404

406405
@available(*, deprecated, message: "use Decodable instead")

0 commit comments

Comments
 (0)