@bsv/wallet-toolbox 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/client.md +499 -900
- package/docs/monitor.md +29 -69
- package/docs/services.md +22 -40
- package/docs/setup.md +23 -65
- package/docs/storage.md +2163 -489
- package/docs/wallet.md +499 -900
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts +4 -4
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +2 -2
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts +2 -2
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.js +2 -2
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
- package/out/src/sdk/StorageSyncReader.d.ts +30 -30
- package/out/src/sdk/StorageSyncReader.d.ts.map +1 -1
- package/out/src/sdk/StorageSyncReaderWriter.d.ts +60 -60
- package/out/src/sdk/StorageSyncReaderWriter.d.ts.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts +36 -36
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts +61 -61
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +2 -2
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts +16 -15
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +8 -8
- package/out/src/storage/StorageProvider.js.map +1 -1
- package/out/src/storage/StorageReader.d.ts +21 -21
- package/out/src/storage/StorageReader.d.ts.map +1 -1
- package/out/src/storage/StorageReader.js.map +1 -1
- package/out/src/storage/StorageReaderWriter.d.ts +60 -60
- package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- package/out/src/storage/StorageSyncReader.d.ts +17 -17
- package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
- package/out/src/storage/StorageSyncReader.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts +9 -9
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +2 -2
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/index.all.d.ts +2 -2
- package/out/src/storage/index.all.d.ts.map +1 -1
- package/out/src/storage/index.all.js +3 -3
- package/out/src/storage/index.all.js.map +1 -1
- package/out/src/storage/index.client.d.ts +2 -2
- package/out/src/storage/index.client.d.ts.map +1 -1
- package/out/src/storage/index.client.js +2 -25
- package/out/src/storage/index.client.js.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts +3 -3
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js.map +1 -1
- package/out/src/storage/methods/createAction.d.ts.map +1 -1
- package/out/src/storage/methods/createAction.js +1 -1
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js +2 -2
- package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
- package/out/src/storage/methods/getSyncChunk.d.ts.map +1 -1
- package/out/src/storage/methods/getSyncChunk.js.map +1 -1
- package/out/src/storage/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/storage/methods/internalizeAction.js +1 -1
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listActions.js.map +1 -1
- package/out/src/storage/methods/listCertificates.d.ts.map +1 -1
- package/out/src/storage/methods/listCertificates.js.map +1 -1
- package/out/src/storage/methods/listOutputs.js.map +1 -1
- package/out/src/storage/methods/processAction.d.ts +4 -4
- package/out/src/storage/methods/processAction.d.ts.map +1 -1
- package/out/src/storage/methods/processAction.js +2 -2
- package/out/src/storage/methods/processAction.js.map +1 -1
- package/out/src/storage/methods/purgeData.d.ts.map +1 -1
- package/out/src/storage/methods/purgeData.js +4 -2
- package/out/src/storage/methods/purgeData.js.map +1 -1
- package/out/src/storage/methods/reviewStatus.js +1 -1
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/remoting/StorageClient.d.ts +11 -11
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClient.js.map +1 -1
- package/out/src/storage/schema/entities/Certificate.d.ts +9 -9
- package/out/src/storage/schema/entities/Certificate.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Certificate.js +5 -5
- package/out/src/storage/schema/entities/Certificate.js.map +1 -1
- package/out/src/storage/schema/entities/CertificateField.d.ts +9 -9
- package/out/src/storage/schema/entities/CertificateField.d.ts.map +1 -1
- package/out/src/storage/schema/entities/CertificateField.js +5 -5
- package/out/src/storage/schema/entities/CertificateField.js.map +1 -1
- package/out/src/storage/schema/entities/Commission.d.ts +9 -9
- package/out/src/storage/schema/entities/Commission.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Commission.js +5 -5
- package/out/src/storage/schema/entities/Commission.js.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.d.ts +1 -1
- package/out/src/storage/schema/entities/MergeEntity.d.ts +6 -7
- package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -1
- package/out/src/storage/schema/entities/Output.d.ts +9 -9
- package/out/src/storage/schema/entities/Output.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Output.js +5 -5
- package/out/src/storage/schema/entities/Output.js.map +1 -1
- package/out/src/storage/schema/entities/OutputBasket.d.ts +9 -9
- package/out/src/storage/schema/entities/OutputBasket.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputBasket.js +5 -5
- package/out/src/storage/schema/entities/OutputBasket.js.map +1 -1
- package/out/src/storage/schema/entities/OutputTag.d.ts +9 -9
- package/out/src/storage/schema/entities/OutputTag.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputTag.js +5 -5
- package/out/src/storage/schema/entities/OutputTag.js.map +1 -1
- package/out/src/storage/schema/entities/OutputTagMap.d.ts +9 -9
- package/out/src/storage/schema/entities/OutputTagMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputTagMap.js +5 -5
- package/out/src/storage/schema/entities/OutputTagMap.js.map +1 -1
- package/out/src/storage/schema/entities/ProvenTx.d.ts +11 -11
- package/out/src/storage/schema/entities/ProvenTx.d.ts.map +1 -1
- package/out/src/storage/schema/entities/ProvenTx.js +11 -11
- package/out/src/storage/schema/entities/ProvenTx.js.map +1 -1
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts +19 -19
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts.map +1 -1
- package/out/src/storage/schema/entities/ProvenTxReq.js +13 -13
- package/out/src/storage/schema/entities/ProvenTxReq.js.map +1 -1
- package/out/src/storage/schema/entities/SyncState.d.ts +11 -11
- package/out/src/storage/schema/entities/SyncState.d.ts.map +1 -1
- package/out/src/storage/schema/entities/SyncState.js +27 -27
- package/out/src/storage/schema/entities/SyncState.js.map +1 -1
- package/out/src/storage/schema/entities/Transaction.d.ts +11 -11
- package/out/src/storage/schema/entities/Transaction.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Transaction.js +6 -6
- package/out/src/storage/schema/entities/Transaction.js.map +1 -1
- package/out/src/storage/schema/entities/TxLabel.d.ts +9 -9
- package/out/src/storage/schema/entities/TxLabel.d.ts.map +1 -1
- package/out/src/storage/schema/entities/TxLabel.js +5 -5
- package/out/src/storage/schema/entities/TxLabel.js.map +1 -1
- package/out/src/storage/schema/entities/TxLabelMap.d.ts +9 -9
- package/out/src/storage/schema/entities/TxLabelMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/TxLabelMap.js +5 -5
- package/out/src/storage/schema/entities/TxLabelMap.js.map +1 -1
- package/out/src/storage/schema/entities/User.d.ts +9 -9
- package/out/src/storage/schema/entities/User.d.ts.map +1 -1
- package/out/src/storage/schema/entities/User.js +5 -5
- package/out/src/storage/schema/entities/User.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js +20 -307
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js +17 -158
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js +23 -309
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js +19 -306
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js +19 -306
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js +23 -237
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js +20 -233
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js +27 -98
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +25 -241
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js +38 -112
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js +39 -323
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js +31 -169
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js +16 -159
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/usersTests.test.js +21 -168
- package/out/src/storage/schema/entities/__tests/usersTests.test.js.map +1 -1
- package/out/src/storage/schema/tables/Certificate.d.ts +4 -4
- package/out/src/storage/schema/tables/Certificate.d.ts.map +1 -1
- package/out/src/storage/schema/tables/CertificateField.d.ts +1 -1
- package/out/src/storage/schema/tables/CertificateField.d.ts.map +1 -1
- package/out/src/storage/schema/tables/Commission.d.ts +1 -1
- package/out/src/storage/schema/tables/Commission.d.ts.map +1 -1
- package/out/src/storage/schema/tables/MonitorEvent.d.ts +1 -1
- package/out/src/storage/schema/tables/MonitorEvent.d.ts.map +1 -1
- package/out/src/storage/schema/tables/Output.d.ts +5 -5
- package/out/src/storage/schema/tables/Output.d.ts.map +1 -1
- package/out/src/storage/schema/tables/OutputBasket.d.ts +1 -1
- package/out/src/storage/schema/tables/OutputBasket.d.ts.map +1 -1
- package/out/src/storage/schema/tables/OutputTag.d.ts +1 -1
- package/out/src/storage/schema/tables/OutputTag.d.ts.map +1 -1
- package/out/src/storage/schema/tables/OutputTagMap.d.ts +1 -1
- package/out/src/storage/schema/tables/OutputTagMap.d.ts.map +1 -1
- package/out/src/storage/schema/tables/ProvenTx.d.ts +1 -1
- package/out/src/storage/schema/tables/ProvenTx.d.ts.map +1 -1
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts +2 -2
- package/out/src/storage/schema/tables/ProvenTxReq.d.ts.map +1 -1
- package/out/src/storage/schema/tables/SyncState.d.ts +1 -1
- package/out/src/storage/schema/tables/SyncState.d.ts.map +1 -1
- package/out/src/storage/schema/tables/{Settings.d.ts → TableSettings.d.ts} +2 -2
- package/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -0
- package/out/src/storage/schema/tables/{Settings.js → TableSettings.js} +1 -1
- package/out/src/storage/schema/tables/TableSettings.js.map +1 -0
- package/out/src/storage/schema/tables/Transaction.d.ts +1 -1
- package/out/src/storage/schema/tables/Transaction.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TxLabel.d.ts +1 -1
- package/out/src/storage/schema/tables/TxLabel.d.ts.map +1 -1
- package/out/src/storage/schema/tables/TxLabelMap.d.ts +1 -1
- package/out/src/storage/schema/tables/TxLabelMap.d.ts.map +1 -1
- package/out/src/storage/schema/tables/User.d.ts +1 -1
- package/out/src/storage/schema/tables/User.d.ts.map +1 -1
- package/out/src/storage/schema/tables/index.d.ts +1 -1
- package/out/src/storage/schema/tables/index.d.ts.map +1 -1
- package/out/src/storage/schema/tables/index.js +1 -1
- package/out/src/storage/schema/tables/index.js.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts +17 -17
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.js +2 -2
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
- package/out/test/Wallet/certificate/listCertificates.test.js.map +1 -1
- package/out/test/Wallet/live/walletLive.man.test.d.ts.map +1 -1
- package/out/test/Wallet/live/walletLive.man.test.js +35 -1
- package/out/test/Wallet/live/walletLive.man.test.js.map +1 -1
- package/out/test/monitor/Monitor.test.js +7 -7
- package/out/test/monitor/Monitor.test.js.map +1 -1
- package/out/test/storage/StorageMySQLDojoReader.man.test.js +1 -1
- package/out/test/storage/StorageMySQLDojoReader.man.test.js.map +1 -1
- package/out/test/storage/insert.test.js.map +1 -1
- package/out/test/storage/update.test.js.map +1 -1
- package/out/test/storage/update2.test.js.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts +56 -56
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.js +11 -4
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/monitor/tasks/TaskCheckForProofs.ts +11 -10
- package/src/monitor/tasks/TaskSendWaiting.ts +5 -5
- package/src/sdk/StorageSyncReader.ts +47 -30
- package/src/sdk/StorageSyncReaderWriter.ts +77 -63
- package/src/sdk/WalletStorage.interfaces.ts +55 -36
- package/src/signer/methods/acquireDirectCertificate.ts +2 -2
- package/src/storage/StorageKnex.ts +124 -104
- package/src/storage/StorageProvider.ts +43 -30
- package/src/storage/StorageReader.ts +36 -21
- package/src/storage/StorageReaderWriter.ts +78 -65
- package/src/storage/StorageSyncReader.ts +34 -17
- package/src/storage/WalletStorageManager.ts +17 -12
- package/src/storage/index.all.ts +2 -2
- package/src/storage/index.client.ts +2 -2
- package/src/storage/methods/attemptToPostReqsToNetwork.ts +3 -3
- package/src/storage/methods/createAction.ts +29 -26
- package/src/storage/methods/getBeefForTransaction.ts +3 -3
- package/src/storage/methods/getSyncChunk.ts +28 -13
- package/src/storage/methods/internalizeAction.ts +19 -17
- package/src/storage/methods/listActions.ts +5 -5
- package/src/storage/methods/listCertificates.ts +2 -2
- package/src/storage/methods/listOutputs.ts +5 -5
- package/src/storage/methods/processAction.ts +21 -17
- package/src/storage/methods/purgeData.ts +20 -12
- package/src/storage/methods/reviewStatus.ts +5 -5
- package/src/storage/remoting/StorageClient.ts +28 -18
- package/src/storage/schema/entities/Certificate.ts +16 -17
- package/src/storage/schema/entities/CertificateField.ts +17 -18
- package/src/storage/schema/entities/Commission.ts +16 -20
- package/src/storage/schema/entities/EntityBase.ts +1 -1
- package/src/storage/schema/entities/MergeEntity.ts +7 -7
- package/src/storage/schema/entities/Output.ts +16 -20
- package/src/storage/schema/entities/OutputBasket.ts +16 -17
- package/src/storage/schema/entities/OutputTag.ts +16 -20
- package/src/storage/schema/entities/OutputTagMap.ts +17 -18
- package/src/storage/schema/entities/ProvenTx.ts +24 -28
- package/src/storage/schema/entities/ProvenTxReq.ts +42 -45
- package/src/storage/schema/entities/SyncState.ts +61 -38
- package/src/storage/schema/entities/Transaction.ts +23 -23
- package/src/storage/schema/entities/TxLabel.ts +16 -17
- package/src/storage/schema/entities/TxLabelMap.ts +16 -20
- package/src/storage/schema/entities/User.ts +15 -19
- package/src/storage/schema/entities/__tests/CertificateFieldTests.test.ts +39 -318
- package/src/storage/schema/entities/__tests/CertificateTests.test.ts +29 -169
- package/src/storage/schema/entities/__tests/CommissionTests.test.ts +47 -325
- package/src/storage/schema/entities/__tests/OutputBasketTests.test.ts +35 -316
- package/src/storage/schema/entities/__tests/OutputTagMapTests.test.ts +38 -318
- package/src/storage/schema/entities/__tests/OutputTagTests.test.ts +36 -249
- package/src/storage/schema/entities/__tests/OutputTests.test.ts +30 -244
- package/src/storage/schema/entities/__tests/ProvenTxReqTests.test.ts +35 -101
- package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +27 -243
- package/src/storage/schema/entities/__tests/SyncStateTests.test.ts +54 -122
- package/src/storage/schema/entities/__tests/TransactionTests.test.ts +53 -333
- package/src/storage/schema/entities/__tests/TxLabelMapTests.test.ts +44 -177
- package/src/storage/schema/entities/__tests/TxLabelTests.test.ts +19 -163
- package/src/storage/schema/entities/__tests/usersTests.test.ts +31 -179
- package/src/storage/schema/tables/Certificate.ts +4 -4
- package/src/storage/schema/tables/CertificateField.ts +1 -1
- package/src/storage/schema/tables/Commission.ts +1 -1
- package/src/storage/schema/tables/MonitorEvent.ts +1 -1
- package/src/storage/schema/tables/Output.ts +5 -5
- package/src/storage/schema/tables/OutputBasket.ts +1 -1
- package/src/storage/schema/tables/OutputTag.ts +1 -1
- package/src/storage/schema/tables/OutputTagMap.ts +1 -1
- package/src/storage/schema/tables/ProvenTx.ts +1 -1
- package/src/storage/schema/tables/ProvenTxReq.ts +2 -2
- package/src/storage/schema/tables/SyncState.ts +1 -1
- package/src/storage/schema/tables/{Settings.ts → TableSettings.ts} +3 -1
- package/src/storage/schema/tables/Transaction.ts +1 -1
- package/src/storage/schema/tables/TxLabel.ts +1 -1
- package/src/storage/schema/tables/TxLabelMap.ts +1 -1
- package/src/storage/schema/tables/User.ts +1 -1
- package/src/storage/schema/tables/index.ts +1 -1
- package/src/storage/sync/StorageMySQLDojoReader.ts +67 -50
- package/test/Wallet/certificate/listCertificates.test.ts +12 -8
- package/test/Wallet/live/walletLive.man.test.ts +46 -6
- package/test/monitor/Monitor.test.ts +8 -8
- package/test/storage/StorageMySQLDojoReader.man.test.ts +1 -1
- package/test/storage/insert.test.ts +2 -2
- package/test/storage/update.test.ts +30 -30
- package/test/storage/update2.test.ts +23 -24
- package/test/utils/TestUtilsWalletStorage.ts +103 -82
- package/test/wallet/action/createActionToGenerateBeefs.man.test.ts +1 -2
- package/ts2md.json +12 -6
- package/out/src/storage/index.db.d.ts +0 -1
- package/out/src/storage/index.db.d.ts.map +0 -1
- package/out/src/storage/index.db.js +0 -2
- package/out/src/storage/index.db.js.map +0 -1
- package/out/src/storage/schema/tables/Settings.d.ts.map +0 -1
- package/out/src/storage/schema/tables/Settings.js.map +0 -1
- package/src/storage/index.db.ts +0 -0
|
@@ -12,7 +12,26 @@ import {
|
|
|
12
12
|
verifyOptionalHexString,
|
|
13
13
|
verifyTruthy
|
|
14
14
|
} from '../../index.all'
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
outputColumnsWithoutLockingScript,
|
|
17
|
+
TableCertificate,
|
|
18
|
+
TableCertificateField,
|
|
19
|
+
TableCommission,
|
|
20
|
+
TableMonitorEvent,
|
|
21
|
+
TableOutput,
|
|
22
|
+
TableOutputBasket,
|
|
23
|
+
TableOutputTag,
|
|
24
|
+
TableOutputTagMap,
|
|
25
|
+
TableProvenTx,
|
|
26
|
+
TableProvenTxReq,
|
|
27
|
+
TableSettings,
|
|
28
|
+
TableSyncState,
|
|
29
|
+
TableTransaction,
|
|
30
|
+
TableTxLabel,
|
|
31
|
+
TableTxLabelMap,
|
|
32
|
+
TableUser,
|
|
33
|
+
transactionColumnsWithoutRawTx
|
|
34
|
+
} from '../index.all'
|
|
16
35
|
|
|
17
36
|
import { Knex } from 'knex'
|
|
18
37
|
import { isHexString } from '../../sdk'
|
|
@@ -59,9 +78,9 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
59
78
|
return db
|
|
60
79
|
}
|
|
61
80
|
|
|
62
|
-
override async readSettings(trx?: sdk.TrxToken): Promise<
|
|
81
|
+
override async readSettings(trx?: sdk.TrxToken): Promise<TableSettings> {
|
|
63
82
|
const d = verifyOne(await this.toDb(trx)('settings'))
|
|
64
|
-
const r:
|
|
83
|
+
const r: TableSettings = {
|
|
65
84
|
created_at: verifyTruthy(d.created_at),
|
|
66
85
|
updated_at: verifyTruthy(d.updated_at),
|
|
67
86
|
storageIdentityKey: verifyHexString(d.dojoIdentityKey),
|
|
@@ -100,12 +119,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
100
119
|
}
|
|
101
120
|
async findOutputBaskets(
|
|
102
121
|
args: sdk.FindOutputBasketsArgs
|
|
103
|
-
): Promise<
|
|
122
|
+
): Promise<TableOutputBasket[]> {
|
|
104
123
|
const q = this.findOutputBasketsQuery(args)
|
|
105
124
|
const ds = await q
|
|
106
|
-
const rs:
|
|
125
|
+
const rs: TableOutputBasket[] = []
|
|
107
126
|
for (const d of ds) {
|
|
108
|
-
const r:
|
|
127
|
+
const r: TableOutputBasket = {
|
|
109
128
|
created_at: verifyTruthy(d.created_at),
|
|
110
129
|
updated_at: verifyTruthy(d.updated_at),
|
|
111
130
|
basketId: verifyInteger(d.basketId),
|
|
@@ -122,12 +141,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
122
141
|
findTxLabelsQuery(args: sdk.FindTxLabelsArgs): Knex.QueryBuilder {
|
|
123
142
|
return this.setupQuery('tx_labels', args)
|
|
124
143
|
}
|
|
125
|
-
async findTxLabels(args: sdk.FindTxLabelsArgs): Promise<
|
|
144
|
+
async findTxLabels(args: sdk.FindTxLabelsArgs): Promise<TableTxLabel[]> {
|
|
126
145
|
const q = this.findTxLabelsQuery(args)
|
|
127
146
|
const ds = await q
|
|
128
|
-
const rs:
|
|
147
|
+
const rs: TableTxLabel[] = []
|
|
129
148
|
for (const d of ds) {
|
|
130
|
-
const r:
|
|
149
|
+
const r: TableTxLabel = {
|
|
131
150
|
created_at: verifyTruthy(d.created_at),
|
|
132
151
|
updated_at: verifyTruthy(d.updated_at),
|
|
133
152
|
txLabelId: verifyInteger(d.txLabelId),
|
|
@@ -144,12 +163,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
144
163
|
}
|
|
145
164
|
async findOutputTags(
|
|
146
165
|
args: sdk.FindOutputTagsArgs
|
|
147
|
-
): Promise<
|
|
166
|
+
): Promise<TableOutputTag[]> {
|
|
148
167
|
const q = this.findOutputTagsQuery(args)
|
|
149
168
|
const ds = await q
|
|
150
|
-
const rs:
|
|
169
|
+
const rs: TableOutputTag[] = []
|
|
151
170
|
for (const d of ds) {
|
|
152
|
-
const r:
|
|
171
|
+
const r: TableOutputTag = {
|
|
153
172
|
created_at: verifyTruthy(d.created_at),
|
|
154
173
|
updated_at: verifyTruthy(d.updated_at),
|
|
155
174
|
outputTagId: verifyInteger(d.outputTagId),
|
|
@@ -178,7 +197,7 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
178
197
|
const q = this.setupQuery('transactions', args)
|
|
179
198
|
if (args.status && args.status.length > 0) q.whereIn('status', args.status)
|
|
180
199
|
if (args.noRawTx && !count) {
|
|
181
|
-
const columns =
|
|
200
|
+
const columns = transactionColumnsWithoutRawTx.map(
|
|
182
201
|
c => `transactions.${c}`
|
|
183
202
|
)
|
|
184
203
|
q.select(columns)
|
|
@@ -187,12 +206,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
187
206
|
}
|
|
188
207
|
async findTransactions(
|
|
189
208
|
args: sdk.FindTransactionsArgs
|
|
190
|
-
): Promise<
|
|
209
|
+
): Promise<TableTransaction[]> {
|
|
191
210
|
const q = this.findTransactionsQuery(args)
|
|
192
211
|
const ds = await q
|
|
193
|
-
const rs:
|
|
212
|
+
const rs: TableTransaction[] = []
|
|
194
213
|
for (const d of ds) {
|
|
195
|
-
const r:
|
|
214
|
+
const r: TableTransaction = {
|
|
196
215
|
created_at: verifyTruthy(d.created_at),
|
|
197
216
|
updated_at: verifyTruthy(d.updated_at),
|
|
198
217
|
transactionId: verifyInteger(d.transactionId),
|
|
@@ -223,12 +242,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
223
242
|
}
|
|
224
243
|
async findCommissions(
|
|
225
244
|
args: sdk.FindCommissionsArgs
|
|
226
|
-
): Promise<
|
|
245
|
+
): Promise<TableCommission[]> {
|
|
227
246
|
const q = this.findCommissionsQuery(args)
|
|
228
247
|
const ds = await q
|
|
229
|
-
const rs:
|
|
248
|
+
const rs: TableCommission[] = []
|
|
230
249
|
for (const d of ds) {
|
|
231
|
-
const r:
|
|
250
|
+
const r: TableCommission = {
|
|
232
251
|
created_at: verifyTruthy(d.created_at),
|
|
233
252
|
updated_at: verifyTruthy(d.updated_at),
|
|
234
253
|
commissionId: verifyInteger(d.commissionId),
|
|
@@ -258,19 +277,17 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
258
277
|
)
|
|
259
278
|
const q = this.setupQuery('outputs', args)
|
|
260
279
|
if (args.noScript && !count) {
|
|
261
|
-
const columns =
|
|
262
|
-
c => `outputs.${c}`
|
|
263
|
-
)
|
|
280
|
+
const columns = outputColumnsWithoutLockingScript.map(c => `outputs.${c}`)
|
|
264
281
|
q.select(columns)
|
|
265
282
|
}
|
|
266
283
|
return q
|
|
267
284
|
}
|
|
268
|
-
async findOutputs(args: sdk.FindOutputsArgs): Promise<
|
|
285
|
+
async findOutputs(args: sdk.FindOutputsArgs): Promise<TableOutput[]> {
|
|
269
286
|
const q = this.findOutputsQuery(args)
|
|
270
287
|
const ds = await q
|
|
271
|
-
const rs:
|
|
288
|
+
const rs: TableOutput[] = []
|
|
272
289
|
for (const d of ds) {
|
|
273
|
-
const r:
|
|
290
|
+
const r: TableOutput = {
|
|
274
291
|
created_at: verifyTruthy(d.created_at),
|
|
275
292
|
updated_at: verifyTruthy(d.updated_at),
|
|
276
293
|
outputId: verifyInteger(d.outputId),
|
|
@@ -315,12 +332,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
315
332
|
}
|
|
316
333
|
async findCertificates(
|
|
317
334
|
args: sdk.FindCertificatesArgs
|
|
318
|
-
): Promise<
|
|
335
|
+
): Promise<TableCertificate[]> {
|
|
319
336
|
const q = this.findCertificatesQuery(args)
|
|
320
337
|
const ds = await q
|
|
321
|
-
const rs:
|
|
338
|
+
const rs: TableCertificate[] = []
|
|
322
339
|
for (const d of ds) {
|
|
323
|
-
const r:
|
|
340
|
+
const r: TableCertificate = {
|
|
324
341
|
created_at: verifyTruthy(d.created_at),
|
|
325
342
|
updated_at: verifyTruthy(d.updated_at),
|
|
326
343
|
certificateId: verifyInteger(d.certificateId),
|
|
@@ -347,12 +364,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
347
364
|
}
|
|
348
365
|
async findCertificateFields(
|
|
349
366
|
args: sdk.FindCertificateFieldsArgs
|
|
350
|
-
): Promise<
|
|
367
|
+
): Promise<TableCertificateField[]> {
|
|
351
368
|
const q = this.findCertificateFieldsQuery(args)
|
|
352
369
|
const ds = await q
|
|
353
|
-
const rs:
|
|
370
|
+
const rs: TableCertificateField[] = []
|
|
354
371
|
for (const d of ds) {
|
|
355
|
-
const r:
|
|
372
|
+
const r: TableCertificateField = {
|
|
356
373
|
created_at: verifyTruthy(d.created_at),
|
|
357
374
|
updated_at: verifyTruthy(d.updated_at),
|
|
358
375
|
userId: verifyInteger(d.userId),
|
|
@@ -367,12 +384,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
367
384
|
}
|
|
368
385
|
override async findSyncStates(
|
|
369
386
|
args: sdk.FindSyncStatesArgs
|
|
370
|
-
): Promise<
|
|
387
|
+
): Promise<TableSyncState[]> {
|
|
371
388
|
const q = this.setupQuery('sync_state', args)
|
|
372
389
|
const ds = await q
|
|
373
|
-
const rs:
|
|
390
|
+
const rs: TableSyncState[] = []
|
|
374
391
|
for (const d of ds) {
|
|
375
|
-
const r:
|
|
392
|
+
const r: TableSyncState = {
|
|
376
393
|
created_at: verifyTruthy(d.created_at),
|
|
377
394
|
updated_at: verifyTruthy(d.updated_at),
|
|
378
395
|
syncStateId: verifyInteger(d.syncStateId),
|
|
@@ -394,12 +411,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
394
411
|
}
|
|
395
412
|
return this.validateEntities(rs, undefined, ['init'])
|
|
396
413
|
}
|
|
397
|
-
override async findUsers(args: sdk.FindUsersArgs): Promise<
|
|
414
|
+
override async findUsers(args: sdk.FindUsersArgs): Promise<TableUser[]> {
|
|
398
415
|
const q = this.setupQuery('users', args)
|
|
399
416
|
const ds = await q
|
|
400
|
-
const rs:
|
|
417
|
+
const rs: TableUser[] = []
|
|
401
418
|
for (const d of ds) {
|
|
402
|
-
const r:
|
|
419
|
+
const r: TableUser = {
|
|
403
420
|
created_at: verifyTruthy(d.created_at),
|
|
404
421
|
updated_at: verifyTruthy(d.updated_at),
|
|
405
422
|
userId: verifyId(d.userId),
|
|
@@ -433,10 +450,10 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
433
450
|
}
|
|
434
451
|
async getProvenTxsForUser(
|
|
435
452
|
args: sdk.FindForUserSincePagedArgs
|
|
436
|
-
): Promise<
|
|
453
|
+
): Promise<TableProvenTx[]> {
|
|
437
454
|
const q = this.getProvenTxsForUserQuery(args)
|
|
438
455
|
const ds = await q
|
|
439
|
-
const rs:
|
|
456
|
+
const rs: TableProvenTx[] = []
|
|
440
457
|
for (const d of ds) {
|
|
441
458
|
const mp = convertProofToMerklePath(d.txid, {
|
|
442
459
|
index: d.index,
|
|
@@ -444,7 +461,7 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
444
461
|
height: d.height
|
|
445
462
|
})
|
|
446
463
|
|
|
447
|
-
const r:
|
|
464
|
+
const r: TableProvenTx = {
|
|
448
465
|
created_at: verifyTruthy(d.created_at),
|
|
449
466
|
updated_at: verifyTruthy(d.updated_at),
|
|
450
467
|
provenTxId: verifyInteger(d.provenTxId),
|
|
@@ -486,12 +503,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
486
503
|
|
|
487
504
|
async getProvenTxReqsForUser(
|
|
488
505
|
args: sdk.FindForUserSincePagedArgs
|
|
489
|
-
): Promise<
|
|
506
|
+
): Promise<TableProvenTxReq[]> {
|
|
490
507
|
const q = this.getProvenTxReqsForUserQuery(args)
|
|
491
508
|
const ds = await q
|
|
492
|
-
const rs:
|
|
509
|
+
const rs: TableProvenTxReq[] = []
|
|
493
510
|
for (const d of ds) {
|
|
494
|
-
const r:
|
|
511
|
+
const r: TableProvenTxReq = {
|
|
495
512
|
created_at: verifyTruthy(d.created_at),
|
|
496
513
|
updated_at: verifyTruthy(d.updated_at),
|
|
497
514
|
provenTxReqId: verifyInteger(d.provenTxReqId),
|
|
@@ -534,12 +551,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
534
551
|
|
|
535
552
|
async getTxLabelMapsForUser(
|
|
536
553
|
args: sdk.FindForUserSincePagedArgs
|
|
537
|
-
): Promise<
|
|
554
|
+
): Promise<TableTxLabelMap[]> {
|
|
538
555
|
const q = this.getTxLabelMapsForUserQuery(args)
|
|
539
556
|
const ds = await q
|
|
540
|
-
const rs:
|
|
557
|
+
const rs: TableTxLabelMap[] = []
|
|
541
558
|
for (const d of ds) {
|
|
542
|
-
const r:
|
|
559
|
+
const r: TableTxLabelMap = {
|
|
543
560
|
created_at: verifyTruthy(d.created_at),
|
|
544
561
|
updated_at: verifyTruthy(d.updated_at),
|
|
545
562
|
txLabelId: verifyInteger(d.txLabelId),
|
|
@@ -574,12 +591,12 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
574
591
|
|
|
575
592
|
async getOutputTagMapsForUser(
|
|
576
593
|
args: sdk.FindForUserSincePagedArgs
|
|
577
|
-
): Promise<
|
|
594
|
+
): Promise<TableOutputTagMap[]> {
|
|
578
595
|
const q = this.getOutputTagMapsForUserQuery(args)
|
|
579
596
|
const ds = await q
|
|
580
|
-
const rs:
|
|
597
|
+
const rs: TableOutputTagMap[] = []
|
|
581
598
|
for (const d of ds) {
|
|
582
|
-
const r:
|
|
599
|
+
const r: TableOutputTagMap = {
|
|
583
600
|
created_at: verifyTruthy(d.created_at),
|
|
584
601
|
updated_at: verifyTruthy(d.updated_at),
|
|
585
602
|
outputId: verifyInteger(d.outputId),
|
|
@@ -627,7 +644,7 @@ export class StorageMySQLDojoReader extends StorageReader {
|
|
|
627
644
|
}
|
|
628
645
|
override findMonitorEvents(
|
|
629
646
|
args: sdk.FindMonitorEventsArgs
|
|
630
|
-
): Promise<
|
|
647
|
+
): Promise<TableMonitorEvent[]> {
|
|
631
648
|
throw new Error('Method not implemented.')
|
|
632
649
|
}
|
|
633
650
|
override countMonitorEvents(
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { OriginatorDomainNameStringUnder250Bytes } from '@bsv/sdk'
|
|
2
2
|
import { listCertificates } from '../../../src/storage/methods/listCertificates'
|
|
3
3
|
import { StorageProvider } from '../../../src/storage/StorageProvider'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
sdk,
|
|
6
|
+
TableCertificate,
|
|
7
|
+
TableCertificateField
|
|
8
|
+
} from '../../../src/index.all'
|
|
5
9
|
import { TrxToken } from '../../../src/sdk'
|
|
6
10
|
|
|
7
11
|
jest.mock('../../../src/storage/StorageProvider')
|
|
@@ -78,7 +82,7 @@ describe('listCertificates', () => {
|
|
|
78
82
|
|
|
79
83
|
test('should return exactly the number of certificates if they are fewer than the limit', async () => {
|
|
80
84
|
// Suppose we have 2 certificates
|
|
81
|
-
const fakeCerts:
|
|
85
|
+
const fakeCerts: TableCertificate[] = [
|
|
82
86
|
{
|
|
83
87
|
certificateId: 1,
|
|
84
88
|
userId: 123,
|
|
@@ -110,7 +114,7 @@ describe('listCertificates', () => {
|
|
|
110
114
|
]
|
|
111
115
|
|
|
112
116
|
// Suppose each cert has some fields
|
|
113
|
-
const fakeFieldsForCert1:
|
|
117
|
+
const fakeFieldsForCert1: TableCertificateField[] = [
|
|
114
118
|
{
|
|
115
119
|
certificateId: 1,
|
|
116
120
|
userId: 123,
|
|
@@ -122,7 +126,7 @@ describe('listCertificates', () => {
|
|
|
122
126
|
}
|
|
123
127
|
]
|
|
124
128
|
|
|
125
|
-
const fakeFieldsForCert2:
|
|
129
|
+
const fakeFieldsForCert2: TableCertificateField[] = [
|
|
126
130
|
{
|
|
127
131
|
certificateId: 2,
|
|
128
132
|
userId: 123,
|
|
@@ -188,7 +192,7 @@ describe('listCertificates', () => {
|
|
|
188
192
|
test('should call countCertificates when the returned certificates length is equal to limit', async () => {
|
|
189
193
|
// We want exactly 'limit' items returned, so the function calls countCertificates
|
|
190
194
|
vargs.limit = 2 // set limit to 2
|
|
191
|
-
const fakeCerts:
|
|
195
|
+
const fakeCerts: TableCertificate[] = [
|
|
192
196
|
{
|
|
193
197
|
certificateId: 11,
|
|
194
198
|
userId: 123,
|
|
@@ -290,7 +294,7 @@ describe('listCertificates', () => {
|
|
|
290
294
|
// but let's confirm the coverage if the function doesn't rely on partial storage returning partial results.
|
|
291
295
|
vargs.limit = 2
|
|
292
296
|
|
|
293
|
-
const cA:
|
|
297
|
+
const cA: TableCertificate = {
|
|
294
298
|
certificateId: 100,
|
|
295
299
|
userId: 123,
|
|
296
300
|
type: 'zzz',
|
|
@@ -304,7 +308,7 @@ describe('listCertificates', () => {
|
|
|
304
308
|
created_at: new Date(),
|
|
305
309
|
updated_at: new Date()
|
|
306
310
|
}
|
|
307
|
-
const cB:
|
|
311
|
+
const cB: TableCertificate = {
|
|
308
312
|
certificateId: 101,
|
|
309
313
|
userId: 123,
|
|
310
314
|
type: 'yyy',
|
|
@@ -318,7 +322,7 @@ describe('listCertificates', () => {
|
|
|
318
322
|
created_at: new Date(),
|
|
319
323
|
updated_at: new Date()
|
|
320
324
|
}
|
|
321
|
-
const cC:
|
|
325
|
+
const cC: TableCertificate = {
|
|
322
326
|
certificateId: 102,
|
|
323
327
|
userId: 123,
|
|
324
328
|
type: 'xxx',
|
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
asString,
|
|
15
15
|
StorageKnex,
|
|
16
16
|
sdk,
|
|
17
|
-
table,
|
|
18
17
|
verifyOne,
|
|
19
18
|
verifyId,
|
|
20
19
|
ScriptTemplateSABPPP,
|
|
21
20
|
randomBytesBase64,
|
|
22
21
|
randomBytes,
|
|
23
|
-
|
|
22
|
+
EntityProvenTxReq,
|
|
23
|
+
TableOutput
|
|
24
24
|
} from '../../../src/index.all'
|
|
25
25
|
import {
|
|
26
26
|
_tu,
|
|
@@ -191,6 +191,46 @@ describe('walletLive test', () => {
|
|
|
191
191
|
`)
|
|
192
192
|
})
|
|
193
193
|
|
|
194
|
+
test('5z send a wallet payment from myCtx to second wallet', async () => {
|
|
195
|
+
const tauriRootKey =
|
|
196
|
+
'1363ef9b14531a52648e1e7e7f430a10ceda1df8d514a2a75d8404094f14a649'
|
|
197
|
+
const tauriIdentityKey = PrivateKey.fromHex(tauriRootKey)
|
|
198
|
+
.toPublicKey()
|
|
199
|
+
.toString()
|
|
200
|
+
|
|
201
|
+
const r = await createWalletPaymentAction({
|
|
202
|
+
toIdentityKey: tauriIdentityKey,
|
|
203
|
+
outputSatoshis: 1000 * 1000,
|
|
204
|
+
keyDeriver: myCtx.keyDeriver,
|
|
205
|
+
wallet: myCtx.wallet,
|
|
206
|
+
logResult: true
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
const toCtx = await _tu.createTestWalletWithStorageClient({
|
|
210
|
+
rootKeyHex: tauriRootKey,
|
|
211
|
+
chain: env.chain
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
const args: InternalizeActionArgs = {
|
|
215
|
+
tx: Utils.toArray(r.atomicBEEF, 'hex'),
|
|
216
|
+
outputs: [
|
|
217
|
+
{
|
|
218
|
+
outputIndex: r.vout,
|
|
219
|
+
protocol: 'wallet payment',
|
|
220
|
+
paymentRemittance: {
|
|
221
|
+
derivationPrefix: r.derivationPrefix,
|
|
222
|
+
derivationSuffix: r.derivationSuffix,
|
|
223
|
+
senderIdentityKey: r.senderIdentityKey
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
],
|
|
227
|
+
description: 'from tone wallet'
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const rw = await toCtx.wallet.internalizeAction(args)
|
|
231
|
+
expect(rw.accepted).toBe(true)
|
|
232
|
+
})
|
|
233
|
+
|
|
194
234
|
test('6 send a wallet payment from myCtx to second wallet', async () => {
|
|
195
235
|
const r = await createWalletPaymentAction({
|
|
196
236
|
toIdentityKey: myIdentityKey2,
|
|
@@ -224,7 +264,7 @@ describe('walletLive test', () => {
|
|
|
224
264
|
const beef = Beef.fromString(r.atomicBEEF)
|
|
225
265
|
const btx = beef.txs.slice(-1)[0]
|
|
226
266
|
const txid = btx.txid
|
|
227
|
-
const req = await
|
|
267
|
+
const req = await EntityProvenTxReq.fromStorageTxid(stagingStorage, txid)
|
|
228
268
|
expect(req?.notify.transactionIds?.length).toBe(2)
|
|
229
269
|
})
|
|
230
270
|
|
|
@@ -344,15 +384,15 @@ ${Utils.toHex(beef.toBinaryAtomic(txid))}
|
|
|
344
384
|
async function confirmSpendableOutputs(
|
|
345
385
|
storage: StorageKnex,
|
|
346
386
|
services: Services
|
|
347
|
-
): Promise<{ invalidSpendableOutputs:
|
|
348
|
-
const invalidSpendableOutputs:
|
|
387
|
+
): Promise<{ invalidSpendableOutputs: TableOutput[] }> {
|
|
388
|
+
const invalidSpendableOutputs: TableOutput[] = []
|
|
349
389
|
const users = await storage.findUsers({ partial: {} })
|
|
350
390
|
|
|
351
391
|
for (const { userId } of users) {
|
|
352
392
|
const defaultBasket = verifyOne(
|
|
353
393
|
await storage.findOutputBaskets({ partial: { userId, name: 'default' } })
|
|
354
394
|
)
|
|
355
|
-
const where: Partial<
|
|
395
|
+
const where: Partial<TableOutput> = {
|
|
356
396
|
userId,
|
|
357
397
|
basketId: defaultBasket.basketId,
|
|
358
398
|
spendable: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MerklePath } from '@bsv/sdk'
|
|
2
2
|
import {
|
|
3
3
|
asArray,
|
|
4
|
-
|
|
4
|
+
EntityProvenTxReq,
|
|
5
5
|
sdk,
|
|
6
6
|
verifyOne,
|
|
7
7
|
verifyTruthy,
|
|
@@ -165,7 +165,7 @@ describe('Monitor tests', () => {
|
|
|
165
165
|
(await storage.findProvenTxs({ partial: { txid } })).length
|
|
166
166
|
).toBe(0)
|
|
167
167
|
const req = verifyTruthy(
|
|
168
|
-
await
|
|
168
|
+
await EntityProvenTxReq.fromStorageTxid(storage, txid)
|
|
169
169
|
)
|
|
170
170
|
expect(req.status).toBe('unmined')
|
|
171
171
|
}
|
|
@@ -181,7 +181,7 @@ describe('Monitor tests', () => {
|
|
|
181
181
|
)
|
|
182
182
|
expect(proven.merklePath).toBeTruthy()
|
|
183
183
|
const req = verifyTruthy(
|
|
184
|
-
await
|
|
184
|
+
await EntityProvenTxReq.fromStorageTxid(storage, txid)
|
|
185
185
|
)
|
|
186
186
|
expect(req.status).toBe('completed')
|
|
187
187
|
expect(req.provenTxId).toBe(proven.provenTxId)
|
|
@@ -227,7 +227,7 @@ describe('Monitor tests', () => {
|
|
|
227
227
|
(await storage.findProvenTxs({ partial: { txid } })).length
|
|
228
228
|
).toBe(0)
|
|
229
229
|
const req = verifyTruthy(
|
|
230
|
-
await
|
|
230
|
+
await EntityProvenTxReq.fromStorageTxid(storage, txid)
|
|
231
231
|
)
|
|
232
232
|
expect(req.status).toBe('unmined')
|
|
233
233
|
attempts.push(req.attempts)
|
|
@@ -246,7 +246,7 @@ describe('Monitor tests', () => {
|
|
|
246
246
|
(await storage.findProvenTxs({ partial: { txid } })).length
|
|
247
247
|
).toBe(0)
|
|
248
248
|
const req = verifyTruthy(
|
|
249
|
-
await
|
|
249
|
+
await EntityProvenTxReq.fromStorageTxid(storage, txid)
|
|
250
250
|
)
|
|
251
251
|
expect(req.status).toBe('unmined')
|
|
252
252
|
expect(req.attempts).toBeGreaterThanOrEqual(attempts[i])
|
|
@@ -462,7 +462,7 @@ describe('Monitor tests', () => {
|
|
|
462
462
|
)
|
|
463
463
|
expect(req.status).toBe('unsent')
|
|
464
464
|
const notifyIds =
|
|
465
|
-
new
|
|
465
|
+
new EntityProvenTxReq(req).notify.transactionIds || []
|
|
466
466
|
for (const transactionId of notifyIds) {
|
|
467
467
|
const tx = verifyTruthy(
|
|
468
468
|
await storage.findTransactionById(transactionId)
|
|
@@ -479,9 +479,9 @@ describe('Monitor tests', () => {
|
|
|
479
479
|
await storage.findProvenTxReqs({ partial: { txid } })
|
|
480
480
|
)
|
|
481
481
|
if (env.logTests)
|
|
482
|
-
console.log(new
|
|
482
|
+
console.log(new EntityProvenTxReq(req).historyPretty())
|
|
483
483
|
const notifyIds =
|
|
484
|
-
new
|
|
484
|
+
new EntityProvenTxReq(req).notify.transactionIds || []
|
|
485
485
|
switch (postBeefMockStatus) {
|
|
486
486
|
case 'success':
|
|
487
487
|
{
|
|
@@ -51,7 +51,7 @@ describe('StorageMySQLDojoReader tests', () => {
|
|
|
51
51
|
const writerSettings = await writer.getSettings()
|
|
52
52
|
|
|
53
53
|
const identityKey = process.env.MY_TEST_IDENTITY || ''
|
|
54
|
-
const ss = await
|
|
54
|
+
const ss = await EntitySyncState.fromStorage(
|
|
55
55
|
writer,
|
|
56
56
|
identityKey,
|
|
57
57
|
readerSettings
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
randomBytesHex,
|
|
5
5
|
sdk,
|
|
6
6
|
StorageProvider,
|
|
7
|
-
|
|
7
|
+
TableCommission
|
|
8
8
|
} from '../../src/index.client'
|
|
9
9
|
import { StorageKnex } from '../../src/storage/StorageKnex'
|
|
10
10
|
|
|
@@ -174,7 +174,7 @@ describe('insert tests', () => {
|
|
|
174
174
|
test('7 insert Commission', async () => {
|
|
175
175
|
for (const storage of storages) {
|
|
176
176
|
const { tx: t, user } = await _tu.insertTestTransaction(storage)
|
|
177
|
-
const e:
|
|
177
|
+
const e: TableCommission = await _tu.insertTestCommission(storage, t)
|
|
178
178
|
const id = e.commissionId
|
|
179
179
|
expect(id).toBeGreaterThan(0)
|
|
180
180
|
e.commissionId = 0
|