Format docs using linter and prettier.
This commit is contained in:
@@ -327,8 +327,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="101"
|
||||
class="link-to-prism">src/app/_services/block-sync.service.ts:101</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="118"
|
||||
class="link-to-prism">src/app/_services/block-sync.service.ts:118</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -409,8 +409,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="76"
|
||||
class="link-to-prism">src/app/_services/block-sync.service.ts:76</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="89"
|
||||
class="link-to-prism">src/app/_services/block-sync.service.ts:89</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -479,8 +479,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="68"
|
||||
class="link-to-prism">src/app/_services/block-sync.service.ts:68</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="81"
|
||||
class="link-to-prism">src/app/_services/block-sync.service.ts:81</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -669,8 +669,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="84"
|
||||
class="link-to-prism">src/app/_services/block-sync.service.ts:84</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="97"
|
||||
class="link-to-prism">src/app/_services/block-sync.service.ts:97</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -853,17 +853,17 @@
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {Injectable} from '@angular/core';
|
||||
import {Settings} from '@app/_models';
|
||||
import {TransactionHelper} from 'cic-client';
|
||||
import {first} from 'rxjs/operators';
|
||||
import {TransactionService} from '@app/_services/transaction.service';
|
||||
import {environment} from '@src/environments/environment';
|
||||
import {LoggingService} from '@app/_services/logging.service';
|
||||
import {RegistryService} from '@app/_services/registry.service';
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
||||
import { Settings } from '@app/_models';
|
||||
import { TransactionHelper } from 'cic-client';
|
||||
import { first } from 'rxjs/operators';
|
||||
import { TransactionService } from '@app/_services/transaction.service';
|
||||
import { environment } from '@src/environments/environment';
|
||||
import { LoggingService } from '@app/_services/logging.service';
|
||||
import { RegistryService } from '@app/_services/registry.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class BlockSyncService {
|
||||
readyStateTarget: number = 2;
|
||||
@@ -872,8 +872,8 @@ export class BlockSyncService {
|
||||
constructor(
|
||||
private transactionService: TransactionService,
|
||||
private loggingService: LoggingService,
|
||||
private registryService: RegistryService,
|
||||
) { }
|
||||
private registryService: RegistryService
|
||||
) {}
|
||||
|
||||
blockSync(address: string = null, offset: number = 0, limit: number = 100): void {
|
||||
this.transactionService.resetTransactionsList();
|
||||
@@ -898,7 +898,14 @@ export class BlockSyncService {
|
||||
settings.registry.load();
|
||||
}
|
||||
|
||||
readyStateProcessor(settings: Settings, bit: number, address: string, offset: number, limit: number): void {
|
||||
readyStateProcessor(
|
||||
settings: Settings,
|
||||
bit: number,
|
||||
address: string,
|
||||
offset: number,
|
||||
limit: number
|
||||
): void {
|
||||
// tslint:disable-next-line:no-bitwise
|
||||
this.readyState |= bit;
|
||||
if (this.readyStateTarget === this.readyState && this.readyStateTarget) {
|
||||
const wHeadSync: Worker = new Worker('./../assets/js/block-sync/head.js');
|
||||
@@ -909,13 +916,19 @@ export class BlockSyncService {
|
||||
w3_provider: settings.w3.provider,
|
||||
});
|
||||
if (address === null) {
|
||||
this.transactionService.getAllTransactions(offset, limit).pipe(first()).subscribe(res => {
|
||||
this.fetcher(settings, res);
|
||||
});
|
||||
this.transactionService
|
||||
.getAllTransactions(offset, limit)
|
||||
.pipe(first())
|
||||
.subscribe((res) => {
|
||||
this.fetcher(settings, res);
|
||||
});
|
||||
} else {
|
||||
this.transactionService.getAddressTransactions(address, offset, limit).pipe(first()).subscribe(res => {
|
||||
this.fetcher(settings, res);
|
||||
});
|
||||
this.transactionService
|
||||
.getAddressTransactions(address, offset, limit)
|
||||
.pipe(first())
|
||||
.subscribe((res) => {
|
||||
this.fetcher(settings, res);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -936,7 +949,14 @@ export class BlockSyncService {
|
||||
});
|
||||
}
|
||||
|
||||
async scan(settings: Settings, lo: number, hi: number, bloomBlockBytes: Uint8Array, bloomBlocktxBytes: Uint8Array, bloomRounds: any): Promise<void> {
|
||||
async scan(
|
||||
settings: Settings,
|
||||
lo: number,
|
||||
hi: number,
|
||||
bloomBlockBytes: Uint8Array,
|
||||
bloomBlocktxBytes: Uint8Array,
|
||||
bloomRounds: any
|
||||
): Promise<void> {
|
||||
const w: Worker = new Worker('./../assets/js/block-sync/ondemand.js');
|
||||
w.onmessage = (m) => {
|
||||
settings.txHelper.processReceipt(m.data);
|
||||
@@ -945,10 +965,7 @@ export class BlockSyncService {
|
||||
w3_provider: settings.w3.provider,
|
||||
lo,
|
||||
hi,
|
||||
filters: [
|
||||
bloomBlockBytes,
|
||||
bloomBlocktxBytes,
|
||||
],
|
||||
filters: [bloomBlockBytes, bloomBlocktxBytes],
|
||||
filter_rounds: bloomRounds,
|
||||
});
|
||||
}
|
||||
@@ -956,13 +973,20 @@ export class BlockSyncService {
|
||||
fetcher(settings: Settings, transactionsInfo: any): void {
|
||||
const blockFilterBinstr: string = window.atob(transactionsInfo.block_filter);
|
||||
const bOne: Uint8Array = new Uint8Array(blockFilterBinstr.length);
|
||||
bOne.map((e, i, v) => v[i] = blockFilterBinstr.charCodeAt(i));
|
||||
bOne.map((e, i, v) => (v[i] = blockFilterBinstr.charCodeAt(i)));
|
||||
|
||||
const blocktxFilterBinstr: string = window.atob(transactionsInfo.blocktx_filter);
|
||||
const bTwo: Uint8Array = new Uint8Array(blocktxFilterBinstr.length);
|
||||
bTwo.map((e, i, v) => v[i] = blocktxFilterBinstr.charCodeAt(i));
|
||||
bTwo.map((e, i, v) => (v[i] = blocktxFilterBinstr.charCodeAt(i)));
|
||||
|
||||
settings.scanFilter(settings, transactionsInfo.low, transactionsInfo.high, bOne, bTwo, transactionsInfo.filter_rounds);
|
||||
settings.scanFilter(
|
||||
settings,
|
||||
transactionsInfo.low,
|
||||
transactionsInfo.high,
|
||||
bOne,
|
||||
bTwo,
|
||||
transactionsInfo.filter_rounds
|
||||
);
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
Reference in New Issue
Block a user