more deb
This commit is contained in:
parent
0ba919cc71
commit
14ca9b669c
3 changed files with 6 additions and 6 deletions
|
|
@ -186,7 +186,7 @@ export class DebitManager {
|
||||||
this.notifyPaymentSuccess(appUser, debitRes, op, { appId: ctx.app_id, pub: req.npub, id: req.request_id })
|
this.notifyPaymentSuccess(appUser, debitRes, op, { appId: ctx.app_id, pub: req.npub, id: req.request_id })
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
throw new Error("invalid response type")
|
throw new Error("invalid debit response type")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ export class StorageInterface extends EventEmitter {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (response.type !== op.type) {
|
if (response.type !== op.type) {
|
||||||
reject(new Error('Invalid response type'));
|
reject(new Error('Invalid storage response type'));
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resolve(response.data);
|
resolve(response.data);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export type TlvStorageInterface = {
|
||||||
export class TlvStorageFactory extends EventEmitter {
|
export class TlvStorageFactory extends EventEmitter {
|
||||||
private process: ChildProcess;
|
private process: ChildProcess;
|
||||||
private isConnected: boolean = false;
|
private isConnected: boolean = false;
|
||||||
private debug: boolean = true;
|
private debug: boolean = false;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
@ -62,7 +62,7 @@ export class TlvStorageFactory extends EventEmitter {
|
||||||
|
|
||||||
async LoadLatest(storageName: string, limit?: number): Promise<LatestData> {
|
async LoadLatest(storageName: string, limit?: number): Promise<LatestData> {
|
||||||
const opId = Math.random().toString()
|
const opId = Math.random().toString()
|
||||||
const op: LoadLatestTlvOperation = { type: 'loadLatestTlv', opId, storageName, limit }
|
const op: LoadLatestTlvOperation = { type: 'loadLatestTlv', opId, storageName, limit, debug: true }
|
||||||
const latestData = await this.handleOp<SerializableLatestData>(op)
|
const latestData = await this.handleOp<SerializableLatestData>(op)
|
||||||
const deserializedLatestData: LatestData = {}
|
const deserializedLatestData: LatestData = {}
|
||||||
for (const appId in latestData) {
|
for (const appId in latestData) {
|
||||||
|
|
@ -76,7 +76,7 @@ export class TlvStorageFactory extends EventEmitter {
|
||||||
|
|
||||||
async LoadFile(storageName: string, appId: string, dataName: string, chunk: number): Promise<TlvFile> {
|
async LoadFile(storageName: string, appId: string, dataName: string, chunk: number): Promise<TlvFile> {
|
||||||
const opId = Math.random().toString()
|
const opId = Math.random().toString()
|
||||||
const op: LoadTlvFileOperation = { type: 'loadTlvFile', opId, storageName, appId, dataName, chunk }
|
const op: LoadTlvFileOperation = { type: 'loadTlvFile', opId, storageName, appId, dataName, chunk, debug: true }
|
||||||
const tlvFile = await this.handleOp<SerializableTlvFile>(op)
|
const tlvFile = await this.handleOp<SerializableTlvFile>(op)
|
||||||
return { fileData: Buffer.from(tlvFile.base64fileData, 'base64'), chunks: tlvFile.chunks }
|
return { fileData: Buffer.from(tlvFile.base64fileData, 'base64'), chunks: tlvFile.chunks }
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ export class TlvStorageFactory extends EventEmitter {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (response.type !== op.type) {
|
if (response.type !== op.type) {
|
||||||
reject(new Error('Invalid response type'));
|
reject(new Error('Invalid tlv storage response type'));
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resolve(response.data);
|
resolve(response.data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue