@bsv/wallet-toolbox 1.1.7 → 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 -486
- package/docs/monitor.md +29 -27
- package/docs/services.md +22 -22
- package/docs/setup.md +23 -23
- package/docs/storage.md +2177 -419
- package/docs/wallet.md +499 -486
- 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.map +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.js +1 -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 +17 -11
- package/src/storage/methods/reviewStatus.ts +4 -4
- 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 +6 -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 +1 -1
- 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
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createSyncMap,
|
|
3
|
+
sdk,
|
|
4
|
+
SyncMap,
|
|
5
|
+
TableOutputBasket
|
|
6
|
+
} from '../../../../../src'
|
|
2
7
|
import {
|
|
3
8
|
TestUtilsWalletStorage as _tu,
|
|
4
9
|
TestWalletNoSetup
|
|
5
10
|
} from '../../../../../test/utils/TestUtilsWalletStorage'
|
|
6
|
-
import {
|
|
11
|
+
import { EntityOutputBasket } from '../../../../../src/storage/schema/entities/OutputBasket'
|
|
7
12
|
|
|
8
13
|
describe('OutputBasket class method tests', () => {
|
|
9
14
|
jest.setTimeout(99999999)
|
|
@@ -34,7 +39,7 @@ describe('OutputBasket class method tests', () => {
|
|
|
34
39
|
const ctx = ctxs[0]
|
|
35
40
|
|
|
36
41
|
// Insert initial OutputBasket record with valid data
|
|
37
|
-
const initialData:
|
|
42
|
+
const initialData: TableOutputBasket = {
|
|
38
43
|
basketId: 100,
|
|
39
44
|
created_at: new Date('2023-01-01'),
|
|
40
45
|
updated_at: new Date('2023-01-02'),
|
|
@@ -47,10 +52,10 @@ describe('OutputBasket class method tests', () => {
|
|
|
47
52
|
await ctx.activeStorage.insertOutputBasket(initialData)
|
|
48
53
|
|
|
49
54
|
// Create an OutputBasket entity from the initial data
|
|
50
|
-
const entity = new
|
|
55
|
+
const entity = new EntityOutputBasket(initialData)
|
|
51
56
|
|
|
52
57
|
// Simulate the `ei` argument with a later `updated_at`
|
|
53
|
-
const updatedData:
|
|
58
|
+
const updatedData: TableOutputBasket = {
|
|
54
59
|
...initialData,
|
|
55
60
|
updated_at: new Date('2023-01-03'), // Later timestamp
|
|
56
61
|
numberOfDesiredUTXOs: 20, // Update this field
|
|
@@ -58,85 +63,15 @@ describe('OutputBasket class method tests', () => {
|
|
|
58
63
|
isDeleted: true // Simulate a change in `isDeleted`
|
|
59
64
|
}
|
|
60
65
|
|
|
66
|
+
const syncMap = createSyncMap()
|
|
67
|
+
syncMap.outputBasket.idMap[100] = 100
|
|
68
|
+
|
|
61
69
|
// Call mergeExisting
|
|
62
70
|
const wasMergedRaw = await entity.mergeExisting(
|
|
63
71
|
ctx.activeStorage,
|
|
64
72
|
undefined, // `since` is not used in this method
|
|
65
73
|
updatedData,
|
|
66
|
-
|
|
67
|
-
outputBasket: {
|
|
68
|
-
idMap: { 100: 100 },
|
|
69
|
-
entityName: 'OutputBasket',
|
|
70
|
-
maxUpdated_at: undefined,
|
|
71
|
-
count: 0
|
|
72
|
-
},
|
|
73
|
-
output: {
|
|
74
|
-
idMap: {},
|
|
75
|
-
entityName: 'Output',
|
|
76
|
-
maxUpdated_at: undefined,
|
|
77
|
-
count: 0
|
|
78
|
-
},
|
|
79
|
-
transaction: {
|
|
80
|
-
idMap: {},
|
|
81
|
-
entityName: 'Transaction',
|
|
82
|
-
maxUpdated_at: undefined,
|
|
83
|
-
count: 0
|
|
84
|
-
},
|
|
85
|
-
provenTx: {
|
|
86
|
-
idMap: {},
|
|
87
|
-
entityName: 'ProvenTx',
|
|
88
|
-
maxUpdated_at: undefined,
|
|
89
|
-
count: 0
|
|
90
|
-
},
|
|
91
|
-
outputTag: {
|
|
92
|
-
idMap: {},
|
|
93
|
-
entityName: 'OutputTag',
|
|
94
|
-
maxUpdated_at: undefined,
|
|
95
|
-
count: 0
|
|
96
|
-
},
|
|
97
|
-
provenTxReq: {
|
|
98
|
-
idMap: {},
|
|
99
|
-
entityName: 'ProvenTxReq',
|
|
100
|
-
maxUpdated_at: undefined,
|
|
101
|
-
count: 0
|
|
102
|
-
},
|
|
103
|
-
txLabel: {
|
|
104
|
-
idMap: {},
|
|
105
|
-
entityName: 'TxLabel',
|
|
106
|
-
maxUpdated_at: undefined,
|
|
107
|
-
count: 0
|
|
108
|
-
},
|
|
109
|
-
txLabelMap: {
|
|
110
|
-
idMap: {},
|
|
111
|
-
entityName: 'TxLabelMap',
|
|
112
|
-
maxUpdated_at: undefined,
|
|
113
|
-
count: 0
|
|
114
|
-
},
|
|
115
|
-
outputTagMap: {
|
|
116
|
-
idMap: {},
|
|
117
|
-
entityName: 'OutputTagMap',
|
|
118
|
-
maxUpdated_at: undefined,
|
|
119
|
-
count: 0
|
|
120
|
-
},
|
|
121
|
-
certificate: {
|
|
122
|
-
idMap: {},
|
|
123
|
-
entityName: 'Certificate',
|
|
124
|
-
maxUpdated_at: undefined,
|
|
125
|
-
count: 0
|
|
126
|
-
},
|
|
127
|
-
certificateField: {
|
|
128
|
-
idMap: {},
|
|
129
|
-
entityName: 'CertificateField',
|
|
130
|
-
maxUpdated_at: undefined,
|
|
131
|
-
count: 0
|
|
132
|
-
},
|
|
133
|
-
commission: {
|
|
134
|
-
idMap: {},
|
|
135
|
-
entityName: 'Commission',
|
|
136
|
-
maxUpdated_at: undefined,
|
|
137
|
-
count: 0
|
|
138
|
-
}
|
|
139
|
-
},
|
|
74
|
+
syncMap,
|
|
140
75
|
undefined // `trx` is not used
|
|
141
76
|
)
|
|
142
77
|
|
|
@@ -165,7 +100,7 @@ describe('OutputBasket class method tests', () => {
|
|
|
165
100
|
const ctx = ctxs[0]
|
|
166
101
|
|
|
167
102
|
// Insert initial OutputBasket record with valid data
|
|
168
|
-
const initialData:
|
|
103
|
+
const initialData: TableOutputBasket = {
|
|
169
104
|
basketId: 200,
|
|
170
105
|
created_at: new Date('2023-01-01'),
|
|
171
106
|
updated_at: new Date('2023-01-02'),
|
|
@@ -178,10 +113,10 @@ describe('OutputBasket class method tests', () => {
|
|
|
178
113
|
await ctx.activeStorage.insertOutputBasket(initialData)
|
|
179
114
|
|
|
180
115
|
// Create an OutputBasket entity from the initial data
|
|
181
|
-
const entity = new
|
|
116
|
+
const entity = new EntityOutputBasket(initialData)
|
|
182
117
|
|
|
183
118
|
// Simulate the `ei` argument with an earlier `updated_at`
|
|
184
|
-
const earlierData:
|
|
119
|
+
const earlierData: TableOutputBasket = {
|
|
185
120
|
...initialData,
|
|
186
121
|
updated_at: new Date('2023-01-01'), // Earlier timestamp
|
|
187
122
|
numberOfDesiredUTXOs: 20, // Simulate a change
|
|
@@ -189,85 +124,15 @@ describe('OutputBasket class method tests', () => {
|
|
|
189
124
|
isDeleted: true // Simulate a change
|
|
190
125
|
}
|
|
191
126
|
|
|
127
|
+
const syncMap = createSyncMap()
|
|
128
|
+
syncMap.outputBasket.idMap[200] = 200
|
|
129
|
+
|
|
192
130
|
// Call mergeExisting
|
|
193
131
|
const wasMergedRaw = await entity.mergeExisting(
|
|
194
132
|
ctx.activeStorage,
|
|
195
133
|
undefined, // `since` is not used in this method
|
|
196
134
|
earlierData,
|
|
197
|
-
|
|
198
|
-
outputBasket: {
|
|
199
|
-
idMap: { 200: 200 },
|
|
200
|
-
entityName: 'OutputBasket',
|
|
201
|
-
maxUpdated_at: undefined,
|
|
202
|
-
count: 0
|
|
203
|
-
},
|
|
204
|
-
output: {
|
|
205
|
-
idMap: {},
|
|
206
|
-
entityName: 'Output',
|
|
207
|
-
maxUpdated_at: undefined,
|
|
208
|
-
count: 0
|
|
209
|
-
},
|
|
210
|
-
transaction: {
|
|
211
|
-
idMap: {},
|
|
212
|
-
entityName: 'Transaction',
|
|
213
|
-
maxUpdated_at: undefined,
|
|
214
|
-
count: 0
|
|
215
|
-
},
|
|
216
|
-
provenTx: {
|
|
217
|
-
idMap: {},
|
|
218
|
-
entityName: 'ProvenTx',
|
|
219
|
-
maxUpdated_at: undefined,
|
|
220
|
-
count: 0
|
|
221
|
-
},
|
|
222
|
-
outputTag: {
|
|
223
|
-
idMap: {},
|
|
224
|
-
entityName: 'OutputTag',
|
|
225
|
-
maxUpdated_at: undefined,
|
|
226
|
-
count: 0
|
|
227
|
-
},
|
|
228
|
-
provenTxReq: {
|
|
229
|
-
idMap: {},
|
|
230
|
-
entityName: 'ProvenTxReq',
|
|
231
|
-
maxUpdated_at: undefined,
|
|
232
|
-
count: 0
|
|
233
|
-
},
|
|
234
|
-
txLabel: {
|
|
235
|
-
idMap: {},
|
|
236
|
-
entityName: 'TxLabel',
|
|
237
|
-
maxUpdated_at: undefined,
|
|
238
|
-
count: 0
|
|
239
|
-
},
|
|
240
|
-
txLabelMap: {
|
|
241
|
-
idMap: {},
|
|
242
|
-
entityName: 'TxLabelMap',
|
|
243
|
-
maxUpdated_at: undefined,
|
|
244
|
-
count: 0
|
|
245
|
-
},
|
|
246
|
-
outputTagMap: {
|
|
247
|
-
idMap: {},
|
|
248
|
-
entityName: 'OutputTagMap',
|
|
249
|
-
maxUpdated_at: undefined,
|
|
250
|
-
count: 0
|
|
251
|
-
},
|
|
252
|
-
certificate: {
|
|
253
|
-
idMap: {},
|
|
254
|
-
entityName: 'Certificate',
|
|
255
|
-
maxUpdated_at: undefined,
|
|
256
|
-
count: 0
|
|
257
|
-
},
|
|
258
|
-
certificateField: {
|
|
259
|
-
idMap: {},
|
|
260
|
-
entityName: 'CertificateField',
|
|
261
|
-
maxUpdated_at: undefined,
|
|
262
|
-
count: 0
|
|
263
|
-
},
|
|
264
|
-
commission: {
|
|
265
|
-
idMap: {},
|
|
266
|
-
entityName: 'Commission',
|
|
267
|
-
maxUpdated_at: undefined,
|
|
268
|
-
count: 0
|
|
269
|
-
}
|
|
270
|
-
},
|
|
135
|
+
syncMap,
|
|
271
136
|
undefined // `trx` is not used
|
|
272
137
|
)
|
|
273
138
|
|
|
@@ -296,7 +161,7 @@ describe('OutputBasket class method tests', () => {
|
|
|
296
161
|
const ctx = ctxs[0]
|
|
297
162
|
|
|
298
163
|
// Insert two identical OutputBasket records in the database
|
|
299
|
-
const basketData:
|
|
164
|
+
const basketData: TableOutputBasket = {
|
|
300
165
|
basketId: 401,
|
|
301
166
|
created_at: new Date('2023-01-01'),
|
|
302
167
|
updated_at: new Date('2023-01-02'),
|
|
@@ -310,87 +175,14 @@ describe('OutputBasket class method tests', () => {
|
|
|
310
175
|
await ctx.activeStorage.insertOutputBasket(basketData)
|
|
311
176
|
|
|
312
177
|
// Create two identical entities
|
|
313
|
-
const entity1 = new
|
|
314
|
-
const entity2 = new
|
|
178
|
+
const entity1 = new EntityOutputBasket(basketData)
|
|
179
|
+
const entity2 = new EntityOutputBasket(basketData)
|
|
315
180
|
|
|
316
181
|
// Test: equals returns true for identical entities without SyncMap
|
|
317
182
|
expect(entity1.equals(entity2.toApi())).toBe(true)
|
|
318
183
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
outputBasket: {
|
|
322
|
-
idMap: { 401: 401 },
|
|
323
|
-
entityName: 'OutputBasket',
|
|
324
|
-
maxUpdated_at: undefined,
|
|
325
|
-
count: 0
|
|
326
|
-
},
|
|
327
|
-
transaction: {
|
|
328
|
-
idMap: {},
|
|
329
|
-
entityName: 'Transaction',
|
|
330
|
-
maxUpdated_at: undefined,
|
|
331
|
-
count: 0
|
|
332
|
-
},
|
|
333
|
-
provenTx: {
|
|
334
|
-
idMap: {},
|
|
335
|
-
entityName: 'ProvenTx',
|
|
336
|
-
maxUpdated_at: undefined,
|
|
337
|
-
count: 0
|
|
338
|
-
},
|
|
339
|
-
output: {
|
|
340
|
-
idMap: {},
|
|
341
|
-
entityName: 'Output',
|
|
342
|
-
maxUpdated_at: undefined,
|
|
343
|
-
count: 0
|
|
344
|
-
},
|
|
345
|
-
outputTag: {
|
|
346
|
-
idMap: {},
|
|
347
|
-
entityName: 'OutputTag',
|
|
348
|
-
maxUpdated_at: undefined,
|
|
349
|
-
count: 0
|
|
350
|
-
},
|
|
351
|
-
provenTxReq: {
|
|
352
|
-
idMap: {},
|
|
353
|
-
entityName: 'ProvenTxReq',
|
|
354
|
-
maxUpdated_at: undefined,
|
|
355
|
-
count: 0
|
|
356
|
-
},
|
|
357
|
-
txLabel: {
|
|
358
|
-
idMap: {},
|
|
359
|
-
entityName: 'TxLabel',
|
|
360
|
-
maxUpdated_at: undefined,
|
|
361
|
-
count: 0
|
|
362
|
-
},
|
|
363
|
-
txLabelMap: {
|
|
364
|
-
idMap: {},
|
|
365
|
-
entityName: 'TxLabelMap',
|
|
366
|
-
maxUpdated_at: undefined,
|
|
367
|
-
count: 0
|
|
368
|
-
},
|
|
369
|
-
outputTagMap: {
|
|
370
|
-
idMap: {},
|
|
371
|
-
entityName: 'OutputTagMap',
|
|
372
|
-
maxUpdated_at: undefined,
|
|
373
|
-
count: 0
|
|
374
|
-
},
|
|
375
|
-
certificate: {
|
|
376
|
-
idMap: {},
|
|
377
|
-
entityName: 'Certificate',
|
|
378
|
-
maxUpdated_at: undefined,
|
|
379
|
-
count: 0
|
|
380
|
-
},
|
|
381
|
-
certificateField: {
|
|
382
|
-
idMap: {},
|
|
383
|
-
entityName: 'CertificateField',
|
|
384
|
-
maxUpdated_at: undefined,
|
|
385
|
-
count: 0
|
|
386
|
-
},
|
|
387
|
-
commission: {
|
|
388
|
-
idMap: {},
|
|
389
|
-
entityName: 'Commission',
|
|
390
|
-
maxUpdated_at: undefined,
|
|
391
|
-
count: 0
|
|
392
|
-
}
|
|
393
|
-
}
|
|
184
|
+
const syncMap = createSyncMap()
|
|
185
|
+
syncMap.outputBasket.idMap[401] = 401
|
|
394
186
|
|
|
395
187
|
// Test: equals returns true for identical entities with SyncMap
|
|
396
188
|
expect(entity1.equals(entity2.toApi(), syncMap)).toBe(true)
|
|
@@ -400,7 +192,7 @@ describe('OutputBasket class method tests', () => {
|
|
|
400
192
|
const ctx = ctxs[0]
|
|
401
193
|
|
|
402
194
|
// Insert two different OutputBasket records in the database
|
|
403
|
-
const basketData1:
|
|
195
|
+
const basketData1: TableOutputBasket = {
|
|
404
196
|
basketId: 402,
|
|
405
197
|
created_at: new Date('2023-01-01'),
|
|
406
198
|
updated_at: new Date('2023-01-02'),
|
|
@@ -411,7 +203,7 @@ describe('OutputBasket class method tests', () => {
|
|
|
411
203
|
isDeleted: false
|
|
412
204
|
}
|
|
413
205
|
|
|
414
|
-
const basketData2:
|
|
206
|
+
const basketData2: TableOutputBasket = {
|
|
415
207
|
basketId: 403,
|
|
416
208
|
created_at: new Date('2023-01-01'),
|
|
417
209
|
updated_at: new Date('2023-01-02'),
|
|
@@ -426,87 +218,14 @@ describe('OutputBasket class method tests', () => {
|
|
|
426
218
|
await ctx.activeStorage.insertOutputBasket(basketData2)
|
|
427
219
|
|
|
428
220
|
// Create entities
|
|
429
|
-
const entity1 = new
|
|
430
|
-
const entity2 = new
|
|
221
|
+
const entity1 = new EntityOutputBasket(basketData1)
|
|
222
|
+
const entity2 = new EntityOutputBasket(basketData2)
|
|
431
223
|
|
|
432
224
|
// Test: equals returns false for different entities without SyncMap
|
|
433
225
|
expect(entity1.equals(entity2.toApi())).toBe(false)
|
|
434
226
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
outputBasket: {
|
|
438
|
-
idMap: { 1: 2 }, // Mismatched mapping
|
|
439
|
-
entityName: 'OutputBasket',
|
|
440
|
-
maxUpdated_at: undefined,
|
|
441
|
-
count: 0
|
|
442
|
-
},
|
|
443
|
-
output: {
|
|
444
|
-
idMap: {},
|
|
445
|
-
entityName: 'Output',
|
|
446
|
-
maxUpdated_at: undefined,
|
|
447
|
-
count: 0
|
|
448
|
-
},
|
|
449
|
-
transaction: {
|
|
450
|
-
idMap: {},
|
|
451
|
-
entityName: 'Transaction',
|
|
452
|
-
maxUpdated_at: undefined,
|
|
453
|
-
count: 0
|
|
454
|
-
},
|
|
455
|
-
provenTx: {
|
|
456
|
-
idMap: {},
|
|
457
|
-
entityName: 'ProvenTx',
|
|
458
|
-
maxUpdated_at: undefined,
|
|
459
|
-
count: 0
|
|
460
|
-
},
|
|
461
|
-
outputTag: {
|
|
462
|
-
idMap: {},
|
|
463
|
-
entityName: 'OutputTag',
|
|
464
|
-
maxUpdated_at: undefined,
|
|
465
|
-
count: 0
|
|
466
|
-
},
|
|
467
|
-
provenTxReq: {
|
|
468
|
-
idMap: {},
|
|
469
|
-
entityName: 'ProvenTxReq',
|
|
470
|
-
maxUpdated_at: undefined,
|
|
471
|
-
count: 0
|
|
472
|
-
},
|
|
473
|
-
txLabel: {
|
|
474
|
-
idMap: {},
|
|
475
|
-
entityName: 'TxLabel',
|
|
476
|
-
maxUpdated_at: undefined,
|
|
477
|
-
count: 0
|
|
478
|
-
},
|
|
479
|
-
txLabelMap: {
|
|
480
|
-
idMap: {},
|
|
481
|
-
entityName: 'TxLabelMap',
|
|
482
|
-
maxUpdated_at: undefined,
|
|
483
|
-
count: 0
|
|
484
|
-
},
|
|
485
|
-
outputTagMap: {
|
|
486
|
-
idMap: {},
|
|
487
|
-
entityName: 'OutputTagMap',
|
|
488
|
-
maxUpdated_at: undefined,
|
|
489
|
-
count: 0
|
|
490
|
-
},
|
|
491
|
-
certificate: {
|
|
492
|
-
idMap: {},
|
|
493
|
-
entityName: 'Certificate',
|
|
494
|
-
maxUpdated_at: undefined,
|
|
495
|
-
count: 0
|
|
496
|
-
},
|
|
497
|
-
certificateField: {
|
|
498
|
-
idMap: {},
|
|
499
|
-
entityName: 'CertificateField',
|
|
500
|
-
maxUpdated_at: undefined,
|
|
501
|
-
count: 0
|
|
502
|
-
},
|
|
503
|
-
commission: {
|
|
504
|
-
idMap: {},
|
|
505
|
-
entityName: 'Commission',
|
|
506
|
-
maxUpdated_at: undefined,
|
|
507
|
-
count: 0
|
|
508
|
-
}
|
|
509
|
-
}
|
|
227
|
+
const syncMap = createSyncMap()
|
|
228
|
+
syncMap.outputBasket.idMap[1] = 2
|
|
510
229
|
|
|
511
230
|
// Test: equals returns false for different entities with SyncMap
|
|
512
231
|
expect(entity1.equals(entity2.toApi(), syncMap)).toBe(false)
|
|
@@ -514,7 +233,7 @@ describe('OutputBasket class method tests', () => {
|
|
|
514
233
|
|
|
515
234
|
test('OutputBasket getters, setters, and updateApi', () => {
|
|
516
235
|
// Create a mock OutputBasket instance
|
|
517
|
-
const initialData:
|
|
236
|
+
const initialData: TableOutputBasket = {
|
|
518
237
|
basketId: 123,
|
|
519
238
|
created_at: new Date('2023-01-01'),
|
|
520
239
|
updated_at: new Date('2023-01-02'),
|
|
@@ -525,7 +244,7 @@ describe('OutputBasket class method tests', () => {
|
|
|
525
244
|
isDeleted: false
|
|
526
245
|
}
|
|
527
246
|
|
|
528
|
-
const entity = new
|
|
247
|
+
const entity = new EntityOutputBasket(initialData)
|
|
529
248
|
|
|
530
249
|
// Test getters
|
|
531
250
|
expect(entity.basketId).toBe(123)
|
|
@@ -537,7 +256,7 @@ describe('OutputBasket class method tests', () => {
|
|
|
537
256
|
expect(entity.minimumDesiredUTXOValue).toBe(1000)
|
|
538
257
|
expect(entity.isDeleted).toBe(false)
|
|
539
258
|
expect(entity.id).toBe(123)
|
|
540
|
-
expect(entity.entityName).toBe('
|
|
259
|
+
expect(entity.entityName).toBe('outputBasket')
|
|
541
260
|
expect(entity.entityTable).toBe('output_baskets')
|
|
542
261
|
|
|
543
262
|
// Test setters
|