Skip to content

Commit

Permalink
Update test UI
Browse files Browse the repository at this point in the history
  • Loading branch information
gantunesr committed Dec 14, 2022
1 parent 209d663 commit 9b94d26
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions app/components/Views/Wallet/SnapDuplex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ export abstract class SnapDuplex extends Duplex {
}

protected _onData(data: StreamData): void {
console.log('MESSAGE FROM', this._jobId, data);
// eslint-disable-next-line no-console
console.log(
'[SNAP DUPLEX LOG] SnapDuplex+_onData: Job',
this._jobId,
'read data',
data,
);
if (data.jobId !== this._jobId) {
return;
}
Expand All @@ -44,14 +50,22 @@ export abstract class SnapDuplex extends Duplex {
}

_write(data: StreamData, _encoding: string | null, cb: () => void): void {
console.log('MESSAGE TO', this._jobId, Object.keys(data.data));
// eslint-disable-next-line no-console
console.log(
'[SNAP DUPLEX LOG] SnapDuplex+_write: Job',
this._jobId,
'write data (keys)',
Object.keys(data.data),
);
this._stream.write({ data, jobId: this._jobId });
cb();
}

destroy() {
console.log('Destroy SnapDuplex');
// eslint-disable-next-line no-console
console.log(
'[SNAP DUPLEX LOG] SnapDuplex+destroy: Destroy stream from SnapDuplex',
);
this._stream.destroy();
console.log(!!this._stream);
}
}

0 comments on commit 9b94d26

Please sign in to comment.