@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,21 +12,21 @@ import {
|
|
|
12
12
|
verifyValues
|
|
13
13
|
} from '../utils/TestUtilsWalletStorage'
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
TableProvenTx,
|
|
16
|
+
TableProvenTxReq,
|
|
17
|
+
TableUser,
|
|
18
|
+
TableCertificate,
|
|
19
|
+
TableCertificateField,
|
|
20
|
+
TableOutputBasket,
|
|
21
|
+
TableTransaction,
|
|
22
|
+
TableCommission,
|
|
23
|
+
TableOutput,
|
|
24
|
+
TableOutputTag,
|
|
25
|
+
TableOutputTagMap,
|
|
26
|
+
TableTxLabel,
|
|
27
|
+
TableTxLabelMap,
|
|
28
|
+
TableMonitorEvent,
|
|
29
|
+
TableSyncState
|
|
30
30
|
} from '../../src/storage/schema/tables'
|
|
31
31
|
|
|
32
32
|
setLogging(false)
|
|
@@ -106,7 +106,7 @@ describe('update tests', () => {
|
|
|
106
106
|
const records = await storage.findProvenTxs({ partial: {} })
|
|
107
107
|
for (const record of records) {
|
|
108
108
|
try {
|
|
109
|
-
const testValues:
|
|
109
|
+
const testValues: TableProvenTx = {
|
|
110
110
|
provenTxId: record.provenTxId,
|
|
111
111
|
txid: 'mockTxid',
|
|
112
112
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
@@ -205,7 +205,7 @@ describe('update tests', () => {
|
|
|
205
205
|
const records = await storage.findProvenTxReqs({ partial: {} })
|
|
206
206
|
for (const record of records) {
|
|
207
207
|
try {
|
|
208
|
-
const testValues:
|
|
208
|
+
const testValues: TableProvenTxReq = {
|
|
209
209
|
provenTxReqId: record.provenTxReqId,
|
|
210
210
|
provenTxId: 1,
|
|
211
211
|
batch: `batch-001`,
|
|
@@ -287,7 +287,7 @@ describe('update tests', () => {
|
|
|
287
287
|
const records = await storage.findUsers({ partial: {} })
|
|
288
288
|
for (const record of records) {
|
|
289
289
|
try {
|
|
290
|
-
const testValues:
|
|
290
|
+
const testValues: TableUser = {
|
|
291
291
|
userId: record.userId,
|
|
292
292
|
identityKey: `mockUpdatedIdentityKey-${record[primaryKey]}`,
|
|
293
293
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
@@ -330,7 +330,7 @@ describe('update tests', () => {
|
|
|
330
330
|
const records = await storage.findCertificates({ partial: {} })
|
|
331
331
|
for (const record of records) {
|
|
332
332
|
try {
|
|
333
|
-
const testValues:
|
|
333
|
+
const testValues: TableCertificate = {
|
|
334
334
|
certificateId: record.certificateId,
|
|
335
335
|
userId: 1,
|
|
336
336
|
certifier: `mockCertifier${record.certificateId}`,
|
|
@@ -420,7 +420,7 @@ describe('update tests', () => {
|
|
|
420
420
|
})
|
|
421
421
|
for (const record of records) {
|
|
422
422
|
try {
|
|
423
|
-
const testValues:
|
|
423
|
+
const testValues: TableCertificateField = {
|
|
424
424
|
certificateId: record.certificateId,
|
|
425
425
|
userId: record.userId ?? 1,
|
|
426
426
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
@@ -472,7 +472,7 @@ describe('update tests', () => {
|
|
|
472
472
|
const records = await storage.findOutputBaskets({ partial: {} })
|
|
473
473
|
for (const record of records) {
|
|
474
474
|
try {
|
|
475
|
-
const testValues:
|
|
475
|
+
const testValues: TableOutputBasket = {
|
|
476
476
|
basketId: record.basketId,
|
|
477
477
|
userId: record.userId ?? 1,
|
|
478
478
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
@@ -533,7 +533,7 @@ describe('update tests', () => {
|
|
|
533
533
|
const records = await storage.findTransactions({ partial: {} })
|
|
534
534
|
for (const record of records) {
|
|
535
535
|
try {
|
|
536
|
-
const testValues:
|
|
536
|
+
const testValues: TableTransaction = {
|
|
537
537
|
transactionId: record.transactionId,
|
|
538
538
|
userId: record.userId ?? 1,
|
|
539
539
|
provenTxId: 1,
|
|
@@ -610,7 +610,7 @@ describe('update tests', () => {
|
|
|
610
610
|
const records = await storage.findCommissions({ partial: {} })
|
|
611
611
|
for (const record of records) {
|
|
612
612
|
try {
|
|
613
|
-
const testValues:
|
|
613
|
+
const testValues: TableCommission = {
|
|
614
614
|
commissionId: record.commissionId,
|
|
615
615
|
userId: record.userId ?? 1,
|
|
616
616
|
transactionId: record.transactionId ?? 1,
|
|
@@ -687,7 +687,7 @@ describe('update tests', () => {
|
|
|
687
687
|
testVout += 1
|
|
688
688
|
}
|
|
689
689
|
try {
|
|
690
|
-
const testValues:
|
|
690
|
+
const testValues: TableOutput = {
|
|
691
691
|
outputId: record.outputId,
|
|
692
692
|
basketId: record.basketId ?? 1,
|
|
693
693
|
transactionId: testTransactionId,
|
|
@@ -768,7 +768,7 @@ describe('update tests', () => {
|
|
|
768
768
|
}
|
|
769
769
|
for (const record of records) {
|
|
770
770
|
const uniqueTag = `updated_tag_${record.outputTagId}`
|
|
771
|
-
const testValues:
|
|
771
|
+
const testValues: TableOutputTag = {
|
|
772
772
|
outputTagId: record.outputTagId,
|
|
773
773
|
userId: record.userId,
|
|
774
774
|
tag: uniqueTag,
|
|
@@ -836,7 +836,7 @@ describe('update tests', () => {
|
|
|
836
836
|
`Missing outputId for record: ${JSON.stringify(record)}`
|
|
837
837
|
)
|
|
838
838
|
try {
|
|
839
|
-
const testValues:
|
|
839
|
+
const testValues: TableOutputTagMap = {
|
|
840
840
|
outputTagId: record.outputTagId,
|
|
841
841
|
outputId: record.outputId,
|
|
842
842
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
@@ -905,7 +905,7 @@ describe('update tests', () => {
|
|
|
905
905
|
}
|
|
906
906
|
for (const record of records) {
|
|
907
907
|
const uniqueLabel = `unique_label_${record.txLabelId}`
|
|
908
|
-
const testValues:
|
|
908
|
+
const testValues: TableTxLabel = {
|
|
909
909
|
txLabelId: record.txLabelId,
|
|
910
910
|
userId: record.userId,
|
|
911
911
|
label: uniqueLabel,
|
|
@@ -970,7 +970,7 @@ describe('update tests', () => {
|
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
972
|
for (const record of records) {
|
|
973
|
-
const testValues:
|
|
973
|
+
const testValues: TableTxLabelMap = {
|
|
974
974
|
transactionId: record.transactionId,
|
|
975
975
|
txLabelId: record.txLabelId,
|
|
976
976
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
@@ -1030,7 +1030,7 @@ describe('update tests', () => {
|
|
|
1030
1030
|
const records = await storage.findMonitorEvents({ partial: {} })
|
|
1031
1031
|
for (const record of records) {
|
|
1032
1032
|
try {
|
|
1033
|
-
const testValues:
|
|
1033
|
+
const testValues: TableMonitorEvent = {
|
|
1034
1034
|
id: record.id,
|
|
1035
1035
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
1036
1036
|
updated_at: new Date('2024-12-30T23:05:00Z'),
|
|
@@ -1082,7 +1082,7 @@ describe('update tests', () => {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
1084
|
for (const record of records) {
|
|
1085
|
-
const testValues:
|
|
1085
|
+
const testValues: TableSyncState = {
|
|
1086
1086
|
syncStateId: record.syncStateId,
|
|
1087
1087
|
userId: record.userId,
|
|
1088
1088
|
refNum: 'test_refNum',
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
sdk,
|
|
6
6
|
StorageProvider,
|
|
7
7
|
StorageKnex,
|
|
8
|
-
table,
|
|
9
8
|
verifyOne
|
|
10
9
|
} from '../../src/index.all'
|
|
11
10
|
import {
|
|
@@ -18,21 +17,21 @@ import {
|
|
|
18
17
|
verifyValues
|
|
19
18
|
} from '../utils/TestUtilsWalletStorage'
|
|
20
19
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
TableProvenTx,
|
|
21
|
+
TableProvenTxReq,
|
|
22
|
+
TableUser,
|
|
23
|
+
TableCertificate,
|
|
24
|
+
TableCertificateField,
|
|
25
|
+
TableOutputBasket,
|
|
26
|
+
TableTransaction,
|
|
27
|
+
TableCommission,
|
|
28
|
+
TableOutput,
|
|
29
|
+
TableOutputTag,
|
|
30
|
+
TableOutputTagMap,
|
|
31
|
+
TableTxLabel,
|
|
32
|
+
TableTxLabelMap,
|
|
33
|
+
TableMonitorEvent,
|
|
34
|
+
TableSyncState
|
|
36
35
|
} from '../../src/storage/schema/tables'
|
|
37
36
|
|
|
38
37
|
setLogging(false)
|
|
@@ -120,7 +119,7 @@ describe('update2 tests', () => {
|
|
|
120
119
|
const records = await storage.findProvenTxs({ partial: {} })
|
|
121
120
|
for (const record of records) {
|
|
122
121
|
try {
|
|
123
|
-
const testValues:
|
|
122
|
+
const testValues: TableProvenTx = {
|
|
124
123
|
provenTxId: record.provenTxId,
|
|
125
124
|
txid: 'mockTxid',
|
|
126
125
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
@@ -280,7 +279,7 @@ describe('update2 tests', () => {
|
|
|
280
279
|
test('4_update ProvenTx setting individual values', async () => {
|
|
281
280
|
await createDB('ProvenTx4')
|
|
282
281
|
for (const { storage } of setups) {
|
|
283
|
-
const initialRecord:
|
|
282
|
+
const initialRecord: TableProvenTx = {
|
|
284
283
|
provenTxId: 3,
|
|
285
284
|
txid: 'mockTxid',
|
|
286
285
|
created_at: new Date(),
|
|
@@ -336,7 +335,7 @@ describe('update2 tests', () => {
|
|
|
336
335
|
const records = await storage.findProvenTxReqs({ partial: {} })
|
|
337
336
|
for (const record of records) {
|
|
338
337
|
try {
|
|
339
|
-
const testValues:
|
|
338
|
+
const testValues: TableProvenTxReq = {
|
|
340
339
|
provenTxReqId: record.provenTxReqId,
|
|
341
340
|
provenTxId: 1,
|
|
342
341
|
batch: `batch-001`,
|
|
@@ -468,7 +467,7 @@ describe('update2 tests', () => {
|
|
|
468
467
|
await createDB('ProvenTxReq7')
|
|
469
468
|
for (const { storage } of setups) {
|
|
470
469
|
const referenceTime = new Date()
|
|
471
|
-
const initialRecord:
|
|
470
|
+
const initialRecord: TableProvenTxReq = {
|
|
472
471
|
provenTxReqId: 3,
|
|
473
472
|
provenTxId: 1,
|
|
474
473
|
batch: 'batch',
|
|
@@ -484,7 +483,7 @@ describe('update2 tests', () => {
|
|
|
484
483
|
rawTx: []
|
|
485
484
|
}
|
|
486
485
|
await storage.insertProvenTxReq(initialRecord)
|
|
487
|
-
const secondRecord:
|
|
486
|
+
const secondRecord: TableProvenTxReq = {
|
|
488
487
|
...initialRecord,
|
|
489
488
|
provenTxReqId: 4,
|
|
490
489
|
txid: 'mockTxid2'
|
|
@@ -537,7 +536,7 @@ describe('update2 tests', () => {
|
|
|
537
536
|
const records = await storage.findUsers({ partial: {} })
|
|
538
537
|
for (const record of records) {
|
|
539
538
|
try {
|
|
540
|
-
const testValues:
|
|
539
|
+
const testValues: TableUser = {
|
|
541
540
|
userId: record.userId,
|
|
542
541
|
identityKey: `mockUpdatedIdentityKey-${record[primaryKey]}`,
|
|
543
542
|
created_at: new Date('2024-12-30T23:00:00Z'),
|
|
@@ -694,7 +693,7 @@ describe('update2 tests', () => {
|
|
|
694
693
|
test('12_update User table setting individual values', async () => {
|
|
695
694
|
await createDB('User12')
|
|
696
695
|
for (const { storage } of setups) {
|
|
697
|
-
const initialRecord:
|
|
696
|
+
const initialRecord: TableUser = {
|
|
698
697
|
userId: 3,
|
|
699
698
|
identityKey: '',
|
|
700
699
|
created_at: new Date(),
|
|
@@ -780,7 +779,7 @@ describe('update2 tests', () => {
|
|
|
780
779
|
const records = await storage.findCertificates({ partial: {} })
|
|
781
780
|
for (const record of records) {
|
|
782
781
|
try {
|
|
783
|
-
const testValues:
|
|
782
|
+
const testValues: TableCertificate = {
|
|
784
783
|
certificateId: record.certificateId,
|
|
785
784
|
userId: 1,
|
|
786
785
|
certifier: `mockCertifier${record.certificateId}`,
|
|
@@ -27,14 +27,28 @@ import {
|
|
|
27
27
|
StorageProvider,
|
|
28
28
|
StorageKnex,
|
|
29
29
|
StorageSyncReader,
|
|
30
|
-
table,
|
|
31
30
|
verifyTruthy,
|
|
32
31
|
Wallet,
|
|
33
32
|
Monitor,
|
|
34
33
|
Services,
|
|
35
34
|
WalletStorageManager,
|
|
36
35
|
verifyOne,
|
|
37
|
-
StorageClient
|
|
36
|
+
StorageClient,
|
|
37
|
+
TableOutputBasket,
|
|
38
|
+
TableOutput,
|
|
39
|
+
TableMonitorEvent,
|
|
40
|
+
TableProvenTxReq,
|
|
41
|
+
TableProvenTx,
|
|
42
|
+
TableCommission,
|
|
43
|
+
TableTransaction,
|
|
44
|
+
TableTxLabelMap,
|
|
45
|
+
TableTxLabel,
|
|
46
|
+
TableUser,
|
|
47
|
+
TableSyncState,
|
|
48
|
+
TableCertificate,
|
|
49
|
+
TableCertificateField,
|
|
50
|
+
TableOutputTagMap,
|
|
51
|
+
TableOutputTag
|
|
38
52
|
} from '../../src/index.all'
|
|
39
53
|
|
|
40
54
|
import { Knex, knex as makeKnex } from 'knex'
|
|
@@ -714,7 +728,7 @@ export abstract class TestUtilsWalletStorage {
|
|
|
714
728
|
|
|
715
729
|
static async insertTestProvenTx(storage: StorageProvider, txid?: string) {
|
|
716
730
|
const now = new Date()
|
|
717
|
-
const ptx:
|
|
731
|
+
const ptx: TableProvenTx = {
|
|
718
732
|
created_at: now,
|
|
719
733
|
updated_at: now,
|
|
720
734
|
provenTxId: 0,
|
|
@@ -737,7 +751,7 @@ export abstract class TestUtilsWalletStorage {
|
|
|
737
751
|
onlyRequired?: boolean
|
|
738
752
|
) {
|
|
739
753
|
const now = new Date()
|
|
740
|
-
const ptxreq:
|
|
754
|
+
const ptxreq: TableProvenTxReq = {
|
|
741
755
|
// Required:
|
|
742
756
|
created_at: now,
|
|
743
757
|
updated_at: now,
|
|
@@ -760,7 +774,7 @@ export abstract class TestUtilsWalletStorage {
|
|
|
760
774
|
|
|
761
775
|
static async insertTestUser(storage: StorageProvider, identityKey?: string) {
|
|
762
776
|
const now = new Date()
|
|
763
|
-
const e:
|
|
777
|
+
const e: TableUser = {
|
|
764
778
|
created_at: now,
|
|
765
779
|
updated_at: now,
|
|
766
780
|
userId: 0,
|
|
@@ -770,10 +784,10 @@ export abstract class TestUtilsWalletStorage {
|
|
|
770
784
|
return e
|
|
771
785
|
}
|
|
772
786
|
|
|
773
|
-
static async insertTestCertificate(storage: StorageProvider, u?:
|
|
787
|
+
static async insertTestCertificate(storage: StorageProvider, u?: TableUser) {
|
|
774
788
|
const now = new Date()
|
|
775
789
|
u ||= await _tu.insertTestUser(storage)
|
|
776
|
-
const e:
|
|
790
|
+
const e: TableCertificate = {
|
|
777
791
|
created_at: now,
|
|
778
792
|
updated_at: now,
|
|
779
793
|
certificateId: 0,
|
|
@@ -793,12 +807,12 @@ export abstract class TestUtilsWalletStorage {
|
|
|
793
807
|
|
|
794
808
|
static async insertTestCertificateField(
|
|
795
809
|
storage: StorageProvider,
|
|
796
|
-
c:
|
|
810
|
+
c: TableCertificate,
|
|
797
811
|
name: string,
|
|
798
812
|
value: string
|
|
799
813
|
) {
|
|
800
814
|
const now = new Date()
|
|
801
|
-
const e:
|
|
815
|
+
const e: TableCertificateField = {
|
|
802
816
|
created_at: now,
|
|
803
817
|
updated_at: now,
|
|
804
818
|
certificateId: c.certificateId,
|
|
@@ -813,18 +827,25 @@ export abstract class TestUtilsWalletStorage {
|
|
|
813
827
|
|
|
814
828
|
static async insertTestOutputBasket(
|
|
815
829
|
storage: StorageProvider,
|
|
816
|
-
u?:
|
|
817
|
-
partial?: Partial<
|
|
830
|
+
u?: TableUser | number,
|
|
831
|
+
partial?: Partial<TableOutputBasket>
|
|
818
832
|
) {
|
|
819
833
|
const now = new Date()
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
834
|
+
let user: TableUser
|
|
835
|
+
if (u === undefined) {
|
|
836
|
+
user = await _tu.insertTestUser(storage)
|
|
837
|
+
} else if (typeof u === 'number') {
|
|
838
|
+
user = verifyOne(
|
|
839
|
+
await storage.findUsers({ partial: { userId: u } })
|
|
840
|
+
) as TableUser
|
|
841
|
+
} else {
|
|
842
|
+
user = u
|
|
843
|
+
}
|
|
844
|
+
const e: TableOutputBasket = {
|
|
824
845
|
created_at: now,
|
|
825
846
|
updated_at: now,
|
|
826
847
|
basketId: 0,
|
|
827
|
-
userId:
|
|
848
|
+
userId: user.userId,
|
|
828
849
|
name: randomBytesHex(6),
|
|
829
850
|
numberOfDesiredUTXOs: 42,
|
|
830
851
|
minimumDesiredUTXOValue: 1642,
|
|
@@ -837,13 +858,13 @@ export abstract class TestUtilsWalletStorage {
|
|
|
837
858
|
|
|
838
859
|
static async insertTestTransaction(
|
|
839
860
|
storage: StorageProvider,
|
|
840
|
-
u?:
|
|
861
|
+
u?: TableUser,
|
|
841
862
|
onlyRequired?: boolean,
|
|
842
|
-
partial?: Partial<
|
|
863
|
+
partial?: Partial<TableTransaction>
|
|
843
864
|
) {
|
|
844
865
|
const now = new Date()
|
|
845
866
|
u ||= await _tu.insertTestUser(storage)
|
|
846
|
-
const e:
|
|
867
|
+
const e: TableTransaction = {
|
|
847
868
|
// Required:
|
|
848
869
|
created_at: now,
|
|
849
870
|
updated_at: now,
|
|
@@ -868,15 +889,15 @@ export abstract class TestUtilsWalletStorage {
|
|
|
868
889
|
|
|
869
890
|
static async insertTestOutput(
|
|
870
891
|
storage: StorageProvider,
|
|
871
|
-
t:
|
|
892
|
+
t: TableTransaction,
|
|
872
893
|
vout: number,
|
|
873
894
|
satoshis: number,
|
|
874
|
-
basket?:
|
|
895
|
+
basket?: TableOutputBasket,
|
|
875
896
|
requiredOnly?: boolean,
|
|
876
|
-
partial?: Partial<
|
|
897
|
+
partial?: Partial<TableOutput>
|
|
877
898
|
) {
|
|
878
899
|
const now = new Date()
|
|
879
|
-
const e:
|
|
900
|
+
const e: TableOutput = {
|
|
880
901
|
created_at: now,
|
|
881
902
|
updated_at: now,
|
|
882
903
|
outputId: 0,
|
|
@@ -909,11 +930,11 @@ export abstract class TestUtilsWalletStorage {
|
|
|
909
930
|
|
|
910
931
|
static async insertTestOutputTag(
|
|
911
932
|
storage: StorageProvider,
|
|
912
|
-
u:
|
|
913
|
-
partial?: Partial<
|
|
933
|
+
u: TableUser,
|
|
934
|
+
partial?: Partial<TableOutputTag>
|
|
914
935
|
) {
|
|
915
936
|
const now = new Date()
|
|
916
|
-
const e:
|
|
937
|
+
const e: TableOutputTag = {
|
|
917
938
|
created_at: now,
|
|
918
939
|
updated_at: now,
|
|
919
940
|
outputTagId: 0,
|
|
@@ -928,11 +949,11 @@ export abstract class TestUtilsWalletStorage {
|
|
|
928
949
|
|
|
929
950
|
static async insertTestOutputTagMap(
|
|
930
951
|
storage: StorageProvider,
|
|
931
|
-
o:
|
|
932
|
-
tag:
|
|
952
|
+
o: TableOutput,
|
|
953
|
+
tag: TableOutputTag
|
|
933
954
|
) {
|
|
934
955
|
const now = new Date()
|
|
935
|
-
const e:
|
|
956
|
+
const e: TableOutputTagMap = {
|
|
936
957
|
created_at: now,
|
|
937
958
|
updated_at: now,
|
|
938
959
|
outputTagId: tag.outputTagId,
|
|
@@ -945,11 +966,11 @@ export abstract class TestUtilsWalletStorage {
|
|
|
945
966
|
|
|
946
967
|
static async insertTestTxLabel(
|
|
947
968
|
storage: StorageProvider,
|
|
948
|
-
u:
|
|
949
|
-
partial?: Partial<
|
|
969
|
+
u: TableUser,
|
|
970
|
+
partial?: Partial<TableTxLabel>
|
|
950
971
|
) {
|
|
951
972
|
const now = new Date()
|
|
952
|
-
const e:
|
|
973
|
+
const e: TableTxLabel = {
|
|
953
974
|
created_at: now,
|
|
954
975
|
updated_at: now,
|
|
955
976
|
txLabelId: 0,
|
|
@@ -964,12 +985,12 @@ export abstract class TestUtilsWalletStorage {
|
|
|
964
985
|
|
|
965
986
|
static async insertTestTxLabelMap(
|
|
966
987
|
storage: StorageProvider,
|
|
967
|
-
tx:
|
|
968
|
-
label:
|
|
969
|
-
partial?: Partial<
|
|
988
|
+
tx: TableTransaction,
|
|
989
|
+
label: TableTxLabel,
|
|
990
|
+
partial?: Partial<TableTxLabelMap>
|
|
970
991
|
) {
|
|
971
992
|
const now = new Date()
|
|
972
|
-
const e:
|
|
993
|
+
const e: TableTxLabelMap = {
|
|
973
994
|
created_at: now,
|
|
974
995
|
updated_at: now,
|
|
975
996
|
txLabelId: label.txLabelId,
|
|
@@ -981,10 +1002,10 @@ export abstract class TestUtilsWalletStorage {
|
|
|
981
1002
|
return e
|
|
982
1003
|
}
|
|
983
1004
|
|
|
984
|
-
static async insertTestSyncState(storage: StorageProvider, u:
|
|
1005
|
+
static async insertTestSyncState(storage: StorageProvider, u: TableUser) {
|
|
985
1006
|
const now = new Date()
|
|
986
1007
|
const settings = await storage.getSettings()
|
|
987
|
-
const e:
|
|
1008
|
+
const e: TableSyncState = {
|
|
988
1009
|
created_at: now,
|
|
989
1010
|
updated_at: now,
|
|
990
1011
|
syncStateId: 0,
|
|
@@ -1002,7 +1023,7 @@ export abstract class TestUtilsWalletStorage {
|
|
|
1002
1023
|
|
|
1003
1024
|
static async insertTestMonitorEvent(storage: StorageProvider) {
|
|
1004
1025
|
const now = new Date()
|
|
1005
|
-
const e:
|
|
1026
|
+
const e: TableMonitorEvent = {
|
|
1006
1027
|
created_at: now,
|
|
1007
1028
|
updated_at: now,
|
|
1008
1029
|
id: 0,
|
|
@@ -1014,10 +1035,10 @@ export abstract class TestUtilsWalletStorage {
|
|
|
1014
1035
|
|
|
1015
1036
|
static async insertTestCommission(
|
|
1016
1037
|
storage: StorageProvider,
|
|
1017
|
-
t:
|
|
1038
|
+
t: TableTransaction
|
|
1018
1039
|
) {
|
|
1019
1040
|
const now = new Date()
|
|
1020
|
-
const e:
|
|
1041
|
+
const e: TableCommission = {
|
|
1021
1042
|
created_at: now,
|
|
1022
1043
|
updated_at: now,
|
|
1023
1044
|
commissionId: 0,
|
|
@@ -1381,45 +1402,45 @@ export abstract class TestUtilsWalletStorage {
|
|
|
1381
1402
|
export abstract class _tu extends TestUtilsWalletStorage {}
|
|
1382
1403
|
|
|
1383
1404
|
export interface TestSetup1 {
|
|
1384
|
-
u1:
|
|
1385
|
-
u1basket1:
|
|
1386
|
-
u1basket2:
|
|
1387
|
-
u1label1:
|
|
1388
|
-
u1label2:
|
|
1389
|
-
u1tag1:
|
|
1390
|
-
u1tag2:
|
|
1391
|
-
u1tx1:
|
|
1392
|
-
u1comm1:
|
|
1393
|
-
u1tx1label1:
|
|
1394
|
-
u1tx1label2:
|
|
1395
|
-
u1tx1o0:
|
|
1396
|
-
u1o0tag1:
|
|
1397
|
-
u1o0tag2:
|
|
1398
|
-
u1tx1o1:
|
|
1399
|
-
u1o1tag1:
|
|
1400
|
-
u1cert1:
|
|
1401
|
-
u1cert1field1:
|
|
1402
|
-
u1cert1field2:
|
|
1403
|
-
u1cert2:
|
|
1404
|
-
u1cert2field1:
|
|
1405
|
-
u1cert3:
|
|
1406
|
-
u1sync1:
|
|
1407
|
-
|
|
1408
|
-
u2:
|
|
1409
|
-
u2basket1:
|
|
1410
|
-
u2label1:
|
|
1411
|
-
u2tx1:
|
|
1412
|
-
u2comm1:
|
|
1413
|
-
u2tx1label1:
|
|
1414
|
-
u2tx1o0:
|
|
1415
|
-
u2tx2:
|
|
1416
|
-
u2comm2:
|
|
1417
|
-
|
|
1418
|
-
proven1:
|
|
1419
|
-
req1:
|
|
1420
|
-
req2:
|
|
1421
|
-
|
|
1422
|
-
we1:
|
|
1405
|
+
u1: TableUser
|
|
1406
|
+
u1basket1: TableOutputBasket
|
|
1407
|
+
u1basket2: TableOutputBasket
|
|
1408
|
+
u1label1: TableTxLabel
|
|
1409
|
+
u1label2: TableTxLabel
|
|
1410
|
+
u1tag1: TableOutputTag
|
|
1411
|
+
u1tag2: TableOutputTag
|
|
1412
|
+
u1tx1: TableTransaction
|
|
1413
|
+
u1comm1: TableCommission
|
|
1414
|
+
u1tx1label1: TableTxLabelMap
|
|
1415
|
+
u1tx1label2: TableTxLabelMap
|
|
1416
|
+
u1tx1o0: TableOutput
|
|
1417
|
+
u1o0tag1: TableOutputTagMap
|
|
1418
|
+
u1o0tag2: TableOutputTagMap
|
|
1419
|
+
u1tx1o1: TableOutput
|
|
1420
|
+
u1o1tag1: TableOutputTagMap
|
|
1421
|
+
u1cert1: TableCertificate
|
|
1422
|
+
u1cert1field1: TableCertificateField
|
|
1423
|
+
u1cert1field2: TableCertificateField
|
|
1424
|
+
u1cert2: TableCertificate
|
|
1425
|
+
u1cert2field1: TableCertificateField
|
|
1426
|
+
u1cert3: TableCertificate
|
|
1427
|
+
u1sync1: TableSyncState
|
|
1428
|
+
|
|
1429
|
+
u2: TableUser
|
|
1430
|
+
u2basket1: TableOutputBasket
|
|
1431
|
+
u2label1: TableTxLabel
|
|
1432
|
+
u2tx1: TableTransaction
|
|
1433
|
+
u2comm1: TableCommission
|
|
1434
|
+
u2tx1label1: TableTxLabelMap
|
|
1435
|
+
u2tx1o0: TableOutput
|
|
1436
|
+
u2tx2: TableTransaction
|
|
1437
|
+
u2comm2: TableCommission
|
|
1438
|
+
|
|
1439
|
+
proven1: TableProvenTx
|
|
1440
|
+
req1: TableProvenTxReq
|
|
1441
|
+
req2: TableProvenTxReq
|
|
1442
|
+
|
|
1443
|
+
we1: TableMonitorEvent
|
|
1423
1444
|
}
|
|
1424
1445
|
|
|
1425
1446
|
export interface MockData {
|
|
@@ -2061,7 +2082,7 @@ export async function logTransaction(
|
|
|
2061
2082
|
|
|
2062
2083
|
export async function logOutput(
|
|
2063
2084
|
storage: StorageKnex,
|
|
2064
|
-
output:
|
|
2085
|
+
output: TableOutput
|
|
2065
2086
|
): Promise<string> {
|
|
2066
2087
|
let log = `\n-- Output --\n`
|
|
2067
2088
|
log += `Outpoint: ${output.txid}:${output.vout}\n`
|
|
@@ -2156,7 +2177,7 @@ export async function logInput(
|
|
|
2156
2177
|
return log
|
|
2157
2178
|
}
|
|
2158
2179
|
|
|
2159
|
-
export function logBasket(basket:
|
|
2180
|
+
export function logBasket(basket: TableOutputBasket): string {
|
|
2160
2181
|
return `\n-- Basket --\nName: ${basket.name}\n`
|
|
2161
2182
|
}
|
|
2162
2183
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import * as bsv from '@bsv/sdk'
|
|
3
|
-
import { sdk,
|
|
3
|
+
import { sdk, Wallet } from '../../../src/index.all'
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
_tu,
|
|
7
|
-
expectToThrowWERR,
|
|
8
7
|
logTransaction,
|
|
9
8
|
TestKeyPair,
|
|
10
9
|
TestWalletNoSetup,
|