@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
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as bsv from '@bsv/sdk'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
createSyncMap,
|
|
4
|
+
sdk,
|
|
5
|
+
SyncMap,
|
|
6
|
+
TableOutputTagMap
|
|
7
|
+
} from '../../../../../src'
|
|
3
8
|
import {
|
|
4
9
|
TestUtilsWalletStorage as _tu,
|
|
5
10
|
TestWalletNoSetup
|
|
6
11
|
} from '../../../../../test/utils/TestUtilsWalletStorage'
|
|
7
|
-
import {
|
|
12
|
+
import { EntityOutputTagMap } from '../../../../../src/storage/schema/entities/OutputTagMap'
|
|
8
13
|
|
|
9
14
|
describe('OutputTagMap class method tests', () => {
|
|
10
15
|
jest.setTimeout(99999999)
|
|
@@ -33,7 +38,7 @@ describe('OutputTagMap class method tests', () => {
|
|
|
33
38
|
|
|
34
39
|
test('0_OutputTagMap getters and setters', async () => {
|
|
35
40
|
const now = new Date()
|
|
36
|
-
const initialData:
|
|
41
|
+
const initialData: TableOutputTagMap = {
|
|
37
42
|
created_at: now,
|
|
38
43
|
updated_at: now,
|
|
39
44
|
outputId: 1,
|
|
@@ -41,7 +46,7 @@ describe('OutputTagMap class method tests', () => {
|
|
|
41
46
|
isDeleted: false
|
|
42
47
|
}
|
|
43
48
|
|
|
44
|
-
const outputTagMap = new
|
|
49
|
+
const outputTagMap = new EntityOutputTagMap(initialData)
|
|
45
50
|
|
|
46
51
|
// Test getters
|
|
47
52
|
expect(outputTagMap.outputTagId).toBe(2)
|
|
@@ -49,7 +54,7 @@ describe('OutputTagMap class method tests', () => {
|
|
|
49
54
|
expect(outputTagMap.created_at).toBe(now)
|
|
50
55
|
expect(outputTagMap.updated_at).toBe(now)
|
|
51
56
|
expect(outputTagMap.isDeleted).toBe(false)
|
|
52
|
-
expect(outputTagMap.entityName).toBe('
|
|
57
|
+
expect(outputTagMap.entityName).toBe('outputTagMap')
|
|
53
58
|
expect(outputTagMap.entityTable).toBe('output_tags_map')
|
|
54
59
|
|
|
55
60
|
// Test setters
|
|
@@ -75,7 +80,7 @@ describe('OutputTagMap class method tests', () => {
|
|
|
75
80
|
const ctx2 = ctxs2[0]
|
|
76
81
|
|
|
77
82
|
// Insert matching OutputTagMap records into both databases
|
|
78
|
-
const outputTagMapData:
|
|
83
|
+
const outputTagMapData: TableOutputTagMap = {
|
|
79
84
|
created_at: new Date('2023-01-01'),
|
|
80
85
|
updated_at: new Date('2023-01-02'),
|
|
81
86
|
outputId: 1,
|
|
@@ -87,84 +92,12 @@ describe('OutputTagMap class method tests', () => {
|
|
|
87
92
|
await ctx2.activeStorage.insertOutputTagMap(outputTagMapData)
|
|
88
93
|
|
|
89
94
|
// Create entities from the records
|
|
90
|
-
const entity1 = new
|
|
91
|
-
const entity2 = new
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
idMap: { 1: 1 },
|
|
97
|
-
entityName: 'Output',
|
|
98
|
-
maxUpdated_at: undefined,
|
|
99
|
-
count: 0
|
|
100
|
-
},
|
|
101
|
-
outputTag: {
|
|
102
|
-
idMap: { 8: 8 },
|
|
103
|
-
entityName: 'OutputTag',
|
|
104
|
-
maxUpdated_at: undefined,
|
|
105
|
-
count: 0
|
|
106
|
-
},
|
|
107
|
-
provenTx: {
|
|
108
|
-
idMap: {},
|
|
109
|
-
entityName: 'ProvenTx',
|
|
110
|
-
maxUpdated_at: undefined,
|
|
111
|
-
count: 0
|
|
112
|
-
},
|
|
113
|
-
transaction: {
|
|
114
|
-
idMap: {},
|
|
115
|
-
entityName: 'Transaction',
|
|
116
|
-
maxUpdated_at: undefined,
|
|
117
|
-
count: 0
|
|
118
|
-
},
|
|
119
|
-
outputBasket: {
|
|
120
|
-
idMap: {},
|
|
121
|
-
entityName: 'OutputBasket',
|
|
122
|
-
maxUpdated_at: undefined,
|
|
123
|
-
count: 0
|
|
124
|
-
},
|
|
125
|
-
provenTxReq: {
|
|
126
|
-
idMap: {},
|
|
127
|
-
entityName: 'ProvenTxReq',
|
|
128
|
-
maxUpdated_at: undefined,
|
|
129
|
-
count: 0
|
|
130
|
-
},
|
|
131
|
-
txLabel: {
|
|
132
|
-
idMap: {},
|
|
133
|
-
entityName: 'TxLabel',
|
|
134
|
-
maxUpdated_at: undefined,
|
|
135
|
-
count: 0
|
|
136
|
-
},
|
|
137
|
-
txLabelMap: {
|
|
138
|
-
idMap: {},
|
|
139
|
-
entityName: 'TxLabelMap',
|
|
140
|
-
maxUpdated_at: undefined,
|
|
141
|
-
count: 0
|
|
142
|
-
},
|
|
143
|
-
outputTagMap: {
|
|
144
|
-
idMap: {},
|
|
145
|
-
entityName: 'OutputTagMap',
|
|
146
|
-
maxUpdated_at: undefined,
|
|
147
|
-
count: 0
|
|
148
|
-
},
|
|
149
|
-
certificate: {
|
|
150
|
-
idMap: {},
|
|
151
|
-
entityName: 'Certificate',
|
|
152
|
-
maxUpdated_at: undefined,
|
|
153
|
-
count: 0
|
|
154
|
-
},
|
|
155
|
-
certificateField: {
|
|
156
|
-
idMap: {},
|
|
157
|
-
entityName: 'CertificateField',
|
|
158
|
-
maxUpdated_at: undefined,
|
|
159
|
-
count: 0
|
|
160
|
-
},
|
|
161
|
-
commission: {
|
|
162
|
-
idMap: {},
|
|
163
|
-
entityName: 'Commission',
|
|
164
|
-
maxUpdated_at: undefined,
|
|
165
|
-
count: 0
|
|
166
|
-
}
|
|
167
|
-
}
|
|
95
|
+
const entity1 = new EntityOutputTagMap(outputTagMapData)
|
|
96
|
+
const entity2 = new EntityOutputTagMap(outputTagMapData)
|
|
97
|
+
|
|
98
|
+
const syncMap = createSyncMap()
|
|
99
|
+
syncMap.output.idMap[1] = 1
|
|
100
|
+
syncMap.outputTag.idMap[8] = 8
|
|
168
101
|
|
|
169
102
|
// Verify that equals returns true
|
|
170
103
|
expect(entity1.equals(entity2.toApi(), syncMap)).toBe(true)
|
|
@@ -175,7 +108,7 @@ describe('OutputTagMap class method tests', () => {
|
|
|
175
108
|
const ctx2 = ctxs2[0]
|
|
176
109
|
|
|
177
110
|
// Insert mismatched OutputTagMap records into both databases
|
|
178
|
-
const outputTagMapData1:
|
|
111
|
+
const outputTagMapData1: TableOutputTagMap = {
|
|
179
112
|
created_at: new Date('2023-01-01'),
|
|
180
113
|
updated_at: new Date('2023-01-02'),
|
|
181
114
|
outputId: 1,
|
|
@@ -183,7 +116,7 @@ describe('OutputTagMap class method tests', () => {
|
|
|
183
116
|
isDeleted: false
|
|
184
117
|
}
|
|
185
118
|
|
|
186
|
-
const outputTagMapData2:
|
|
119
|
+
const outputTagMapData2: TableOutputTagMap = {
|
|
187
120
|
created_at: new Date('2023-01-01'),
|
|
188
121
|
updated_at: new Date('2023-01-02'),
|
|
189
122
|
outputId: 1, // Mismatched outputId
|
|
@@ -195,84 +128,11 @@ describe('OutputTagMap class method tests', () => {
|
|
|
195
128
|
await ctx2.activeStorage.insertOutputTagMap(outputTagMapData2)
|
|
196
129
|
|
|
197
130
|
// Create entities from the records
|
|
198
|
-
const entity1 = new
|
|
199
|
-
const entity2 = new
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
output: {
|
|
204
|
-
idMap: { 101: 102 },
|
|
205
|
-
entityName: 'Output',
|
|
206
|
-
maxUpdated_at: undefined,
|
|
207
|
-
count: 0
|
|
208
|
-
},
|
|
209
|
-
outputTag: {
|
|
210
|
-
idMap: { 201: 202 },
|
|
211
|
-
entityName: 'OutputTag',
|
|
212
|
-
maxUpdated_at: undefined,
|
|
213
|
-
count: 0
|
|
214
|
-
},
|
|
215
|
-
provenTx: {
|
|
216
|
-
idMap: {},
|
|
217
|
-
entityName: 'ProvenTx',
|
|
218
|
-
maxUpdated_at: undefined,
|
|
219
|
-
count: 0
|
|
220
|
-
},
|
|
221
|
-
transaction: {
|
|
222
|
-
idMap: {},
|
|
223
|
-
entityName: 'Transaction',
|
|
224
|
-
maxUpdated_at: undefined,
|
|
225
|
-
count: 0
|
|
226
|
-
},
|
|
227
|
-
outputBasket: {
|
|
228
|
-
idMap: {},
|
|
229
|
-
entityName: 'OutputBasket',
|
|
230
|
-
maxUpdated_at: undefined,
|
|
231
|
-
count: 0
|
|
232
|
-
},
|
|
233
|
-
provenTxReq: {
|
|
234
|
-
idMap: {},
|
|
235
|
-
entityName: 'ProvenTxReq',
|
|
236
|
-
maxUpdated_at: undefined,
|
|
237
|
-
count: 0
|
|
238
|
-
},
|
|
239
|
-
txLabel: {
|
|
240
|
-
idMap: {},
|
|
241
|
-
entityName: 'TxLabel',
|
|
242
|
-
maxUpdated_at: undefined,
|
|
243
|
-
count: 0
|
|
244
|
-
},
|
|
245
|
-
txLabelMap: {
|
|
246
|
-
idMap: {},
|
|
247
|
-
entityName: 'TxLabelMap',
|
|
248
|
-
maxUpdated_at: undefined,
|
|
249
|
-
count: 0
|
|
250
|
-
},
|
|
251
|
-
outputTagMap: {
|
|
252
|
-
idMap: {},
|
|
253
|
-
entityName: 'OutputTagMap',
|
|
254
|
-
maxUpdated_at: undefined,
|
|
255
|
-
count: 0
|
|
256
|
-
},
|
|
257
|
-
certificate: {
|
|
258
|
-
idMap: {},
|
|
259
|
-
entityName: 'Certificate',
|
|
260
|
-
maxUpdated_at: undefined,
|
|
261
|
-
count: 0
|
|
262
|
-
},
|
|
263
|
-
certificateField: {
|
|
264
|
-
idMap: {},
|
|
265
|
-
entityName: 'CertificateField',
|
|
266
|
-
maxUpdated_at: undefined,
|
|
267
|
-
count: 0
|
|
268
|
-
},
|
|
269
|
-
commission: {
|
|
270
|
-
idMap: {},
|
|
271
|
-
entityName: 'Commission',
|
|
272
|
-
maxUpdated_at: undefined,
|
|
273
|
-
count: 0
|
|
274
|
-
}
|
|
275
|
-
}
|
|
131
|
+
const entity1 = new EntityOutputTagMap(outputTagMapData1)
|
|
132
|
+
const entity2 = new EntityOutputTagMap(outputTagMapData2)
|
|
133
|
+
|
|
134
|
+
const syncMap = createSyncMap()
|
|
135
|
+
syncMap.output.idMap[101] = 101
|
|
276
136
|
|
|
277
137
|
// Verify that equals returns false due to mismatched properties
|
|
278
138
|
expect(entity1.equals(entity2.toApi(), syncMap)).toBe(false)
|
|
@@ -285,7 +145,7 @@ describe('OutputTagMap class method tests', () => {
|
|
|
285
145
|
const ctx = ctxs[0]
|
|
286
146
|
|
|
287
147
|
// Insert initial OutputTagMap record with valid foreign key IDs
|
|
288
|
-
const initialData:
|
|
148
|
+
const initialData: TableOutputTagMap = {
|
|
289
149
|
created_at: new Date('2023-01-01'),
|
|
290
150
|
updated_at: new Date('2023-01-02'),
|
|
291
151
|
outputId: 2,
|
|
@@ -295,94 +155,24 @@ describe('OutputTagMap class method tests', () => {
|
|
|
295
155
|
await ctx.activeStorage.insertOutputTagMap(initialData)
|
|
296
156
|
|
|
297
157
|
// Create an OutputTagMap entity from the initial data
|
|
298
|
-
const entity = new
|
|
158
|
+
const entity = new EntityOutputTagMap(initialData)
|
|
299
159
|
|
|
300
160
|
// Create a new record to simulate the `ei` argument with a later `updated_at`
|
|
301
|
-
const updatedData:
|
|
161
|
+
const updatedData: TableOutputTagMap = {
|
|
302
162
|
...initialData,
|
|
303
163
|
updated_at: new Date('2023-01-03'), // Later timestamp
|
|
304
164
|
isDeleted: true // Simulate a change in `isDeleted`
|
|
305
165
|
}
|
|
306
166
|
|
|
167
|
+
const syncMap = createSyncMap()
|
|
168
|
+
syncMap.output.idMap[1] = 1
|
|
169
|
+
|
|
307
170
|
// Call mergeExisting
|
|
308
171
|
const wasMergedRaw = await entity.mergeExisting(
|
|
309
172
|
ctx.activeStorage,
|
|
310
173
|
undefined, // `since` is not used in this method
|
|
311
174
|
updatedData,
|
|
312
|
-
|
|
313
|
-
output: {
|
|
314
|
-
idMap: { 1: 1 },
|
|
315
|
-
entityName: 'Output',
|
|
316
|
-
maxUpdated_at: undefined,
|
|
317
|
-
count: 0
|
|
318
|
-
},
|
|
319
|
-
outputTag: {
|
|
320
|
-
idMap: { 8: 8 },
|
|
321
|
-
entityName: 'OutputTag',
|
|
322
|
-
maxUpdated_at: undefined,
|
|
323
|
-
count: 0
|
|
324
|
-
},
|
|
325
|
-
provenTx: {
|
|
326
|
-
idMap: {},
|
|
327
|
-
entityName: 'ProvenTx',
|
|
328
|
-
maxUpdated_at: undefined,
|
|
329
|
-
count: 0
|
|
330
|
-
},
|
|
331
|
-
transaction: {
|
|
332
|
-
idMap: {},
|
|
333
|
-
entityName: 'Transaction',
|
|
334
|
-
maxUpdated_at: undefined,
|
|
335
|
-
count: 0
|
|
336
|
-
},
|
|
337
|
-
outputBasket: {
|
|
338
|
-
idMap: {},
|
|
339
|
-
entityName: 'OutputBasket',
|
|
340
|
-
maxUpdated_at: undefined,
|
|
341
|
-
count: 0
|
|
342
|
-
},
|
|
343
|
-
provenTxReq: {
|
|
344
|
-
idMap: {},
|
|
345
|
-
entityName: 'ProvenTxReq',
|
|
346
|
-
maxUpdated_at: undefined,
|
|
347
|
-
count: 0
|
|
348
|
-
},
|
|
349
|
-
txLabel: {
|
|
350
|
-
idMap: {},
|
|
351
|
-
entityName: 'TxLabel',
|
|
352
|
-
maxUpdated_at: undefined,
|
|
353
|
-
count: 0
|
|
354
|
-
},
|
|
355
|
-
txLabelMap: {
|
|
356
|
-
idMap: {},
|
|
357
|
-
entityName: 'TxLabelMap',
|
|
358
|
-
maxUpdated_at: undefined,
|
|
359
|
-
count: 0
|
|
360
|
-
},
|
|
361
|
-
outputTagMap: {
|
|
362
|
-
idMap: {},
|
|
363
|
-
entityName: 'OutputTagMap',
|
|
364
|
-
maxUpdated_at: undefined,
|
|
365
|
-
count: 0
|
|
366
|
-
},
|
|
367
|
-
certificate: {
|
|
368
|
-
idMap: {},
|
|
369
|
-
entityName: 'Certificate',
|
|
370
|
-
maxUpdated_at: undefined,
|
|
371
|
-
count: 0
|
|
372
|
-
},
|
|
373
|
-
certificateField: {
|
|
374
|
-
idMap: {},
|
|
375
|
-
entityName: 'CertificateField',
|
|
376
|
-
maxUpdated_at: undefined,
|
|
377
|
-
count: 0
|
|
378
|
-
},
|
|
379
|
-
commission: {
|
|
380
|
-
idMap: {},
|
|
381
|
-
entityName: 'Commission',
|
|
382
|
-
maxUpdated_at: undefined,
|
|
383
|
-
count: 0
|
|
384
|
-
}
|
|
385
|
-
}
|
|
175
|
+
syncMap
|
|
386
176
|
)
|
|
387
177
|
|
|
388
178
|
const wasMerged = Boolean(wasMergedRaw)
|
|
@@ -411,7 +201,7 @@ describe('OutputTagMap class method tests', () => {
|
|
|
411
201
|
const ctx = ctxs[0]
|
|
412
202
|
|
|
413
203
|
// Insert initial OutputTagMap record
|
|
414
|
-
const initialData:
|
|
204
|
+
const initialData: TableOutputTagMap = {
|
|
415
205
|
created_at: new Date('2023-01-01'),
|
|
416
206
|
updated_at: new Date('2023-01-02'),
|
|
417
207
|
outputId: 2,
|
|
@@ -421,94 +211,24 @@ describe('OutputTagMap class method tests', () => {
|
|
|
421
211
|
await ctx.activeStorage.insertOutputTagMap(initialData)
|
|
422
212
|
|
|
423
213
|
// Create an OutputTagMap entity from the initial data
|
|
424
|
-
const entity = new
|
|
214
|
+
const entity = new EntityOutputTagMap(initialData)
|
|
425
215
|
|
|
426
216
|
// Create a new record to simulate the `ei` argument with an earlier `updated_at`
|
|
427
|
-
const earlierData:
|
|
217
|
+
const earlierData: TableOutputTagMap = {
|
|
428
218
|
...initialData,
|
|
429
219
|
updated_at: new Date('2023-01-01'), // Earlier timestamp
|
|
430
220
|
isDeleted: true // Simulate a change in `isDeleted`
|
|
431
221
|
}
|
|
432
222
|
|
|
223
|
+
const syncMap = createSyncMap()
|
|
224
|
+
syncMap.output.idMap[101] = 101
|
|
225
|
+
|
|
433
226
|
// Call mergeExisting
|
|
434
227
|
const wasMergedRaw = await entity.mergeExisting(
|
|
435
228
|
ctx.activeStorage,
|
|
436
229
|
undefined, // `since` is not used in this method
|
|
437
230
|
earlierData,
|
|
438
|
-
|
|
439
|
-
output: {
|
|
440
|
-
idMap: { 101: 101 },
|
|
441
|
-
entityName: 'Output',
|
|
442
|
-
maxUpdated_at: undefined,
|
|
443
|
-
count: 0
|
|
444
|
-
},
|
|
445
|
-
outputTag: {
|
|
446
|
-
idMap: { 201: 201 },
|
|
447
|
-
entityName: 'OutputTag',
|
|
448
|
-
maxUpdated_at: undefined,
|
|
449
|
-
count: 0
|
|
450
|
-
},
|
|
451
|
-
provenTx: {
|
|
452
|
-
idMap: {},
|
|
453
|
-
entityName: 'ProvenTx',
|
|
454
|
-
maxUpdated_at: undefined,
|
|
455
|
-
count: 0
|
|
456
|
-
},
|
|
457
|
-
transaction: {
|
|
458
|
-
idMap: {},
|
|
459
|
-
entityName: 'Transaction',
|
|
460
|
-
maxUpdated_at: undefined,
|
|
461
|
-
count: 0
|
|
462
|
-
},
|
|
463
|
-
outputBasket: {
|
|
464
|
-
idMap: {},
|
|
465
|
-
entityName: 'OutputBasket',
|
|
466
|
-
maxUpdated_at: undefined,
|
|
467
|
-
count: 0
|
|
468
|
-
},
|
|
469
|
-
provenTxReq: {
|
|
470
|
-
idMap: {},
|
|
471
|
-
entityName: 'ProvenTxReq',
|
|
472
|
-
maxUpdated_at: undefined,
|
|
473
|
-
count: 0
|
|
474
|
-
},
|
|
475
|
-
txLabel: {
|
|
476
|
-
idMap: {},
|
|
477
|
-
entityName: 'TxLabel',
|
|
478
|
-
maxUpdated_at: undefined,
|
|
479
|
-
count: 0
|
|
480
|
-
},
|
|
481
|
-
txLabelMap: {
|
|
482
|
-
idMap: {},
|
|
483
|
-
entityName: 'TxLabelMap',
|
|
484
|
-
maxUpdated_at: undefined,
|
|
485
|
-
count: 0
|
|
486
|
-
},
|
|
487
|
-
outputTagMap: {
|
|
488
|
-
idMap: {},
|
|
489
|
-
entityName: 'OutputTagMap',
|
|
490
|
-
maxUpdated_at: undefined,
|
|
491
|
-
count: 0
|
|
492
|
-
},
|
|
493
|
-
certificate: {
|
|
494
|
-
idMap: {},
|
|
495
|
-
entityName: 'Certificate',
|
|
496
|
-
maxUpdated_at: undefined,
|
|
497
|
-
count: 0
|
|
498
|
-
},
|
|
499
|
-
certificateField: {
|
|
500
|
-
idMap: {},
|
|
501
|
-
entityName: 'CertificateField',
|
|
502
|
-
maxUpdated_at: undefined,
|
|
503
|
-
count: 0
|
|
504
|
-
},
|
|
505
|
-
commission: {
|
|
506
|
-
idMap: {},
|
|
507
|
-
entityName: 'Commission',
|
|
508
|
-
maxUpdated_at: undefined,
|
|
509
|
-
count: 0
|
|
510
|
-
}
|
|
511
|
-
}
|
|
231
|
+
syncMap
|
|
512
232
|
)
|
|
513
233
|
|
|
514
234
|
// Normalize the result
|