@bsv/wallet-toolbox 1.1.51 → 1.1.52
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/out/src/storage/schema/entities/Transaction.js +2 -2
- package/out/src/storage/schema/entities/Transaction.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 +2 -1
- package/out/test/Wallet/local/localWallet.man.test.js.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.d.ts +1 -0
- package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
- package/out/test/utils/TestUtilsWalletStorage.js +20 -4
- package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/storage/schema/entities/Transaction.ts +2 -2
- package/test/Wallet/local/localWallet.man.test.ts +2 -1
- package/test/utils/TestUtilsWalletStorage.ts +24 -5
package/package.json
CHANGED
|
@@ -242,7 +242,7 @@ export class EntityTransaction extends EntityBase<TableTransaction> {
|
|
|
242
242
|
(ei.provenTxId &&
|
|
243
243
|
eo.provenTxId !==
|
|
244
244
|
(syncMap
|
|
245
|
-
? syncMap.
|
|
245
|
+
? syncMap.provenTx.idMap[verifyId(ei.provenTxId)]
|
|
246
246
|
: ei.provenTxId))
|
|
247
247
|
)
|
|
248
248
|
return false
|
|
@@ -303,7 +303,7 @@ export class EntityTransaction extends EntityBase<TableTransaction> {
|
|
|
303
303
|
this.isOutgoing = ei.isOutgoing
|
|
304
304
|
this.status = ei.status
|
|
305
305
|
this.provenTxId = ei.provenTxId
|
|
306
|
-
? syncMap.
|
|
306
|
+
? syncMap.provenTx.idMap[ei.provenTxId]
|
|
307
307
|
: undefined
|
|
308
308
|
this.satoshis = ei.satoshis
|
|
309
309
|
this.txid = ei.txid
|
|
@@ -163,7 +163,8 @@ async function createSetup(chain: sdk.Chain): Promise<TestWalletNoSetup> {
|
|
|
163
163
|
rootKeyHex: env.devKeys[env.testIdentityKey],
|
|
164
164
|
filePath: env.testFilePath,
|
|
165
165
|
setActiveClient: false,
|
|
166
|
-
addLocalBackup: false
|
|
166
|
+
addLocalBackup: false,
|
|
167
|
+
useMySQLConnectionForClient: false
|
|
167
168
|
})
|
|
168
169
|
|
|
169
170
|
console.log(`ACTIVE STORAGE: ${setup.storage.getActiveStoreName()}`)
|
|
@@ -352,6 +352,7 @@ export abstract class TestUtilsWalletStorage {
|
|
|
352
352
|
let filePath: string
|
|
353
353
|
let addLocalBackup = false
|
|
354
354
|
let setActiveClient = false
|
|
355
|
+
let useMySQLConnectionForClient = false
|
|
355
356
|
if (typeof args === 'string') {
|
|
356
357
|
chain = args
|
|
357
358
|
const env = _tu.getEnv(chain)
|
|
@@ -369,6 +370,7 @@ export abstract class TestUtilsWalletStorage {
|
|
|
369
370
|
filePath = args.filePath
|
|
370
371
|
addLocalBackup = args.addLocalBackup === true
|
|
371
372
|
setActiveClient = args.setActiveClient === true
|
|
373
|
+
useMySQLConnectionForClient = args.useMySQLConnectionForClient === true
|
|
372
374
|
}
|
|
373
375
|
|
|
374
376
|
const databaseName = path.parse(filePath).name
|
|
@@ -380,12 +382,28 @@ export abstract class TestUtilsWalletStorage {
|
|
|
380
382
|
})
|
|
381
383
|
setup.localStorageIdentityKey = setup.storage.getActiveStore()
|
|
382
384
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
let client: sdk.WalletStorageProvider
|
|
386
|
+
if (useMySQLConnectionForClient) {
|
|
387
|
+
const env = _tu.getEnv(chain)
|
|
388
|
+
if (!env.cloudMySQLConnection)
|
|
389
|
+
throw new sdk.WERR_INVALID_PARAMETER(
|
|
390
|
+
'env.cloundMySQLConnection',
|
|
391
|
+
'valid'
|
|
392
|
+
)
|
|
393
|
+
const connection = JSON.parse(env.cloudMySQLConnection)
|
|
394
|
+
client = new StorageKnex({
|
|
395
|
+
...StorageKnex.defaultOptions(),
|
|
396
|
+
knex: _tu.createMySQLFromConnection(connection),
|
|
397
|
+
chain: env.chain
|
|
398
|
+
})
|
|
399
|
+
} else {
|
|
400
|
+
const endpointUrl =
|
|
401
|
+
chain === 'main'
|
|
402
|
+
? 'https://storage.babbage.systems'
|
|
403
|
+
: 'https://staging-storage.babbage.systems'
|
|
387
404
|
|
|
388
|
-
|
|
405
|
+
client = new StorageClient(setup.wallet, endpointUrl)
|
|
406
|
+
}
|
|
389
407
|
setup.clientStorageIdentityKey = (
|
|
390
408
|
await client.makeAvailable()
|
|
391
409
|
).storageIdentityKey
|
|
@@ -2515,4 +2533,5 @@ export interface CreateTestWalletArgs {
|
|
|
2515
2533
|
filePath: string
|
|
2516
2534
|
addLocalBackup?: boolean
|
|
2517
2535
|
setActiveClient?: boolean
|
|
2536
|
+
useMySQLConnectionForClient?: boolean
|
|
2518
2537
|
}
|