@bsv/wallet-toolbox 1.1.60 → 1.1.61
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/.prettierrc +1 -1
- package/docs/client.md +39 -5
- package/docs/services.md +1 -0
- package/docs/setup.md +9 -26
- package/docs/storage.md +35 -0
- package/docs/wallet.md +39 -5
- package/out/src/Setup.d.ts.map +1 -1
- package/out/src/Setup.js +6 -16
- package/out/src/Setup.js.map +1 -1
- package/out/src/Wallet.d.ts.map +1 -1
- package/out/src/Wallet.js +4 -11
- package/out/src/Wallet.js.map +1 -1
- package/out/src/monitor/Monitor.d.ts.map +1 -1
- package/out/src/monitor/Monitor.js.map +1 -1
- package/out/src/monitor/MonitorDaemon.d.ts.map +1 -1
- package/out/src/monitor/MonitorDaemon.js +1 -3
- package/out/src/monitor/MonitorDaemon.js.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskCheckForProofs.js +2 -10
- package/out/src/monitor/tasks/TaskCheckForProofs.js.map +1 -1
- package/out/src/monitor/tasks/TaskClock.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskClock.js +1 -1
- package/out/src/monitor/tasks/TaskClock.js.map +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskFailAbandoned.js.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskNewHeader.js +1 -2
- package/out/src/monitor/tasks/TaskNewHeader.js.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskPurge.js +1 -2
- package/out/src/monitor/tasks/TaskPurge.js.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskReviewStatus.js +1 -2
- package/out/src/monitor/tasks/TaskReviewStatus.js.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.d.ts.map +1 -1
- package/out/src/monitor/tasks/TaskSendWaiting.js.map +1 -1
- package/out/src/sdk/CertOps.d.ts.map +1 -1
- package/out/src/sdk/CertOps.js +4 -12
- package/out/src/sdk/CertOps.js.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/sdk/WERR_errors.d.ts.map +1 -1
- package/out/src/sdk/WERR_errors.js.map +1 -1
- package/out/src/sdk/WalletError.d.ts.map +1 -1
- package/out/src/sdk/WalletError.js +1 -4
- package/out/src/sdk/WalletError.js.map +1 -1
- package/out/src/sdk/WalletServices.interfaces.d.ts +2 -0
- package/out/src/sdk/WalletServices.interfaces.d.ts.map +1 -1
- package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
- package/out/src/sdk/__test/CertificateLifeCycle.test.js +1 -3
- package/out/src/sdk/__test/CertificateLifeCycle.test.js.map +1 -1
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js +13 -26
- package/out/src/sdk/__test/PrivilegedKeyManager.test.js.map +1 -1
- package/out/src/sdk/types.d.ts.map +1 -1
- package/out/src/sdk/types.js +2 -10
- package/out/src/sdk/types.js.map +1 -1
- package/out/src/sdk/validationHelpers.d.ts.map +1 -1
- package/out/src/sdk/validationHelpers.js +5 -12
- package/out/src/sdk/validationHelpers.js.map +1 -1
- package/out/src/services/Services.d.ts +1 -0
- package/out/src/services/Services.d.ts.map +1 -1
- package/out/src/services/Services.js +29 -38
- package/out/src/services/Services.js.map +1 -1
- package/out/src/services/__tests/bitrails.test.js.map +1 -1
- package/out/src/services/__tests/getMerklePath.test.js.map +1 -1
- package/out/src/services/__tests/getRawTx.test.js.map +1 -1
- package/out/src/services/__tests/verifyBeef.test.js +2 -1
- package/out/src/services/__tests/verifyBeef.test.js.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.d.ts.map +1 -1
- package/out/src/services/chaintracker/ChaintracksChainTracker.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/BlockHeaderApi.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js +1 -3
- package/out/src/services/chaintracker/chaintracks/ChaintracksServiceClient.js.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -1
- package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
- package/out/src/services/providers/ARC.d.ts.map +1 -1
- package/out/src/services/providers/ARC.js +1 -2
- package/out/src/services/providers/ARC.js.map +1 -1
- package/out/src/services/providers/Bitails.d.ts.map +1 -1
- package/out/src/services/providers/Bitails.js +62 -134
- package/out/src/services/providers/Bitails.js.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/SdkWhatsOnChain.js.map +1 -1
- package/out/src/services/providers/WhatsOnChain.d.ts.map +1 -1
- package/out/src/services/providers/WhatsOnChain.js +6 -21
- package/out/src/services/providers/WhatsOnChain.js.map +1 -1
- package/out/src/services/providers/__tests/WhatsOnChain.test.js +1 -2
- package/out/src/services/providers/__tests/WhatsOnChain.test.js.map +1 -1
- package/out/src/services/providers/echangeRates.d.ts.map +1 -1
- package/out/src/services/providers/echangeRates.js.map +1 -1
- package/out/src/signer/WalletSigner.d.ts.map +1 -1
- package/out/src/signer/WalletSigner.js.map +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.d.ts.map +1 -1
- package/out/src/signer/methods/acquireDirectCertificate.js +1 -3
- package/out/src/signer/methods/acquireDirectCertificate.js.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.d.ts.map +1 -1
- package/out/src/signer/methods/buildSignableTransaction.js +3 -11
- package/out/src/signer/methods/buildSignableTransaction.js.map +1 -1
- package/out/src/signer/methods/createAction.d.ts.map +1 -1
- package/out/src/signer/methods/createAction.js +3 -10
- package/out/src/signer/methods/createAction.js.map +1 -1
- package/out/src/signer/methods/internalizeAction.d.ts.map +1 -1
- package/out/src/signer/methods/internalizeAction.js.map +1 -1
- package/out/src/signer/methods/proveCertificate.d.ts.map +1 -1
- package/out/src/signer/methods/proveCertificate.js.map +1 -1
- package/out/src/signer/methods/signAction.d.ts.map +1 -1
- package/out/src/signer/methods/signAction.js +2 -7
- package/out/src/signer/methods/signAction.js.map +1 -1
- package/out/src/storage/StorageKnex.d.ts.map +1 -1
- package/out/src/storage/StorageKnex.js +15 -44
- package/out/src/storage/StorageKnex.js.map +1 -1
- package/out/src/storage/StorageProvider.d.ts.map +1 -1
- package/out/src/storage/StorageProvider.js +9 -34
- package/out/src/storage/StorageProvider.js.map +1 -1
- 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.map +1 -1
- package/out/src/storage/StorageReaderWriter.js.map +1 -1
- 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.map +1 -1
- package/out/src/storage/WalletStorageManager.js +5 -10
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/__test/WalletStorageManager.test.js +2 -8
- package/out/src/storage/__test/WalletStorageManager.test.js.map +1 -1
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js +10 -30
- package/out/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.js.map +1 -1
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.d.ts.map +1 -1
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.js +17 -28
- package/out/src/storage/methods/__test/GenerateChange/randomValsUsed1.js.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.d.ts.map +1 -1
- package/out/src/storage/methods/attemptToPostReqsToNetwork.js +6 -20
- 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 +4 -9
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/generateChange.d.ts.map +1 -1
- package/out/src/storage/methods/generateChange.js +7 -18
- package/out/src/storage/methods/generateChange.js.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -1
- package/out/src/storage/methods/getBeefForTransaction.js +1 -3
- 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 +2 -9
- package/out/src/storage/methods/internalizeAction.js.map +1 -1
- package/out/src/storage/methods/listActions.d.ts.map +1 -1
- package/out/src/storage/methods/listActions.js +3 -15
- 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.d.ts.map +1 -1
- package/out/src/storage/methods/listOutputs.js +4 -11
- package/out/src/storage/methods/listOutputs.js.map +1 -1
- package/out/src/storage/methods/processAction.d.ts.map +1 -1
- package/out/src/storage/methods/processAction.js +4 -10
- 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 +8 -32
- package/out/src/storage/methods/purgeData.js.map +1 -1
- package/out/src/storage/methods/reviewStatus.d.ts.map +1 -1
- package/out/src/storage/methods/reviewStatus.js +1 -3
- package/out/src/storage/methods/reviewStatus.js.map +1 -1
- package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageClient.js +15 -41
- package/out/src/storage/remoting/StorageClient.js.map +1 -1
- package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
- package/out/src/storage/remoting/StorageServer.js +2 -5
- package/out/src/storage/remoting/StorageServer.js.map +1 -1
- package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
- package/out/src/storage/schema/KnexMigrations.js +24 -130
- package/out/src/storage/schema/KnexMigrations.js.map +1 -1
- package/out/src/storage/schema/entities/Certificate.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Certificate.js +1 -1
- package/out/src/storage/schema/entities/Certificate.js.map +1 -1
- package/out/src/storage/schema/entities/CertificateField.d.ts.map +1 -1
- package/out/src/storage/schema/entities/CertificateField.js +2 -5
- package/out/src/storage/schema/entities/CertificateField.js.map +1 -1
- package/out/src/storage/schema/entities/Commission.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Commission.js +2 -5
- package/out/src/storage/schema/entities/Commission.js.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.d.ts.map +1 -1
- package/out/src/storage/schema/entities/EntityBase.js.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.d.ts.map +1 -1
- package/out/src/storage/schema/entities/MergeEntity.js +14 -9
- package/out/src/storage/schema/entities/MergeEntity.js.map +1 -1
- package/out/src/storage/schema/entities/Output.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Output.js +8 -25
- package/out/src/storage/schema/entities/Output.js.map +1 -1
- package/out/src/storage/schema/entities/OutputBasket.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputBasket.js +1 -1
- package/out/src/storage/schema/entities/OutputBasket.js.map +1 -1
- package/out/src/storage/schema/entities/OutputTag.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputTag.js +1 -1
- package/out/src/storage/schema/entities/OutputTag.js.map +1 -1
- package/out/src/storage/schema/entities/OutputTagMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/OutputTagMap.js +3 -7
- package/out/src/storage/schema/entities/OutputTagMap.js.map +1 -1
- package/out/src/storage/schema/entities/ProvenTx.d.ts.map +1 -1
- package/out/src/storage/schema/entities/ProvenTx.js +10 -20
- package/out/src/storage/schema/entities/ProvenTx.js.map +1 -1
- package/out/src/storage/schema/entities/ProvenTxReq.d.ts.map +1 -1
- package/out/src/storage/schema/entities/ProvenTxReq.js +8 -18
- package/out/src/storage/schema/entities/ProvenTxReq.js.map +1 -1
- package/out/src/storage/schema/entities/SyncState.d.ts +1 -0
- package/out/src/storage/schema/entities/SyncState.d.ts.map +1 -1
- package/out/src/storage/schema/entities/SyncState.js +41 -6
- package/out/src/storage/schema/entities/SyncState.js.map +1 -1
- package/out/src/storage/schema/entities/Transaction.d.ts.map +1 -1
- package/out/src/storage/schema/entities/Transaction.js +4 -13
- package/out/src/storage/schema/entities/Transaction.js.map +1 -1
- package/out/src/storage/schema/entities/TxLabel.d.ts.map +1 -1
- package/out/src/storage/schema/entities/TxLabel.js +1 -1
- package/out/src/storage/schema/entities/TxLabel.js.map +1 -1
- package/out/src/storage/schema/entities/TxLabelMap.d.ts.map +1 -1
- package/out/src/storage/schema/entities/TxLabelMap.js +3 -9
- package/out/src/storage/schema/entities/TxLabelMap.js.map +1 -1
- package/out/src/storage/schema/entities/User.d.ts.map +1 -1
- package/out/src/storage/schema/entities/User.js +3 -5
- package/out/src/storage/schema/entities/User.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateFieldTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CertificateTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/CommissionTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputBasketTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTagMapTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTagTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/OutputTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxReqTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js +1 -2
- package/out/src/storage/schema/entities/__tests/ProvenTxTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/SyncStateTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js +2 -2
- package/out/src/storage/schema/entities/__tests/TransactionTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TxLabelMapTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/TxLabelTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/stampLogTests.test.js.map +1 -1
- package/out/src/storage/schema/entities/__tests/usersTests.test.js.map +1 -1
- package/out/src/storage/schema/tables/TableSettings.d.ts.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.d.ts.map +1 -1
- package/out/src/storage/sync/StorageMySQLDojoReader.js +1 -3
- package/out/src/storage/sync/StorageMySQLDojoReader.js.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -1
- package/out/src/utility/ScriptTemplateBRC29.js +1 -2
- package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
- package/out/src/utility/stampLog.d.ts.map +1 -1
- package/out/src/utility/stampLog.js.map +1 -1
- package/out/src/utility/tscProofToMerklePath.d.ts.map +1 -1
- package/out/src/utility/tscProofToMerklePath.js.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.buffer.js.map +1 -1
- package/out/src/utility/utilityHelpers.d.ts.map +1 -1
- package/out/src/utility/utilityHelpers.js +1 -3
- package/out/src/utility/utilityHelpers.js.map +1 -1
- package/out/test/Wallet/StorageClient/storageClient.man.test.js.map +1 -1
- package/out/test/Wallet/action/internalizeAction.a.test.js.map +1 -1
- package/out/test/Wallet/certificate/acquireCertificate.test.js.map +1 -1
- package/out/test/Wallet/certificate/listCertificates.test.js.map +1 -1
- package/out/test/Wallet/get/getHeaderForHeight.test.js +2 -6
- package/out/test/Wallet/get/getHeaderForHeight.test.js.map +1 -1
- package/out/test/Wallet/get/getHeight.test.js.map +1 -1
- package/out/test/Wallet/get/getKnownTxids.test.js.map +1 -1
- package/out/test/Wallet/get/getNetwork.test.js.map +1 -1
- package/out/test/Wallet/get/getVersion.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 +3 -9
- package/out/test/Wallet/live/walletLive.man.test.js.map +1 -1
- package/out/test/Wallet/local/localWallet.man.test.d.ts.map +1 -1
- package/out/test/Wallet/local/localWallet.man.test.js +15 -22
- package/out/test/Wallet/local/localWallet.man.test.js.map +1 -1
- package/out/test/Wallet/specOps/specOps.man.test.js +1 -4
- package/out/test/Wallet/specOps/specOps.man.test.js.map +1 -1
- package/out/test/Wallet/support/janitor.man.test.js.map +1 -1
- package/out/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.js.map +1 -1
- package/out/test/Wallet/sync/setActive.test.js +73 -50
- package/out/test/Wallet/sync/setActive.test.js.map +1 -1
- package/out/test/checkDB.d.ts.map +1 -1
- package/out/test/checkDB.js.map +1 -1
- package/out/test/examples/backup.man.test.d.ts.map +1 -1
- package/out/test/examples/backup.man.test.js.map +1 -1
- package/out/test/examples/pushdrop.test.d.ts.map +1 -1
- package/out/test/examples/pushdrop.test.js +5 -4
- package/out/test/examples/pushdrop.test.js.map +1 -1
- package/out/test/monitor/Monitor.test.js.map +1 -1
- package/out/test/services/Services.test.js.map +1 -1
- package/out/test/storage/KnexMigrations.test.js.map +1 -1
- package/out/test/storage/StorageMySQLDojoReader.man.test.js +1 -3
- package/out/test/storage/StorageMySQLDojoReader.man.test.js.map +1 -1
- package/out/test/storage/count.test.js.map +1 -1
- package/out/test/storage/find.test.js +5 -10
- package/out/test/storage/find.test.js.map +1 -1
- package/out/test/storage/findLegacy.test.js.map +1 -1
- package/out/test/storage/insert.test.js.map +1 -1
- package/out/test/storage/update.test.js +7 -19
- package/out/test/storage/update.test.js.map +1 -1
- package/out/test/storage/update2.test.js +22 -24
- package/out/test/storage/update2.test.js.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts +3 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.js +52 -76
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
- package/out/test/wallet/action/abortAction.test.js.map +1 -1
- package/out/test/wallet/action/createAction.test.js +1 -2
- package/out/test/wallet/action/createAction.test.js.map +1 -1
- package/out/test/wallet/action/createAction2.test.d.ts.map +1 -1
- package/out/test/wallet/action/createAction2.test.js +6 -16
- package/out/test/wallet/action/createAction2.test.js.map +1 -1
- package/out/test/wallet/action/createActionToGenerateBeefs.man.test.js.map +1 -1
- package/out/test/wallet/action/internalizeAction.test.js.map +1 -1
- package/out/test/wallet/action/relinquishOutput.test.js.map +1 -1
- package/out/test/wallet/list/listActions.test.js.map +1 -1
- package/out/test/wallet/list/listActions2.test.js.map +1 -1
- package/out/test/wallet/list/listCertificates.test.js +2 -6
- package/out/test/wallet/list/listCertificates.test.js.map +1 -1
- package/out/test/wallet/list/listOutputs.test.js +2 -10
- package/out/test/wallet/list/listOutputs.test.js.map +1 -1
- package/out/test/wallet/sync/Wallet.sync.test.js +4 -6
- package/out/test/wallet/sync/Wallet.sync.test.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Setup.ts +15 -52
- package/src/Wallet.ts +58 -161
- package/src/monitor/Monitor.ts +7 -22
- package/src/monitor/MonitorDaemon.ts +6 -23
- package/src/monitor/tasks/TaskCheckForProofs.ts +4 -23
- package/src/monitor/tasks/TaskClock.ts +1 -3
- package/src/monitor/tasks/TaskFailAbandoned.ts +1 -3
- package/src/monitor/tasks/TaskNewHeader.ts +1 -4
- package/src/monitor/tasks/TaskPurge.ts +1 -2
- package/src/monitor/tasks/TaskReviewStatus.ts +1 -3
- package/src/monitor/tasks/TaskSendWaiting.ts +3 -10
- package/src/sdk/CertOps.ts +31 -103
- package/src/sdk/PrivilegedKeyManager.ts +18 -48
- package/src/sdk/WERR_errors.ts +6 -25
- package/src/sdk/WalletError.ts +5 -21
- package/src/sdk/WalletServices.interfaces.ts +11 -33
- package/src/sdk/WalletStorage.interfaces.ts +25 -91
- package/src/sdk/__test/CertificateLifeCycle.test.ts +9 -27
- package/src/sdk/__test/PrivilegedKeyManager.test.ts +29 -66
- package/src/sdk/types.ts +6 -26
- package/src/sdk/validationHelpers.ts +111 -402
- package/src/services/Services.ts +51 -114
- package/src/services/__tests/bitrails.test.ts +4 -15
- package/src/services/__tests/getMerklePath.test.ts +1 -2
- package/src/services/__tests/getRawTx.test.ts +1 -3
- package/src/services/__tests/verifyBeef.test.ts +2 -1
- package/src/services/chaintracker/ChaintracksChainTracker.ts +3 -13
- package/src/services/chaintracker/chaintracks/BlockHeaderApi.ts +4 -12
- package/src/services/chaintracker/chaintracks/ChaintracksServiceClient.ts +9 -27
- package/src/services/createDefaultWalletServicesOptions.ts +2 -5
- package/src/services/providers/ARC.ts +5 -24
- package/src/services/providers/Bitails.ts +61 -159
- package/src/services/providers/SdkWhatsOnChain.ts +4 -17
- package/src/services/providers/WhatsOnChain.ts +31 -100
- package/src/services/providers/__tests/WhatsOnChain.test.ts +5 -15
- package/src/services/providers/echangeRates.ts +7 -22
- package/src/signer/WalletSigner.ts +1 -5
- package/src/signer/methods/acquireDirectCertificate.ts +1 -4
- package/src/signer/methods/buildSignableTransaction.ts +5 -20
- package/src/signer/methods/createAction.ts +15 -54
- package/src/signer/methods/internalizeAction.ts +10 -39
- package/src/signer/methods/proveCertificate.ts +2 -5
- package/src/signer/methods/signAction.ts +9 -39
- package/src/storage/StorageKnex.ts +166 -499
- package/src/storage/StorageProvider.ts +75 -291
- package/src/storage/StorageReader.ts +20 -65
- package/src/storage/StorageReaderWriter.ts +67 -264
- package/src/storage/StorageSyncReader.ts +2 -5
- package/src/storage/WalletStorageManager.ts +33 -108
- package/src/storage/__test/WalletStorageManager.test.ts +6 -23
- package/src/storage/methods/__test/GenerateChange/generateChangeSdk.test.ts +53 -171
- package/src/storage/methods/__test/GenerateChange/randomValsUsed1.ts +17 -28
- package/src/storage/methods/attemptToPostReqsToNetwork.ts +9 -37
- package/src/storage/methods/createAction.ts +45 -181
- package/src/storage/methods/generateChange.ts +33 -114
- package/src/storage/methods/getBeefForTransaction.ts +7 -37
- package/src/storage/methods/getSyncChunk.ts +18 -69
- package/src/storage/methods/internalizeAction.ts +18 -70
- package/src/storage/methods/listActions.ts +6 -23
- package/src/storage/methods/listCertificates.ts +5 -14
- package/src/storage/methods/listOutputs.ts +14 -68
- package/src/storage/methods/processAction.ts +29 -104
- package/src/storage/methods/purgeData.ts +11 -45
- package/src/storage/methods/reviewStatus.ts +3 -9
- package/src/storage/remoting/StorageClient.ts +43 -146
- package/src/storage/remoting/StorageServer.ts +21 -59
- package/src/storage/schema/KnexMigrations.ts +34 -165
- package/src/storage/schema/entities/Certificate.ts +3 -14
- package/src/storage/schema/entities/CertificateField.ts +6 -28
- package/src/storage/schema/entities/Commission.ts +6 -23
- package/src/storage/schema/entities/EntityBase.ts +1 -6
- package/src/storage/schema/entities/MergeEntity.ts +14 -21
- package/src/storage/schema/entities/Output.ts +10 -39
- package/src/storage/schema/entities/OutputBasket.ts +4 -16
- package/src/storage/schema/entities/OutputTag.ts +4 -17
- package/src/storage/schema/entities/OutputTagMap.ts +7 -30
- package/src/storage/schema/entities/ProvenTx.ts +16 -57
- package/src/storage/schema/entities/ProvenTxReq.ts +29 -93
- package/src/storage/schema/entities/SyncState.ts +64 -116
- package/src/storage/schema/entities/Transaction.ts +10 -35
- package/src/storage/schema/entities/TxLabel.ts +4 -17
- package/src/storage/schema/entities/TxLabelMap.ts +6 -28
- package/src/storage/schema/entities/User.ts +8 -31
- package/src/storage/schema/entities/__tests/CertificateFieldTests.test.ts +23 -54
- package/src/storage/schema/entities/__tests/CertificateTests.test.ts +26 -59
- package/src/storage/schema/entities/__tests/CommissionTests.test.ts +2 -11
- package/src/storage/schema/entities/__tests/OutputBasketTests.test.ts +2 -10
- package/src/storage/schema/entities/__tests/OutputTagMapTests.test.ts +2 -10
- package/src/storage/schema/entities/__tests/OutputTagTests.test.ts +1 -4
- package/src/storage/schema/entities/__tests/OutputTests.test.ts +3 -14
- package/src/storage/schema/entities/__tests/ProvenTxReqTests.test.ts +4 -16
- package/src/storage/schema/entities/__tests/ProvenTxTests.test.ts +5 -18
- package/src/storage/schema/entities/__tests/SyncStateTests.test.ts +5 -26
- package/src/storage/schema/entities/__tests/TransactionTests.test.ts +12 -48
- package/src/storage/schema/entities/__tests/TxLabelMapTests.test.ts +4 -22
- package/src/storage/schema/entities/__tests/TxLabelTests.test.ts +2 -10
- package/src/storage/schema/entities/__tests/stampLogTests.test.ts +3 -10
- package/src/storage/schema/entities/__tests/usersTests.test.ts +4 -7
- package/src/storage/schema/tables/TableSettings.ts +1 -3
- package/src/storage/sync/StorageMySQLDojoReader.ts +47 -148
- package/src/utility/ScriptTemplateBRC29.ts +2 -11
- package/src/utility/stampLog.ts +2 -6
- package/src/utility/tscProofToMerklePath.ts +1 -4
- package/src/utility/utilityHelpers.buffer.ts +3 -12
- package/src/utility/utilityHelpers.ts +14 -49
- package/test/Wallet/StorageClient/storageClient.man.test.ts +2 -8
- package/test/Wallet/action/internalizeAction.a.test.ts +8 -23
- package/test/Wallet/certificate/acquireCertificate.test.ts +10 -24
- package/test/Wallet/certificate/listCertificates.test.ts +8 -18
- package/test/Wallet/get/getHeaderForHeight.test.ts +4 -15
- package/test/Wallet/get/getHeight.test.ts +2 -6
- package/test/Wallet/get/getKnownTxids.test.ts +1 -5
- package/test/Wallet/get/getNetwork.test.ts +1 -2
- package/test/Wallet/get/getVersion.test.ts +1 -2
- package/test/Wallet/live/walletLive.man.test.ts +14 -41
- package/test/Wallet/local/localWallet.man.test.ts +26 -99
- package/test/Wallet/specOps/specOps.man.test.ts +4 -13
- package/test/Wallet/support/janitor.man.test.ts +2 -7
- package/test/Wallet/sync/Wallet.updateWalletLegacyTestData.man.test.ts +11 -34
- package/test/Wallet/sync/setActive.test.ts +75 -61
- package/test/checkDB.ts +2 -8
- package/test/examples/backup.man.test.ts +2 -9
- package/test/examples/pushdrop.test.ts +7 -20
- package/test/monitor/Monitor.test.ts +33 -87
- package/test/services/Services.test.ts +8 -19
- package/test/storage/KnexMigrations.test.ts +3 -18
- package/test/storage/StorageMySQLDojoReader.man.test.ts +4 -15
- package/test/storage/count.test.ts +7 -24
- package/test/storage/find.test.ts +7 -29
- package/test/storage/findLegacy.test.ts +2 -5
- package/test/storage/insert.test.ts +3 -19
- package/test/storage/update.test.ts +47 -179
- package/test/storage/update2.test.ts +54 -176
- package/test/utils/TestUtilsWalletStorage.ts +139 -372
- package/test/wallet/action/abortAction.test.ts +4 -12
- package/test/wallet/action/createAction.test.ts +4 -14
- package/test/wallet/action/createAction2.test.ts +74 -208
- package/test/wallet/action/createActionToGenerateBeefs.man.test.ts +8 -11
- package/test/wallet/action/internalizeAction.test.ts +20 -72
- package/test/wallet/action/relinquishOutput.test.ts +3 -9
- package/test/wallet/list/listActions.test.ts +2 -9
- package/test/wallet/list/listActions2.test.ts +8 -34
- package/test/wallet/list/listCertificates.test.ts +5 -16
- package/test/wallet/list/listOutputs.test.ts +15 -54
- package/test/wallet/sync/Wallet.sync.test.ts +18 -49
|
@@ -52,12 +52,8 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
52
52
|
syncMap: JSON.stringify(createSyncMap())
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
|
-
this.errorLocal = this.api.errorLocal
|
|
56
|
-
|
|
57
|
-
: undefined
|
|
58
|
-
this.errorOther = this.api.errorOther
|
|
59
|
-
? <SyncError>JSON.parse(this.api.errorOther)
|
|
60
|
-
: undefined
|
|
55
|
+
this.errorLocal = this.api.errorLocal ? <SyncError>JSON.parse(this.api.errorLocal) : undefined
|
|
56
|
+
this.errorOther = this.api.errorOther ? <SyncError>JSON.parse(this.api.errorOther) : undefined
|
|
61
57
|
this.syncMap = <SyncMap>JSON.parse(this.api.syncMap)
|
|
62
58
|
this.validateSyncMap(this.syncMap)
|
|
63
59
|
}
|
|
@@ -65,8 +61,7 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
65
61
|
validateSyncMap(sm: SyncMap) {
|
|
66
62
|
for (const key of Object.keys(sm)) {
|
|
67
63
|
const esm: EntitySyncMap = sm[key]
|
|
68
|
-
if (typeof esm.maxUpdated_at === 'string')
|
|
69
|
-
esm.maxUpdated_at = new Date(esm.maxUpdated_at)
|
|
64
|
+
if (typeof esm.maxUpdated_at === 'string') esm.maxUpdated_at = new Date(esm.maxUpdated_at)
|
|
70
65
|
}
|
|
71
66
|
}
|
|
72
67
|
|
|
@@ -75,9 +70,7 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
75
70
|
userIdentityKey: string,
|
|
76
71
|
remoteSettings: TableSettings
|
|
77
72
|
): Promise<EntitySyncState> {
|
|
78
|
-
const { user } = verifyTruthy(
|
|
79
|
-
await storage.findOrInsertUser(userIdentityKey)
|
|
80
|
-
)
|
|
73
|
+
const { user } = verifyTruthy(await storage.findOrInsertUser(userIdentityKey))
|
|
81
74
|
let { syncState: api } = verifyTruthy(
|
|
82
75
|
await storage.findOrInsertSyncStateAuth(
|
|
83
76
|
{ userId: user.userId, identityKey: userIdentityKey },
|
|
@@ -85,6 +78,7 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
85
78
|
remoteSettings.storageName
|
|
86
79
|
)
|
|
87
80
|
)
|
|
81
|
+
if (!api.syncMap || api.syncMap === '{}') api.syncMap = JSON.stringify(createSyncMap())
|
|
88
82
|
const ss = new EntitySyncState(api)
|
|
89
83
|
return ss
|
|
90
84
|
}
|
|
@@ -95,11 +89,7 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
95
89
|
* @param notSyncMap if not new and true, excludes updating syncMap in storage.
|
|
96
90
|
* @param trx
|
|
97
91
|
*/
|
|
98
|
-
async updateStorage(
|
|
99
|
-
storage: EntityStorage,
|
|
100
|
-
notSyncMap?: boolean,
|
|
101
|
-
trx?: sdk.TrxToken
|
|
102
|
-
) {
|
|
92
|
+
async updateStorage(storage: EntityStorage, notSyncMap?: boolean, trx?: sdk.TrxToken) {
|
|
103
93
|
this.updated_at = new Date()
|
|
104
94
|
this.updateApi(notSyncMap && this.id > 0)
|
|
105
95
|
if (this.id === 0) {
|
|
@@ -203,10 +193,7 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
203
193
|
return 'sync_states'
|
|
204
194
|
}
|
|
205
195
|
|
|
206
|
-
static mergeIdMap(
|
|
207
|
-
fromMap: Record<number, number>,
|
|
208
|
-
toMap: Record<number, number>
|
|
209
|
-
) {
|
|
196
|
+
static mergeIdMap(fromMap: Record<number, number>, toMap: Record<number, number>) {
|
|
210
197
|
for (const [key, value] of Object.entries(fromMap)) {
|
|
211
198
|
const fromValue = fromMap[key]
|
|
212
199
|
const toValue = toMap[key]
|
|
@@ -223,42 +210,15 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
223
210
|
* @param iSyncMap
|
|
224
211
|
*/
|
|
225
212
|
mergeSyncMap(iSyncMap: SyncMap) {
|
|
226
|
-
EntitySyncState.mergeIdMap(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
)
|
|
230
|
-
EntitySyncState.mergeIdMap(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
)
|
|
234
|
-
EntitySyncState.mergeIdMap(
|
|
235
|
-
iSyncMap.transaction.idMap!,
|
|
236
|
-
this.syncMap.transaction.idMap!
|
|
237
|
-
)
|
|
238
|
-
EntitySyncState.mergeIdMap(
|
|
239
|
-
iSyncMap.provenTxReq.idMap!,
|
|
240
|
-
this.syncMap.provenTxReq.idMap!
|
|
241
|
-
)
|
|
242
|
-
EntitySyncState.mergeIdMap(
|
|
243
|
-
iSyncMap.txLabel.idMap!,
|
|
244
|
-
this.syncMap.txLabel.idMap!
|
|
245
|
-
)
|
|
246
|
-
EntitySyncState.mergeIdMap(
|
|
247
|
-
iSyncMap.output.idMap!,
|
|
248
|
-
this.syncMap.output.idMap!
|
|
249
|
-
)
|
|
250
|
-
EntitySyncState.mergeIdMap(
|
|
251
|
-
iSyncMap.outputTag.idMap!,
|
|
252
|
-
this.syncMap.outputTag.idMap!
|
|
253
|
-
)
|
|
254
|
-
EntitySyncState.mergeIdMap(
|
|
255
|
-
iSyncMap.certificate.idMap!,
|
|
256
|
-
this.syncMap.certificate.idMap!
|
|
257
|
-
)
|
|
258
|
-
EntitySyncState.mergeIdMap(
|
|
259
|
-
iSyncMap.commission.idMap!,
|
|
260
|
-
this.syncMap.commission.idMap!
|
|
261
|
-
)
|
|
213
|
+
EntitySyncState.mergeIdMap(iSyncMap.provenTx.idMap!, this.syncMap.provenTx.idMap!)
|
|
214
|
+
EntitySyncState.mergeIdMap(iSyncMap.outputBasket.idMap!, this.syncMap.outputBasket.idMap!)
|
|
215
|
+
EntitySyncState.mergeIdMap(iSyncMap.transaction.idMap!, this.syncMap.transaction.idMap!)
|
|
216
|
+
EntitySyncState.mergeIdMap(iSyncMap.provenTxReq.idMap!, this.syncMap.provenTxReq.idMap!)
|
|
217
|
+
EntitySyncState.mergeIdMap(iSyncMap.txLabel.idMap!, this.syncMap.txLabel.idMap!)
|
|
218
|
+
EntitySyncState.mergeIdMap(iSyncMap.output.idMap!, this.syncMap.output.idMap!)
|
|
219
|
+
EntitySyncState.mergeIdMap(iSyncMap.outputTag.idMap!, this.syncMap.outputTag.idMap!)
|
|
220
|
+
EntitySyncState.mergeIdMap(iSyncMap.certificate.idMap!, this.syncMap.certificate.idMap!)
|
|
221
|
+
EntitySyncState.mergeIdMap(iSyncMap.commission.idMap!, this.syncMap.commission.idMap!)
|
|
262
222
|
}
|
|
263
223
|
|
|
264
224
|
// stringified api properties
|
|
@@ -330,11 +290,47 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
330
290
|
this.syncMap.commission,
|
|
331
291
|
this.syncMap.provenTxReq
|
|
332
292
|
]) {
|
|
293
|
+
if (!ess || !ess.entityName) debugger
|
|
333
294
|
a.offsets.push({ name: ess.entityName, offset: ess.count })
|
|
334
295
|
}
|
|
335
296
|
return a
|
|
336
297
|
}
|
|
337
298
|
|
|
299
|
+
static syncChunkSummary(c: sdk.SyncChunk): string {
|
|
300
|
+
let log = ''
|
|
301
|
+
log += `SYNC CHUNK SUMMARY
|
|
302
|
+
from storage: ${c.fromStorageIdentityKey}
|
|
303
|
+
to storage: ${c.toStorageIdentityKey}
|
|
304
|
+
for user: ${c.userIdentityKey}
|
|
305
|
+
`
|
|
306
|
+
if (c.user) log += ` USER activeStorage ${c.user.activeStorage}\n`
|
|
307
|
+
if (!!c.provenTxs) {
|
|
308
|
+
log += ` PROVEN_TXS\n`
|
|
309
|
+
for (const r of c.provenTxs) {
|
|
310
|
+
log += ` ${r.provenTxId} ${r.txid}\n`
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (!!c.provenTxReqs) {
|
|
314
|
+
log += ` PROVEN_TX_REQS\n`
|
|
315
|
+
for (const r of c.provenTxReqs) {
|
|
316
|
+
log += ` ${r.provenTxReqId} ${r.txid} ${r.status} ${r.provenTxId || ''}\n`
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (!!c.transactions) {
|
|
320
|
+
log += ` TRANSACTIONS\n`
|
|
321
|
+
for (const r of c.transactions) {
|
|
322
|
+
log += ` ${r.transactionId} ${r.txid} ${r.status} ${r.provenTxId || ''} sats:${r.satoshis}\n`
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (!!c.outputs) {
|
|
326
|
+
log += ` OUTPUTS\n`
|
|
327
|
+
for (const r of c.outputs) {
|
|
328
|
+
log += ` ${r.outputId} ${r.txid}.${r.vout} ${r.transactionId} ${r.spendable ? 'spendable' : ''} sats:${r.satoshis}\n`
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return log
|
|
332
|
+
}
|
|
333
|
+
|
|
338
334
|
async processSyncChunk(
|
|
339
335
|
writer: EntityStorage,
|
|
340
336
|
args: sdk.RequestSyncChunkArgs,
|
|
@@ -346,66 +342,18 @@ export class EntitySyncState extends EntityBase<TableSyncState> {
|
|
|
346
342
|
inserts: number
|
|
347
343
|
}> {
|
|
348
344
|
const mes = [
|
|
349
|
-
new MergeEntity(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
),
|
|
354
|
-
new MergeEntity(
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
),
|
|
359
|
-
new MergeEntity(
|
|
360
|
-
|
|
361
|
-
EntityOutputTag.mergeFind,
|
|
362
|
-
this.syncMap.outputTag
|
|
363
|
-
),
|
|
364
|
-
new MergeEntity(
|
|
365
|
-
chunk.txLabels,
|
|
366
|
-
EntityTxLabel.mergeFind,
|
|
367
|
-
this.syncMap.txLabel
|
|
368
|
-
),
|
|
369
|
-
new MergeEntity(
|
|
370
|
-
chunk.transactions,
|
|
371
|
-
EntityTransaction.mergeFind,
|
|
372
|
-
this.syncMap.transaction
|
|
373
|
-
),
|
|
374
|
-
new MergeEntity(
|
|
375
|
-
chunk.outputs,
|
|
376
|
-
EntityOutput.mergeFind,
|
|
377
|
-
this.syncMap.output
|
|
378
|
-
),
|
|
379
|
-
new MergeEntity(
|
|
380
|
-
chunk.txLabelMaps,
|
|
381
|
-
EntityTxLabelMap.mergeFind,
|
|
382
|
-
this.syncMap.txLabelMap
|
|
383
|
-
),
|
|
384
|
-
new MergeEntity(
|
|
385
|
-
chunk.outputTagMaps,
|
|
386
|
-
EntityOutputTagMap.mergeFind,
|
|
387
|
-
this.syncMap.outputTagMap
|
|
388
|
-
),
|
|
389
|
-
new MergeEntity(
|
|
390
|
-
chunk.certificates,
|
|
391
|
-
EntityCertificate.mergeFind,
|
|
392
|
-
this.syncMap.certificate
|
|
393
|
-
),
|
|
394
|
-
new MergeEntity(
|
|
395
|
-
chunk.certificateFields,
|
|
396
|
-
EntityCertificateField.mergeFind,
|
|
397
|
-
this.syncMap.certificateField
|
|
398
|
-
),
|
|
399
|
-
new MergeEntity(
|
|
400
|
-
chunk.commissions,
|
|
401
|
-
EntityCommission.mergeFind,
|
|
402
|
-
this.syncMap.commission
|
|
403
|
-
),
|
|
404
|
-
new MergeEntity(
|
|
405
|
-
chunk.provenTxReqs,
|
|
406
|
-
EntityProvenTxReq.mergeFind,
|
|
407
|
-
this.syncMap.provenTxReq
|
|
408
|
-
)
|
|
345
|
+
new MergeEntity(chunk.provenTxs, EntityProvenTx.mergeFind, this.syncMap.provenTx),
|
|
346
|
+
new MergeEntity(chunk.outputBaskets, EntityOutputBasket.mergeFind, this.syncMap.outputBasket),
|
|
347
|
+
new MergeEntity(chunk.outputTags, EntityOutputTag.mergeFind, this.syncMap.outputTag),
|
|
348
|
+
new MergeEntity(chunk.txLabels, EntityTxLabel.mergeFind, this.syncMap.txLabel),
|
|
349
|
+
new MergeEntity(chunk.transactions, EntityTransaction.mergeFind, this.syncMap.transaction),
|
|
350
|
+
new MergeEntity(chunk.outputs, EntityOutput.mergeFind, this.syncMap.output),
|
|
351
|
+
new MergeEntity(chunk.txLabelMaps, EntityTxLabelMap.mergeFind, this.syncMap.txLabelMap),
|
|
352
|
+
new MergeEntity(chunk.outputTagMaps, EntityOutputTagMap.mergeFind, this.syncMap.outputTagMap),
|
|
353
|
+
new MergeEntity(chunk.certificates, EntityCertificate.mergeFind, this.syncMap.certificate),
|
|
354
|
+
new MergeEntity(chunk.certificateFields, EntityCertificateField.mergeFind, this.syncMap.certificateField),
|
|
355
|
+
new MergeEntity(chunk.commissions, EntityCommission.mergeFind, this.syncMap.commission),
|
|
356
|
+
new MergeEntity(chunk.provenTxReqs, EntityProvenTxReq.mergeFind, this.syncMap.provenTxReq)
|
|
409
357
|
]
|
|
410
358
|
|
|
411
359
|
let updates = 0
|
|
@@ -35,10 +35,7 @@ export class EntityTransaction extends EntityBase<TableTransaction> {
|
|
|
35
35
|
* Uses both spentBy and rawTx inputs (if available) to locate inputs from among user's outputs.
|
|
36
36
|
* Not all transaction inputs correspond to prior storage outputs.
|
|
37
37
|
*/
|
|
38
|
-
async getInputs(
|
|
39
|
-
storage: EntityStorage,
|
|
40
|
-
trx?: sdk.TrxToken
|
|
41
|
-
): Promise<TableOutput[]> {
|
|
38
|
+
async getInputs(storage: EntityStorage, trx?: sdk.TrxToken): Promise<TableOutput[]> {
|
|
42
39
|
const inputs = await storage.findOutputs({
|
|
43
40
|
partial: { userId: this.userId, spentBy: this.id },
|
|
44
41
|
trx
|
|
@@ -56,8 +53,7 @@ export class EntityTransaction extends EntityBase<TableTransaction> {
|
|
|
56
53
|
trx
|
|
57
54
|
})
|
|
58
55
|
)
|
|
59
|
-
if (pso && !inputs.some(i => i.outputId === pso.outputId))
|
|
60
|
-
inputs.push(pso)
|
|
56
|
+
if (pso && !inputs.some(i => i.outputId === pso.outputId)) inputs.push(pso)
|
|
61
57
|
}
|
|
62
58
|
return inputs
|
|
63
59
|
}
|
|
@@ -208,18 +204,12 @@ export class EntityTransaction extends EntityBase<TableTransaction> {
|
|
|
208
204
|
return 'transactions'
|
|
209
205
|
}
|
|
210
206
|
|
|
211
|
-
override equals(
|
|
212
|
-
ei: TableTransaction,
|
|
213
|
-
syncMap?: SyncMap | undefined
|
|
214
|
-
): boolean {
|
|
207
|
+
override equals(ei: TableTransaction, syncMap?: SyncMap | undefined): boolean {
|
|
215
208
|
const eo = this.toApi()
|
|
216
209
|
|
|
217
210
|
// Properties that are never updated
|
|
218
211
|
if (
|
|
219
|
-
eo.transactionId !==
|
|
220
|
-
(syncMap
|
|
221
|
-
? syncMap.transaction.idMap[verifyId(ei.transactionId)]
|
|
222
|
-
: ei.transactionId) ||
|
|
212
|
+
eo.transactionId !== (syncMap ? syncMap.transaction.idMap[verifyId(ei.transactionId)] : ei.transactionId) ||
|
|
223
213
|
eo.reference !== ei.reference
|
|
224
214
|
)
|
|
225
215
|
return false
|
|
@@ -239,11 +229,7 @@ export class EntityTransaction extends EntityBase<TableTransaction> {
|
|
|
239
229
|
|
|
240
230
|
if (
|
|
241
231
|
!eo.provenTxId !== !ei.provenTxId ||
|
|
242
|
-
(ei.provenTxId &&
|
|
243
|
-
eo.provenTxId !==
|
|
244
|
-
(syncMap
|
|
245
|
-
? syncMap.provenTx.idMap[verifyId(ei.provenTxId)]
|
|
246
|
-
: ei.provenTxId))
|
|
232
|
+
(ei.provenTxId && eo.provenTxId !== (syncMap ? syncMap.provenTx.idMap[verifyId(ei.provenTxId)] : ei.provenTxId))
|
|
247
233
|
)
|
|
248
234
|
return false
|
|
249
235
|
|
|
@@ -270,14 +256,8 @@ export class EntityTransaction extends EntityBase<TableTransaction> {
|
|
|
270
256
|
}
|
|
271
257
|
}
|
|
272
258
|
|
|
273
|
-
override async mergeNew(
|
|
274
|
-
|
|
275
|
-
userId: number,
|
|
276
|
-
syncMap: SyncMap,
|
|
277
|
-
trx?: sdk.TrxToken
|
|
278
|
-
): Promise<void> {
|
|
279
|
-
if (this.provenTxId)
|
|
280
|
-
this.provenTxId = syncMap.provenTx.idMap[this.provenTxId]
|
|
259
|
+
override async mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void> {
|
|
260
|
+
if (this.provenTxId) this.provenTxId = syncMap.provenTx.idMap[this.provenTxId]
|
|
281
261
|
this.userId = userId
|
|
282
262
|
this.transactionId = 0
|
|
283
263
|
this.transactionId = await storage.insertTransaction(this.toApi(), trx)
|
|
@@ -302,25 +282,20 @@ export class EntityTransaction extends EntityBase<TableTransaction> {
|
|
|
302
282
|
this.lockTime = ei.lockTime
|
|
303
283
|
this.isOutgoing = ei.isOutgoing
|
|
304
284
|
this.status = ei.status
|
|
305
|
-
this.provenTxId = ei.provenTxId
|
|
306
|
-
? syncMap.provenTx.idMap[ei.provenTxId]
|
|
307
|
-
: undefined
|
|
285
|
+
this.provenTxId = ei.provenTxId ? syncMap.provenTx.idMap[ei.provenTxId] : undefined
|
|
308
286
|
this.satoshis = ei.satoshis
|
|
309
287
|
this.txid = ei.txid
|
|
310
288
|
this.description = ei.description
|
|
311
289
|
this.rawTx = ei.rawTx
|
|
312
290
|
this.inputBEEF = ei.inputBEEF
|
|
313
|
-
this.updated_at = new Date()
|
|
291
|
+
this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()))
|
|
314
292
|
await storage.updateTransaction(this.id, this.toApi(), trx)
|
|
315
293
|
wasMerged = true
|
|
316
294
|
}
|
|
317
295
|
return wasMerged
|
|
318
296
|
}
|
|
319
297
|
|
|
320
|
-
async getProvenTx(
|
|
321
|
-
storage: EntityStorage,
|
|
322
|
-
trx?: sdk.TrxToken
|
|
323
|
-
): Promise<EntityProvenTx | undefined> {
|
|
298
|
+
async getProvenTx(storage: EntityStorage, trx?: sdk.TrxToken): Promise<EntityProvenTx | undefined> {
|
|
324
299
|
if (!this.provenTxId) return undefined
|
|
325
300
|
const p = verifyOneOrNone(
|
|
326
301
|
await storage.findProvenTxs({
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import { MerklePath } from '@bsv/sdk'
|
|
3
|
-
import {
|
|
4
|
-
arraysEqual,
|
|
5
|
-
sdk,
|
|
6
|
-
TableTxLabel,
|
|
7
|
-
verifyId,
|
|
8
|
-
verifyOneOrNone
|
|
9
|
-
} from '../../../index.client'
|
|
3
|
+
import { arraysEqual, sdk, TableTxLabel, verifyId, verifyOneOrNone } from '../../../index.client'
|
|
10
4
|
import { EntityBase, EntityStorage, SyncMap } from '.'
|
|
11
5
|
|
|
12
6
|
export class EntityTxLabel extends EntityBase<TableTxLabel> {
|
|
@@ -94,9 +88,7 @@ export class EntityTxLabel extends EntityBase<TableTxLabel> {
|
|
|
94
88
|
syncMap: SyncMap,
|
|
95
89
|
trx?: sdk.TrxToken
|
|
96
90
|
): Promise<{ found: boolean; eo: EntityTxLabel; eiId: number }> {
|
|
97
|
-
const ef = verifyOneOrNone(
|
|
98
|
-
await storage.findTxLabels({ partial: { label: ei.label, userId }, trx })
|
|
99
|
-
)
|
|
91
|
+
const ef = verifyOneOrNone(await storage.findTxLabels({ partial: { label: ei.label, userId }, trx }))
|
|
100
92
|
return {
|
|
101
93
|
found: !!ef,
|
|
102
94
|
eo: new EntityTxLabel(ef || { ...ei }),
|
|
@@ -104,12 +96,7 @@ export class EntityTxLabel extends EntityBase<TableTxLabel> {
|
|
|
104
96
|
}
|
|
105
97
|
}
|
|
106
98
|
|
|
107
|
-
override async mergeNew(
|
|
108
|
-
storage: EntityStorage,
|
|
109
|
-
userId: number,
|
|
110
|
-
syncMap: SyncMap,
|
|
111
|
-
trx?: sdk.TrxToken
|
|
112
|
-
): Promise<void> {
|
|
99
|
+
override async mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void> {
|
|
113
100
|
this.userId = userId
|
|
114
101
|
this.txLabelId = 0
|
|
115
102
|
this.txLabelId = await storage.insertTxLabel(this.toApi(), trx)
|
|
@@ -125,7 +112,7 @@ export class EntityTxLabel extends EntityBase<TableTxLabel> {
|
|
|
125
112
|
let wasMerged = false
|
|
126
113
|
if (ei.updated_at > this.updated_at) {
|
|
127
114
|
this.isDeleted = ei.isDeleted
|
|
128
|
-
this.updated_at = new Date()
|
|
115
|
+
this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()))
|
|
129
116
|
await storage.updateTxLabel(this.id, this.toApi(), trx)
|
|
130
117
|
wasMerged = true
|
|
131
118
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import { MerklePath } from '@bsv/sdk'
|
|
3
|
-
import {
|
|
4
|
-
arraysEqual,
|
|
5
|
-
sdk,
|
|
6
|
-
TableTxLabelMap,
|
|
7
|
-
verifyId,
|
|
8
|
-
verifyOneOrNone
|
|
9
|
-
} from '../../../index.client'
|
|
3
|
+
import { arraysEqual, sdk, TableTxLabelMap, verifyId, verifyOneOrNone } from '../../../index.client'
|
|
10
4
|
import { EntityBase, EntityStorage, SyncMap } from '.'
|
|
11
5
|
|
|
12
6
|
export class EntityTxLabelMap extends EntityBase<TableTxLabelMap> {
|
|
@@ -72,14 +66,8 @@ export class EntityTxLabelMap extends EntityBase<TableTxLabelMap> {
|
|
|
72
66
|
const eo = this.toApi()
|
|
73
67
|
|
|
74
68
|
if (
|
|
75
|
-
eo.transactionId !==
|
|
76
|
-
|
|
77
|
-
? syncMap.transaction.idMap[verifyId(ei.transactionId)]
|
|
78
|
-
: ei.transactionId) ||
|
|
79
|
-
eo.txLabelId !==
|
|
80
|
-
(syncMap
|
|
81
|
-
? syncMap.txLabel.idMap[verifyId(ei.txLabelId)]
|
|
82
|
-
: ei.txLabelId) ||
|
|
69
|
+
eo.transactionId !== (syncMap ? syncMap.transaction.idMap[verifyId(ei.transactionId)] : ei.transactionId) ||
|
|
70
|
+
eo.txLabelId !== (syncMap ? syncMap.txLabel.idMap[verifyId(ei.txLabelId)] : ei.txLabelId) ||
|
|
83
71
|
eo.isDeleted !== ei.isDeleted
|
|
84
72
|
)
|
|
85
73
|
return false
|
|
@@ -109,12 +97,7 @@ export class EntityTxLabelMap extends EntityBase<TableTxLabelMap> {
|
|
|
109
97
|
}
|
|
110
98
|
}
|
|
111
99
|
|
|
112
|
-
override async mergeNew(
|
|
113
|
-
storage: EntityStorage,
|
|
114
|
-
userId: number,
|
|
115
|
-
syncMap: SyncMap,
|
|
116
|
-
trx?: sdk.TrxToken
|
|
117
|
-
): Promise<void> {
|
|
100
|
+
override async mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void> {
|
|
118
101
|
this.transactionId = syncMap.transaction.idMap[this.transactionId]
|
|
119
102
|
this.txLabelId = syncMap.txLabel.idMap[this.txLabelId]
|
|
120
103
|
await storage.insertTxLabelMap(this.toApi(), trx)
|
|
@@ -130,13 +113,8 @@ export class EntityTxLabelMap extends EntityBase<TableTxLabelMap> {
|
|
|
130
113
|
let wasMerged = false
|
|
131
114
|
if (ei.updated_at > this.updated_at) {
|
|
132
115
|
this.isDeleted = ei.isDeleted
|
|
133
|
-
this.updated_at = new Date()
|
|
134
|
-
await storage.updateTxLabelMap(
|
|
135
|
-
this.transactionId,
|
|
136
|
-
this.txLabelId,
|
|
137
|
-
this.toApi(),
|
|
138
|
-
trx
|
|
139
|
-
)
|
|
116
|
+
this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()))
|
|
117
|
+
await storage.updateTxLabelMap(this.transactionId, this.txLabelId, this.toApi(), trx)
|
|
140
118
|
wasMerged = true
|
|
141
119
|
}
|
|
142
120
|
return wasMerged
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
2
|
import { MerklePath } from '@bsv/sdk'
|
|
3
|
-
import {
|
|
4
|
-
arraysEqual,
|
|
5
|
-
sdk,
|
|
6
|
-
TableUser,
|
|
7
|
-
verifyId,
|
|
8
|
-
verifyOneOrNone
|
|
9
|
-
} from '../../../index.client'
|
|
3
|
+
import { arraysEqual, sdk, TableUser, verifyId, verifyOneOrNone } from '../../../index.client'
|
|
10
4
|
import { EntityBase, EntityStorage, SyncMap } from '.'
|
|
11
5
|
|
|
12
6
|
export class EntityUser extends EntityBase<TableUser> {
|
|
@@ -73,11 +67,7 @@ export class EntityUser extends EntityBase<TableUser> {
|
|
|
73
67
|
|
|
74
68
|
override equals(ei: TableUser, syncMap?: SyncMap | undefined): boolean {
|
|
75
69
|
const eo = this.toApi()
|
|
76
|
-
if (
|
|
77
|
-
eo.identityKey != ei.identityKey ||
|
|
78
|
-
eo.activeStorage != ei.activeStorage
|
|
79
|
-
)
|
|
80
|
-
return false
|
|
70
|
+
if (eo.identityKey != ei.identityKey || eo.activeStorage != ei.activeStorage) return false
|
|
81
71
|
if (!syncMap) {
|
|
82
72
|
/** */
|
|
83
73
|
}
|
|
@@ -89,26 +79,16 @@ export class EntityUser extends EntityBase<TableUser> {
|
|
|
89
79
|
ei: TableUser,
|
|
90
80
|
trx?: sdk.TrxToken
|
|
91
81
|
): Promise<{ found: boolean; eo: EntityUser; eiId: number }> {
|
|
92
|
-
const ef = verifyOneOrNone(
|
|
93
|
-
|
|
94
|
-
)
|
|
95
|
-
if (ef && ef.userId != userId)
|
|
96
|
-
throw new sdk.WERR_INTERNAL('logic error, userIds don not match.')
|
|
82
|
+
const ef = verifyOneOrNone(await storage.findUsers({ partial: { identityKey: ei.identityKey }, trx }))
|
|
83
|
+
if (ef && ef.userId != userId) throw new sdk.WERR_INTERNAL('logic error, userIds don not match.')
|
|
97
84
|
return {
|
|
98
85
|
found: !!ef,
|
|
99
86
|
eo: new EntityUser(ef || { ...ei }),
|
|
100
87
|
eiId: verifyId(ei.userId)
|
|
101
88
|
}
|
|
102
89
|
}
|
|
103
|
-
override async mergeNew(
|
|
104
|
-
|
|
105
|
-
userId: number,
|
|
106
|
-
syncMap: SyncMap,
|
|
107
|
-
trx?: sdk.TrxToken
|
|
108
|
-
): Promise<void> {
|
|
109
|
-
throw new sdk.WERR_INTERNAL(
|
|
110
|
-
'a sync chunk merge must never create a new user'
|
|
111
|
-
)
|
|
90
|
+
override async mergeNew(storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: sdk.TrxToken): Promise<void> {
|
|
91
|
+
throw new sdk.WERR_INTERNAL('a sync chunk merge must never create a new user')
|
|
112
92
|
}
|
|
113
93
|
override async mergeExisting(
|
|
114
94
|
storage: EntityStorage,
|
|
@@ -120,12 +100,9 @@ export class EntityUser extends EntityBase<TableUser> {
|
|
|
120
100
|
let wasMerged = false
|
|
121
101
|
// The condition on activeStorage here is critical as a new user record may have just been created
|
|
122
102
|
// in a backup store to which a backup is being pushed.
|
|
123
|
-
if (
|
|
124
|
-
ei.updated_at > this.updated_at ||
|
|
125
|
-
(this.activeStorage === undefined && ei.activeStorage !== undefined)
|
|
126
|
-
) {
|
|
103
|
+
if (ei.updated_at > this.updated_at || (this.activeStorage === undefined && ei.activeStorage !== undefined)) {
|
|
127
104
|
this.activeStorage = ei.activeStorage
|
|
128
|
-
this.updated_at = new Date()
|
|
105
|
+
this.updated_at = new Date(Math.max(ei.updated_at.getTime(), this.updated_at.getTime()))
|
|
129
106
|
await storage.updateUser(this.id, this.toApi(), trx)
|
|
130
107
|
wasMerged = true
|
|
131
108
|
}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
sdk,
|
|
4
|
-
SyncMap,
|
|
5
|
-
TableCertificate,
|
|
6
|
-
TableCertificateField
|
|
7
|
-
} from '../../../../../src'
|
|
8
|
-
import {
|
|
9
|
-
TestUtilsWalletStorage as _tu,
|
|
10
|
-
TestWalletNoSetup
|
|
11
|
-
} from '../../../../../test/utils/TestUtilsWalletStorage'
|
|
1
|
+
import { createSyncMap, sdk, SyncMap, TableCertificate, TableCertificateField } from '../../../../../src'
|
|
2
|
+
import { TestUtilsWalletStorage as _tu, TestWalletNoSetup } from '../../../../../test/utils/TestUtilsWalletStorage'
|
|
12
3
|
import { EntityCertificateField } from '../../../../../src/storage/schema/entities/CertificateField'
|
|
13
4
|
|
|
14
5
|
describe('CertificateField class method tests', () => {
|
|
@@ -21,9 +12,7 @@ describe('CertificateField class method tests', () => {
|
|
|
21
12
|
beforeAll(async () => {
|
|
22
13
|
if (env.runMySQL) {
|
|
23
14
|
ctxs.push(await _tu.createLegacyWalletMySQLCopy('CertificateFieldTests'))
|
|
24
|
-
ctxs2.push(
|
|
25
|
-
await _tu.createLegacyWalletMySQLCopy('CertificateFieldTests2')
|
|
26
|
-
)
|
|
15
|
+
ctxs2.push(await _tu.createLegacyWalletMySQLCopy('CertificateFieldTests2'))
|
|
27
16
|
}
|
|
28
17
|
ctxs.push(await _tu.createLegacyWalletSQLiteCopy('CertificateFieldTests'))
|
|
29
18
|
ctxs2.push(await _tu.createLegacyWalletSQLiteCopy('CertificateFieldTests2'))
|
|
@@ -50,14 +39,10 @@ describe('CertificateField class method tests', () => {
|
|
|
50
39
|
userId: 1,
|
|
51
40
|
type: Buffer.from('exampleType').toString('base64'), // Base64-encoded string
|
|
52
41
|
serialNumber: Buffer.from('serial123').toString('base64'), // Base64-encoded string
|
|
53
|
-
certifier:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
revocationOutpoint:
|
|
58
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0', // OutpointString
|
|
59
|
-
signature:
|
|
60
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890', // HexString
|
|
42
|
+
certifier: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef1234', // PubKeyHex
|
|
43
|
+
subject: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef5678', // PubKeyHex
|
|
44
|
+
revocationOutpoint: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0', // OutpointString
|
|
45
|
+
signature: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890', // HexString
|
|
61
46
|
isDeleted: false
|
|
62
47
|
}
|
|
63
48
|
|
|
@@ -106,14 +91,10 @@ describe('CertificateField class method tests', () => {
|
|
|
106
91
|
userId: 1,
|
|
107
92
|
type: Buffer.from('exampleType1').toString('base64'), // Unique Base64-encoded string
|
|
108
93
|
serialNumber: Buffer.from('serial123-1').toString('base64'), // Unique Base64-encoded string
|
|
109
|
-
certifier:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
revocationOutpoint:
|
|
114
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0', // Same OutpointString
|
|
115
|
-
signature:
|
|
116
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890', // Same HexString
|
|
94
|
+
certifier: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef1234', // Same PubKeyHex
|
|
95
|
+
subject: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef5678', // Same PubKeyHex
|
|
96
|
+
revocationOutpoint: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0', // Same OutpointString
|
|
97
|
+
signature: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890', // Same HexString
|
|
117
98
|
isDeleted: false
|
|
118
99
|
})
|
|
119
100
|
|
|
@@ -124,14 +105,10 @@ describe('CertificateField class method tests', () => {
|
|
|
124
105
|
userId: 1,
|
|
125
106
|
type: Buffer.from('exampleType2').toString('base64'), // Unique Base64-encoded string
|
|
126
107
|
serialNumber: Buffer.from('serial123-2').toString('base64'), // Unique Base64-encoded string
|
|
127
|
-
certifier:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
revocationOutpoint:
|
|
132
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:1', // Unique OutpointString
|
|
133
|
-
signature:
|
|
134
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890', // Same HexString
|
|
108
|
+
certifier: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef5678', // Same PubKeyHex
|
|
109
|
+
subject: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef5678', // Same PubKeyHex
|
|
110
|
+
revocationOutpoint: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:1', // Unique OutpointString
|
|
111
|
+
signature: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890', // Same HexString
|
|
135
112
|
isDeleted: false
|
|
136
113
|
})
|
|
137
114
|
|
|
@@ -187,14 +164,10 @@ describe('CertificateField class method tests', () => {
|
|
|
187
164
|
userId: 1,
|
|
188
165
|
type: Buffer.from('exampleTypeMerge').toString('base64'),
|
|
189
166
|
serialNumber: Buffer.from('serialMerge123').toString('base64'),
|
|
190
|
-
certifier:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
revocationOutpoint:
|
|
195
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0',
|
|
196
|
-
signature:
|
|
197
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890',
|
|
167
|
+
certifier: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef1234',
|
|
168
|
+
subject: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef5678',
|
|
169
|
+
revocationOutpoint: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0',
|
|
170
|
+
signature: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890',
|
|
198
171
|
isDeleted: false
|
|
199
172
|
})
|
|
200
173
|
|
|
@@ -265,14 +238,10 @@ describe('CertificateField class method tests', () => {
|
|
|
265
238
|
userId: 1,
|
|
266
239
|
type: Buffer.from('exampleTypeNoMerge').toString('base64'),
|
|
267
240
|
serialNumber: Buffer.from('serialNoMerge123').toString('base64'),
|
|
268
|
-
certifier:
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
revocationOutpoint:
|
|
273
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0',
|
|
274
|
-
signature:
|
|
275
|
-
'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890',
|
|
241
|
+
certifier: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef1234',
|
|
242
|
+
subject: '02c123eabcdeff1234567890abcdef1234567890abcdef1234567890abcdef5678',
|
|
243
|
+
revocationOutpoint: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0',
|
|
244
|
+
signature: 'abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890',
|
|
276
245
|
isDeleted: false
|
|
277
246
|
})
|
|
278
247
|
|