From 7847a7195e8eec925a56689baf98a2f02826d6d1 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 19 Oct 2022 14:58:51 -0600 Subject: [PATCH] Fix incorrect encoding of optional strings in PendingTransaction. --- Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift b/Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift index 0783a50b..9b92fa4d 100644 --- a/Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift +++ b/Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift @@ -152,7 +152,7 @@ struct PendingTransaction: PendingTransactionEntity, Decodable, Encodable { accountId = Int(acct) } - try container.encode(toAddress, forKey: .toAddress) + try container.encodeIfPresent(toAddress, forKey: .toAddress) try container.encodeIfPresent(accountId, forKey: .toInternalAccount) try container.encode(self.accountIndex, forKey: .accountIndex) try container.encode(self.minedHeight, forKey: .minedHeight)