Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable Piratechain on iOS #5458

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ PODS:
- React-Core
- react-native-performance (5.1.2):
- React-Core
- react-native-piratechain (0.5.6):
- gRPC-Swift (~> 1.8)
- MnemonicSwift (~> 2.2)
- React-Core
- SQLite.swift/standalone (~> 0.14)
- react-native-safari-view (1.0.0):
- React
- react-native-safe-area-context (4.10.1):
Expand Down Expand Up @@ -790,6 +795,7 @@ DEPENDENCIES:
- react-native-mymonero-core (from `../node_modules/react-native-mymonero-core`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
- react-native-performance (from `../node_modules/react-native-performance`)
- react-native-piratechain (from `../node_modules/react-native-piratechain`)
- react-native-safari-view (from `../node_modules/react-native-safari-view`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-webview (from `../node_modules/react-native-webview`)
Expand Down Expand Up @@ -977,6 +983,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/netinfo"
react-native-performance:
:path: "../node_modules/react-native-performance"
react-native-piratechain:
:path: "../node_modules/react-native-piratechain"
react-native-safari-view:
:path: "../node_modules/react-native-safari-view"
react-native-safe-area-context:
Expand Down Expand Up @@ -1138,6 +1146,7 @@ SPEC CHECKSUMS:
react-native-mymonero-core: 780bf854f27a0a905bcef5e7757d2de0a15b4408
react-native-netinfo: 5b664b2945a8f02102b296f0f812bddd6827ed9c
react-native-performance: ff93f8af3b2ee9519fd7879896aa9b8b8272691d
react-native-piratechain: 08671056e2362f6a96cae1e2315c4adc9de7370a
react-native-safari-view: 955d7160d159241b8e9395d12d10ea0ef863dcdd
react-native-safe-area-context: dcab599c527c2d7de2d76507a523d20a0b83823d
react-native-webview: fa228e55c53372c2b361d2fa5e415844fa83eabf
Expand Down
151 changes: 151 additions & 0 deletions patches/react-native-piratechain+0.5.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
diff --git a/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/BlockDao.swift b/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/BlockDao.swift
index 2a8b988..300e43a 100644
--- a/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/BlockDao.swift
+++ b/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/BlockDao.swift
@@ -24,10 +24,10 @@ struct Block: Codable {
}

enum TableStructure {
- static let height = Expression<Int>(Block.CodingKeys.height.rawValue)
- static let hash = Expression<Blob>(Block.CodingKeys.hash.rawValue)
- static let time = Expression<Int>(Block.CodingKeys.time.rawValue)
- static let saplingTree = Expression<Blob>(Block.CodingKeys.saplingTree.rawValue)
+ static let height = SQLite.Expression<Int>(Block.CodingKeys.height.rawValue)
+ static let hash = SQLite.Expression<Blob>(Block.CodingKeys.hash.rawValue)
+ static let time = SQLite.Expression<Int>(Block.CodingKeys.time.rawValue)
+ static let saplingTree = SQLite.Expression<Blob>(Block.CodingKeys.saplingTree.rawValue)
}

let height: BlockHeight
@@ -41,7 +41,7 @@ struct Block: Codable {
class BlockSQLDAO: BlockDao {
let dbProvider: ConnectionProvider
let table: Table
- let height = Expression<Int>("height")
+ let height = SQLite.Expression<Int>("height")

init(dbProvider: ConnectionProvider) {
self.dbProvider = dbProvider
diff --git a/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/TransactionDao.swift b/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/TransactionDao.swift
index a0a261d..4862204 100644
--- a/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/TransactionDao.swift
+++ b/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/TransactionDao.swift
@@ -10,8 +10,8 @@ import SQLite

class TransactionSQLDAO: TransactionRepository {
enum NotesTableStructure {
- static let transactionID = Expression<Int>("tx")
- static let memo = Expression<Blob>("memo")
+ static let transactionID = SQLite.Expression<Int>("tx")
+ static let memo = SQLite.Expression<Blob>("memo")
}

let dbProvider: ConnectionProvider
diff --git a/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/UnspentTransactionOutputDao.swift b/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/UnspentTransactionOutputDao.swift
index 2ba6e46..2224006 100644
--- a/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/UnspentTransactionOutputDao.swift
+++ b/node_modules/react-native-piratechain/ios/PirateLightClientKit/DAO/UnspentTransactionOutputDao.swift
@@ -69,14 +69,14 @@ extension UnspentTransactionOutputEntity {
import SQLite
class UnspentTransactionOutputSQLDAO: UnspentTransactionOutputRepository {
enum TableColumns {
- static let id = Expression<Int>("id_utxo")
- static let address = Expression<String>("address")
- static let txid = Expression<Blob>("prevout_txid")
- static let index = Expression<Int>("prevout_idx")
- static let script = Expression<Blob>("script")
- static let valueZat = Expression<Int>("value_zat")
- static let height = Expression<Int>("height")
- static let spentInTx = Expression<Int?>("spent_in_tx")
+ static let id = SQLite.Expression<Int>("id_utxo")
+ static let address = SQLite.Expression<String>("address")
+ static let txid = SQLite.Expression<Blob>("prevout_txid")
+ static let index = SQLite.Expression<Int>("prevout_idx")
+ static let script = SQLite.Expression<Blob>("script")
+ static let valueZat = SQLite.Expression<Int>("value_zat")
+ static let height = SQLite.Expression<Int>("height")
+ static let spentInTx = SQLite.Expression<Int?>("spent_in_tx")
}

let table = Table("utxos")
diff --git a/node_modules/react-native-piratechain/ios/PirateLightClientKit/Entity/AccountEntity.swift b/node_modules/react-native-piratechain/ios/PirateLightClientKit/Entity/AccountEntity.swift
index 2f89777..5d4c82a 100644
--- a/node_modules/react-native-piratechain/ios/PirateLightClientKit/Entity/AccountEntity.swift
+++ b/node_modules/react-native-piratechain/ios/PirateLightClientKit/Entity/AccountEntity.swift
@@ -47,8 +47,8 @@ protocol AccountRepository {

class AccountSQDAO: AccountRepository {
enum TableColums {
- static let account = Expression<Int>("account")
- static let extfvk = Expression<String>("ufvk")
+ static let account = SQLite.Expression<Int>("account")
+ static let extfvk = SQLite.Expression<String>("ufvk")
}

let table = Table("accounts")
diff --git a/node_modules/react-native-piratechain/ios/PirateLightClientKit/Entity/TransactionEntity.swift b/node_modules/react-native-piratechain/ios/PirateLightClientKit/Entity/TransactionEntity.swift
index 544ae5f..2734b61 100644
--- a/node_modules/react-native-piratechain/ios/PirateLightClientKit/Entity/TransactionEntity.swift
+++ b/node_modules/react-native-piratechain/ios/PirateLightClientKit/Entity/TransactionEntity.swift
@@ -99,15 +99,15 @@ public enum ZcashTransaction {

extension ZcashTransaction.Output {
enum Column {
- static let idTx = Expression<Int>("id_tx")
- static let pool = Expression<Int>("output_pool")
- static let index = Expression<Int>("output_index")
- static let toAccount = Expression<Int?>("to_account")
- static let fromAccount = Expression<Int?>("from_account")
- static let toAddress = Expression<String?>("to_address")
- static let value = Expression<Int64>("value")
- static let isChange = Expression<Bool>("is_change")
- static let memo = Expression<Blob?>("memo")
+ static let idTx = SQLite.Expression<Int>("id_tx")
+ static let pool = SQLite.Expression<Int>("output_pool")
+ static let index = SQLite.Expression<Int>("output_index")
+ static let toAccount = SQLite.Expression<Int?>("to_account")
+ static let fromAccount = SQLite.Expression<Int?>("from_account")
+ static let toAddress = SQLite.Expression<String?>("to_address")
+ static let value = SQLite.Expression<Int64>("value")
+ static let isChange = SQLite.Expression<Bool>("is_change")
+ static let memo = SQLite.Expression<Blob?>("memo")
}

init(row: Row) throws {
@@ -143,21 +143,21 @@ extension ZcashTransaction.Output {

extension ZcashTransaction.Overview {
enum Column {
- static let accountId = Expression<Int>("account_id")
- static let id = Expression<Int>("id_tx")
- static let minedHeight = Expression<BlockHeight?>("mined_height")
- static let index = Expression<Int?>("tx_index")
- static let rawID = Expression<Blob>("txid")
- static let expiryHeight = Expression<BlockHeight?>("expiry_height")
- static let raw = Expression<Blob?>("raw")
- static let value = Expression<Int64>("account_balance_delta")
- static let fee = Expression<Int64?>("fee_paid")
- static let hasChange = Expression<Bool>("has_change")
- static let sentNoteCount = Expression<Int>("sent_note_count")
- static let receivedNoteCount = Expression<Int>("received_note_count")
- static let memoCount = Expression<Int>("memo_count")
- static let blockTime = Expression<Int64?>("block_time")
- static let expiredUnmined = Expression<Bool>("expired_unmined")
+ static let accountId = SQLite.Expression<Int>("account_id")
+ static let id = SQLite.Expression<Int>("id_tx")
+ static let minedHeight = SQLite.Expression<BlockHeight?>("mined_height")
+ static let index = SQLite.Expression<Int?>("tx_index")
+ static let rawID = SQLite.Expression<Blob>("txid")
+ static let expiryHeight = SQLite.Expression<BlockHeight?>("expiry_height")
+ static let raw = SQLite.Expression<Blob?>("raw")
+ static let value = SQLite.Expression<Int64>("account_balance_delta")
+ static let fee = SQLite.Expression<Int64?>("fee_paid")
+ static let hasChange = SQLite.Expression<Bool>("has_change")
+ static let sentNoteCount = SQLite.Expression<Int>("sent_note_count")
+ static let receivedNoteCount = SQLite.Expression<Int>("received_note_count")
+ static let memoCount = SQLite.Expression<Int>("memo_count")
+ static let blockTime = SQLite.Expression<Int64?>("block_time")
+ static let expiredUnmined = SQLite.Expression<Bool>("expired_unmined")
}

init(row: Row) throws {
5 changes: 0 additions & 5 deletions react-native.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
module.exports = {
dependencies: {
'react-native-piratechain': {
platforms: {
ios: null
}
},
'react-native-custom-tabs': {
platforms: {
ios: null
Expand Down
2 changes: 1 addition & 1 deletion src/constants/WalletAndCurrencyConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ export const SPECIAL_CURRENCY_INFO: {
dummyPublicAddress: 'zs1ps48sm9yusglfd2y28e7uhfkxfljy38papy00lzdmcdmctczx2hmvchcfjvp3n68zr2tu732y8k',
noChangeMiningFee: true,
isImportKeySupported: true,
keysOnlyMode: Platform.OS === 'android' ? Platform.constants.Version < 28 : Platform.OS === 'ios',
keysOnlyMode: Platform.OS === 'android' && Platform.constants.Version < 28,
importKeyOptions: [
{
optionName: 'birthdayHeight',
Expand Down
Loading