@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,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createSyncMap, sdk, SyncMap, TableOutputTag } from '../../../../../src'
|
|
2
2
|
import {
|
|
3
3
|
TestUtilsWalletStorage as _tu,
|
|
4
4
|
TestWalletNoSetup
|
|
5
5
|
} from '../../../../../test/utils/TestUtilsWalletStorage'
|
|
6
|
-
import {
|
|
6
|
+
import { EntityOutputTag } from '../../../../../src/storage/schema/entities/OutputTag'
|
|
7
7
|
|
|
8
8
|
describe('OutputTag class method tests', () => {
|
|
9
9
|
jest.setTimeout(99999999)
|
|
@@ -34,7 +34,7 @@ describe('OutputTag class method tests', () => {
|
|
|
34
34
|
const ctx = ctxs[0]
|
|
35
35
|
|
|
36
36
|
// Insert initial OutputTag record with valid userId
|
|
37
|
-
const initialData:
|
|
37
|
+
const initialData: TableOutputTag = {
|
|
38
38
|
outputTagId: 401,
|
|
39
39
|
created_at: new Date('2023-01-01'),
|
|
40
40
|
updated_at: new Date('2023-01-02'),
|
|
@@ -45,94 +45,24 @@ describe('OutputTag class method tests', () => {
|
|
|
45
45
|
await ctx.activeStorage.insertOutputTag(initialData)
|
|
46
46
|
|
|
47
47
|
// Create an OutputTag entity from the initial data
|
|
48
|
-
const entity = new
|
|
48
|
+
const entity = new EntityOutputTag(initialData)
|
|
49
49
|
|
|
50
50
|
// Simulate the `ei` argument with a later `updated_at`
|
|
51
|
-
const updatedData:
|
|
51
|
+
const updatedData: TableOutputTag = {
|
|
52
52
|
...initialData,
|
|
53
53
|
updated_at: new Date('2023-01-03'), // Later timestamp
|
|
54
54
|
isDeleted: true // Simulate a change in `isDeleted`
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
const syncMap = createSyncMap()
|
|
58
|
+
syncMap.outputTag.idMap[401] = 401
|
|
59
|
+
|
|
57
60
|
// Call mergeExisting
|
|
58
61
|
const wasMergedRaw = await entity.mergeExisting(
|
|
59
62
|
ctx.activeStorage,
|
|
60
63
|
undefined, // `since` is not used in this method
|
|
61
64
|
updatedData,
|
|
62
|
-
|
|
63
|
-
outputTag: {
|
|
64
|
-
idMap: { 401: 401 },
|
|
65
|
-
entityName: 'OutputTag',
|
|
66
|
-
maxUpdated_at: undefined,
|
|
67
|
-
count: 0
|
|
68
|
-
},
|
|
69
|
-
provenTx: {
|
|
70
|
-
idMap: {},
|
|
71
|
-
entityName: 'ProvenTx',
|
|
72
|
-
maxUpdated_at: undefined,
|
|
73
|
-
count: 0
|
|
74
|
-
},
|
|
75
|
-
outputBasket: {
|
|
76
|
-
idMap: {},
|
|
77
|
-
entityName: 'OutputBasket',
|
|
78
|
-
maxUpdated_at: undefined,
|
|
79
|
-
count: 0
|
|
80
|
-
},
|
|
81
|
-
transaction: {
|
|
82
|
-
idMap: {},
|
|
83
|
-
entityName: 'Transaction',
|
|
84
|
-
maxUpdated_at: undefined,
|
|
85
|
-
count: 0
|
|
86
|
-
},
|
|
87
|
-
provenTxReq: {
|
|
88
|
-
idMap: {},
|
|
89
|
-
entityName: 'ProvenTxReq',
|
|
90
|
-
maxUpdated_at: undefined,
|
|
91
|
-
count: 0
|
|
92
|
-
},
|
|
93
|
-
txLabel: {
|
|
94
|
-
idMap: {},
|
|
95
|
-
entityName: 'TxLabel',
|
|
96
|
-
maxUpdated_at: undefined,
|
|
97
|
-
count: 0
|
|
98
|
-
},
|
|
99
|
-
txLabelMap: {
|
|
100
|
-
idMap: {},
|
|
101
|
-
entityName: 'TxLabelMap',
|
|
102
|
-
maxUpdated_at: undefined,
|
|
103
|
-
count: 0
|
|
104
|
-
},
|
|
105
|
-
output: {
|
|
106
|
-
idMap: {},
|
|
107
|
-
entityName: 'Output',
|
|
108
|
-
maxUpdated_at: undefined,
|
|
109
|
-
count: 0
|
|
110
|
-
},
|
|
111
|
-
outputTagMap: {
|
|
112
|
-
idMap: {},
|
|
113
|
-
entityName: 'OutputTagMap',
|
|
114
|
-
maxUpdated_at: undefined,
|
|
115
|
-
count: 0
|
|
116
|
-
},
|
|
117
|
-
certificate: {
|
|
118
|
-
idMap: {},
|
|
119
|
-
entityName: 'Certificate',
|
|
120
|
-
maxUpdated_at: undefined,
|
|
121
|
-
count: 0
|
|
122
|
-
},
|
|
123
|
-
certificateField: {
|
|
124
|
-
idMap: {},
|
|
125
|
-
entityName: 'CertificateField',
|
|
126
|
-
maxUpdated_at: undefined,
|
|
127
|
-
count: 0
|
|
128
|
-
},
|
|
129
|
-
commission: {
|
|
130
|
-
idMap: {},
|
|
131
|
-
entityName: 'Commission',
|
|
132
|
-
maxUpdated_at: undefined,
|
|
133
|
-
count: 0
|
|
134
|
-
}
|
|
135
|
-
},
|
|
65
|
+
syncMap,
|
|
136
66
|
undefined
|
|
137
67
|
)
|
|
138
68
|
|
|
@@ -157,7 +87,7 @@ describe('OutputTag class method tests', () => {
|
|
|
157
87
|
const ctx = ctxs[0]
|
|
158
88
|
|
|
159
89
|
// Insert initial OutputTag record with valid userId
|
|
160
|
-
const initialData:
|
|
90
|
+
const initialData: TableOutputTag = {
|
|
161
91
|
outputTagId: 402,
|
|
162
92
|
created_at: new Date('2023-01-01'),
|
|
163
93
|
updated_at: new Date('2023-01-02'),
|
|
@@ -168,94 +98,24 @@ describe('OutputTag class method tests', () => {
|
|
|
168
98
|
await ctx.activeStorage.insertOutputTag(initialData)
|
|
169
99
|
|
|
170
100
|
// Create an OutputTag entity from the initial data
|
|
171
|
-
const entity = new
|
|
101
|
+
const entity = new EntityOutputTag(initialData)
|
|
172
102
|
|
|
173
103
|
// Simulate the `ei` argument with an earlier or equal `updated_at`
|
|
174
|
-
const earlierData:
|
|
104
|
+
const earlierData: TableOutputTag = {
|
|
175
105
|
...initialData,
|
|
176
106
|
updated_at: new Date('2023-01-01'), // Earlier timestamp
|
|
177
107
|
isDeleted: true // Simulate a change in `isDeleted`
|
|
178
108
|
}
|
|
179
109
|
|
|
110
|
+
const syncMap = createSyncMap()
|
|
111
|
+
syncMap.outputTag.idMap[1] = 1
|
|
112
|
+
|
|
180
113
|
// Call mergeExisting
|
|
181
114
|
const wasMergedRaw = await entity.mergeExisting(
|
|
182
115
|
ctx.activeStorage,
|
|
183
116
|
undefined, // `since` is not used in this method
|
|
184
117
|
earlierData,
|
|
185
|
-
|
|
186
|
-
outputTag: {
|
|
187
|
-
idMap: { 1: 1 }, // Correct mapping for outputTagId
|
|
188
|
-
entityName: 'OutputTag',
|
|
189
|
-
maxUpdated_at: undefined,
|
|
190
|
-
count: 0
|
|
191
|
-
},
|
|
192
|
-
provenTx: {
|
|
193
|
-
idMap: {},
|
|
194
|
-
entityName: 'ProvenTx',
|
|
195
|
-
maxUpdated_at: undefined,
|
|
196
|
-
count: 0
|
|
197
|
-
},
|
|
198
|
-
outputBasket: {
|
|
199
|
-
idMap: {},
|
|
200
|
-
entityName: 'OutputBasket',
|
|
201
|
-
maxUpdated_at: undefined,
|
|
202
|
-
count: 0
|
|
203
|
-
},
|
|
204
|
-
transaction: {
|
|
205
|
-
idMap: {},
|
|
206
|
-
entityName: 'Transaction',
|
|
207
|
-
maxUpdated_at: undefined,
|
|
208
|
-
count: 0
|
|
209
|
-
},
|
|
210
|
-
provenTxReq: {
|
|
211
|
-
idMap: {},
|
|
212
|
-
entityName: 'ProvenTxReq',
|
|
213
|
-
maxUpdated_at: undefined,
|
|
214
|
-
count: 0
|
|
215
|
-
},
|
|
216
|
-
txLabel: {
|
|
217
|
-
idMap: {},
|
|
218
|
-
entityName: 'TxLabel',
|
|
219
|
-
maxUpdated_at: undefined,
|
|
220
|
-
count: 0
|
|
221
|
-
},
|
|
222
|
-
txLabelMap: {
|
|
223
|
-
idMap: {},
|
|
224
|
-
entityName: 'TxLabelMap',
|
|
225
|
-
maxUpdated_at: undefined,
|
|
226
|
-
count: 0
|
|
227
|
-
},
|
|
228
|
-
output: {
|
|
229
|
-
idMap: {},
|
|
230
|
-
entityName: 'Output',
|
|
231
|
-
maxUpdated_at: undefined,
|
|
232
|
-
count: 0
|
|
233
|
-
},
|
|
234
|
-
outputTagMap: {
|
|
235
|
-
idMap: {},
|
|
236
|
-
entityName: 'OutputTagMap',
|
|
237
|
-
maxUpdated_at: undefined,
|
|
238
|
-
count: 0
|
|
239
|
-
},
|
|
240
|
-
certificate: {
|
|
241
|
-
idMap: {},
|
|
242
|
-
entityName: 'Certificate',
|
|
243
|
-
maxUpdated_at: undefined,
|
|
244
|
-
count: 0
|
|
245
|
-
},
|
|
246
|
-
certificateField: {
|
|
247
|
-
idMap: {},
|
|
248
|
-
entityName: 'CertificateField',
|
|
249
|
-
maxUpdated_at: undefined,
|
|
250
|
-
count: 0
|
|
251
|
-
},
|
|
252
|
-
commission: {
|
|
253
|
-
idMap: {},
|
|
254
|
-
entityName: 'Commission',
|
|
255
|
-
maxUpdated_at: undefined,
|
|
256
|
-
count: 0
|
|
257
|
-
}
|
|
258
|
-
},
|
|
118
|
+
syncMap,
|
|
259
119
|
undefined
|
|
260
120
|
)
|
|
261
121
|
|
|
@@ -279,7 +139,7 @@ describe('OutputTag class method tests', () => {
|
|
|
279
139
|
const ctx = ctxs[0]
|
|
280
140
|
|
|
281
141
|
// Insert matching OutputTag record into the database
|
|
282
|
-
const data:
|
|
142
|
+
const data: TableOutputTag = {
|
|
283
143
|
outputTagId: 403,
|
|
284
144
|
created_at: new Date('2023-01-01'),
|
|
285
145
|
updated_at: new Date('2023-01-02'),
|
|
@@ -290,8 +150,8 @@ describe('OutputTag class method tests', () => {
|
|
|
290
150
|
await ctx.activeStorage.insertOutputTag(data)
|
|
291
151
|
|
|
292
152
|
// Create OutputTag entities
|
|
293
|
-
const entity1 = new
|
|
294
|
-
const entity2 = new
|
|
153
|
+
const entity1 = new EntityOutputTag(data)
|
|
154
|
+
const entity2 = new EntityOutputTag(data)
|
|
295
155
|
|
|
296
156
|
// Verify that equals returns true for matching entities
|
|
297
157
|
expect(entity1.equals(entity2.toApi())).toBe(true)
|
|
@@ -301,7 +161,7 @@ describe('OutputTag class method tests', () => {
|
|
|
301
161
|
const ctx = ctxs[0]
|
|
302
162
|
|
|
303
163
|
// Insert differing OutputTag records into the database
|
|
304
|
-
const data1:
|
|
164
|
+
const data1: TableOutputTag = {
|
|
305
165
|
outputTagId: 404,
|
|
306
166
|
created_at: new Date('2023-01-01'),
|
|
307
167
|
updated_at: new Date('2023-01-02'),
|
|
@@ -314,8 +174,8 @@ describe('OutputTag class method tests', () => {
|
|
|
314
174
|
await ctx.activeStorage.insertOutputTag(data1)
|
|
315
175
|
|
|
316
176
|
// Create OutputTag entities
|
|
317
|
-
const entity1 = new
|
|
318
|
-
const entity2 = new
|
|
177
|
+
const entity1 = new EntityOutputTag(data1)
|
|
178
|
+
const entity2 = new EntityOutputTag(data2)
|
|
319
179
|
|
|
320
180
|
// Verify that equals returns false when tags differ
|
|
321
181
|
expect(entity1.equals(entity2.toApi())).toBe(false)
|
|
@@ -325,7 +185,7 @@ describe('OutputTag class method tests', () => {
|
|
|
325
185
|
const ctx = ctxs[0]
|
|
326
186
|
|
|
327
187
|
// Insert differing OutputTag records into the database
|
|
328
|
-
const data1:
|
|
188
|
+
const data1: TableOutputTag = {
|
|
329
189
|
outputTagId: 405,
|
|
330
190
|
created_at: new Date('2023-01-01'),
|
|
331
191
|
updated_at: new Date('2023-01-02'),
|
|
@@ -338,8 +198,8 @@ describe('OutputTag class method tests', () => {
|
|
|
338
198
|
await ctx.activeStorage.insertOutputTag(data1)
|
|
339
199
|
|
|
340
200
|
// Create OutputTag entities
|
|
341
|
-
const entity1 = new
|
|
342
|
-
const entity2 = new
|
|
201
|
+
const entity1 = new EntityOutputTag(data1)
|
|
202
|
+
const entity2 = new EntityOutputTag(data2)
|
|
343
203
|
|
|
344
204
|
// Verify that equals returns false when isDeleted differs
|
|
345
205
|
expect(entity1.equals(entity2.toApi())).toBe(false)
|
|
@@ -349,7 +209,7 @@ describe('OutputTag class method tests', () => {
|
|
|
349
209
|
const ctx = ctxs[0]
|
|
350
210
|
|
|
351
211
|
// Insert matching OutputTag record into the database
|
|
352
|
-
const data:
|
|
212
|
+
const data: TableOutputTag = {
|
|
353
213
|
outputTagId: 406,
|
|
354
214
|
created_at: new Date('2023-01-01'),
|
|
355
215
|
updated_at: new Date('2023-01-02'),
|
|
@@ -360,84 +220,11 @@ describe('OutputTag class method tests', () => {
|
|
|
360
220
|
await ctx.activeStorage.insertOutputTag(data)
|
|
361
221
|
|
|
362
222
|
// Create OutputTag entities
|
|
363
|
-
const entity1 = new
|
|
364
|
-
const entity2 = new
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
outputTag: {
|
|
369
|
-
idMap: { 1: 1 },
|
|
370
|
-
entityName: 'OutputTag',
|
|
371
|
-
maxUpdated_at: undefined,
|
|
372
|
-
count: 0
|
|
373
|
-
},
|
|
374
|
-
provenTx: {
|
|
375
|
-
idMap: {},
|
|
376
|
-
entityName: 'ProvenTx',
|
|
377
|
-
maxUpdated_at: undefined,
|
|
378
|
-
count: 0
|
|
379
|
-
},
|
|
380
|
-
outputBasket: {
|
|
381
|
-
idMap: {},
|
|
382
|
-
entityName: 'OutputBasket',
|
|
383
|
-
maxUpdated_at: undefined,
|
|
384
|
-
count: 0
|
|
385
|
-
},
|
|
386
|
-
transaction: {
|
|
387
|
-
idMap: {},
|
|
388
|
-
entityName: 'Transaction',
|
|
389
|
-
maxUpdated_at: undefined,
|
|
390
|
-
count: 0
|
|
391
|
-
},
|
|
392
|
-
provenTxReq: {
|
|
393
|
-
idMap: {},
|
|
394
|
-
entityName: 'ProvenTxReq',
|
|
395
|
-
maxUpdated_at: undefined,
|
|
396
|
-
count: 0
|
|
397
|
-
},
|
|
398
|
-
txLabel: {
|
|
399
|
-
idMap: {},
|
|
400
|
-
entityName: 'TxLabel',
|
|
401
|
-
maxUpdated_at: undefined,
|
|
402
|
-
count: 0
|
|
403
|
-
},
|
|
404
|
-
txLabelMap: {
|
|
405
|
-
idMap: {},
|
|
406
|
-
entityName: 'TxLabelMap',
|
|
407
|
-
maxUpdated_at: undefined,
|
|
408
|
-
count: 0
|
|
409
|
-
},
|
|
410
|
-
output: {
|
|
411
|
-
idMap: {},
|
|
412
|
-
entityName: 'Output',
|
|
413
|
-
maxUpdated_at: undefined,
|
|
414
|
-
count: 0
|
|
415
|
-
},
|
|
416
|
-
outputTagMap: {
|
|
417
|
-
idMap: {},
|
|
418
|
-
entityName: 'OutputTagMap',
|
|
419
|
-
maxUpdated_at: undefined,
|
|
420
|
-
count: 0
|
|
421
|
-
},
|
|
422
|
-
certificate: {
|
|
423
|
-
idMap: {},
|
|
424
|
-
entityName: 'Certificate',
|
|
425
|
-
maxUpdated_at: undefined,
|
|
426
|
-
count: 0
|
|
427
|
-
},
|
|
428
|
-
certificateField: {
|
|
429
|
-
idMap: {},
|
|
430
|
-
entityName: 'CertificateField',
|
|
431
|
-
maxUpdated_at: undefined,
|
|
432
|
-
count: 0
|
|
433
|
-
},
|
|
434
|
-
commission: {
|
|
435
|
-
idMap: {},
|
|
436
|
-
entityName: 'Commission',
|
|
437
|
-
maxUpdated_at: undefined,
|
|
438
|
-
count: 0
|
|
439
|
-
}
|
|
440
|
-
}
|
|
223
|
+
const entity1 = new EntityOutputTag(data)
|
|
224
|
+
const entity2 = new EntityOutputTag(data)
|
|
225
|
+
|
|
226
|
+
const syncMap = createSyncMap()
|
|
227
|
+
syncMap.outputTag.idMap[1] = 1
|
|
441
228
|
|
|
442
229
|
// Verify that equals returns true with syncMap
|
|
443
230
|
expect(entity1.equals(entity2.toApi(), syncMap)).toBe(true)
|
|
@@ -447,7 +234,7 @@ describe('OutputTag class method tests', () => {
|
|
|
447
234
|
const ctx = ctxs[0]
|
|
448
235
|
|
|
449
236
|
// Insert differing OutputTag records into the database
|
|
450
|
-
const data1:
|
|
237
|
+
const data1: TableOutputTag = {
|
|
451
238
|
outputTagId: 407,
|
|
452
239
|
created_at: new Date('2023-01-01'),
|
|
453
240
|
updated_at: new Date('2023-01-02'),
|
|
@@ -460,8 +247,8 @@ describe('OutputTag class method tests', () => {
|
|
|
460
247
|
await ctx.activeStorage.insertOutputTag(data1)
|
|
461
248
|
|
|
462
249
|
// Create OutputTag entities
|
|
463
|
-
const entity1 = new
|
|
464
|
-
const entity2 = new
|
|
250
|
+
const entity1 = new EntityOutputTag(data1)
|
|
251
|
+
const entity2 = new EntityOutputTag(data2)
|
|
465
252
|
|
|
466
253
|
// Verify that equals returns false when userIds differ and no syncMap is provided
|
|
467
254
|
expect(entity1.equals(entity2.toApi())).toBe(false)
|
|
@@ -472,7 +259,7 @@ describe('OutputTag class method tests', () => {
|
|
|
472
259
|
const later = new Date(now.getTime() + 1000)
|
|
473
260
|
|
|
474
261
|
// Create an OutputTag instance
|
|
475
|
-
const outputTag = new
|
|
262
|
+
const outputTag = new EntityOutputTag()
|
|
476
263
|
|
|
477
264
|
// Set values using setters
|
|
478
265
|
outputTag.outputTagId = 123
|
|
@@ -492,7 +279,7 @@ describe('OutputTag class method tests', () => {
|
|
|
492
279
|
|
|
493
280
|
// Validate id, entityName, and entityTable
|
|
494
281
|
expect(outputTag.id).toBe(123)
|
|
495
|
-
expect(outputTag.entityName).toBe('
|
|
282
|
+
expect(outputTag.entityName).toBe('outputTag')
|
|
496
283
|
expect(outputTag.entityTable).toBe('output_tags')
|
|
497
284
|
|
|
498
285
|
// Update id using override setter
|