Format docs using linter and prettier.

This commit is contained in:
Spencer Ofwiti
2021-05-11 20:51:48 +03:00
parent 5228842e61
commit 208c448984
309 changed files with 11327 additions and 3307 deletions

View File

@@ -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 &#x27;@angular/core&#x27;;
import {Settings} from &#x27;@app/_models&#x27;;
import {TransactionHelper} from &#x27;cic-client&#x27;;
import {first} from &#x27;rxjs/operators&#x27;;
import {TransactionService} from &#x27;@app/_services/transaction.service&#x27;;
import {environment} from &#x27;@src/environments/environment&#x27;;
import {LoggingService} from &#x27;@app/_services/logging.service&#x27;;
import {RegistryService} from &#x27;@app/_services/registry.service&#x27;;
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from &#x27;@angular/core&#x27;;
import { Settings } from &#x27;@app/_models&#x27;;
import { TransactionHelper } from &#x27;cic-client&#x27;;
import { first } from &#x27;rxjs/operators&#x27;;
import { TransactionService } from &#x27;@app/_services/transaction.service&#x27;;
import { environment } from &#x27;@src/environments/environment&#x27;;
import { LoggingService } from &#x27;@app/_services/logging.service&#x27;;
import { RegistryService } from &#x27;@app/_services/registry.service&#x27;;
@Injectable({
providedIn: &#x27;root&#x27;
providedIn: &#x27;root&#x27;,
})
export class BlockSyncService {
readyStateTarget: number &#x3D; 2;
@@ -872,8 +872,8 @@ export class BlockSyncService {
constructor(
private transactionService: TransactionService,
private loggingService: LoggingService,
private registryService: RegistryService,
) { }
private registryService: RegistryService
) {}
blockSync(address: string &#x3D; null, offset: number &#x3D; 0, limit: number &#x3D; 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 |&#x3D; bit;
if (this.readyStateTarget &#x3D;&#x3D;&#x3D; this.readyState &amp;&amp; this.readyStateTarget) {
const wHeadSync: Worker &#x3D; new Worker(&#x27;./../assets/js/block-sync/head.js&#x27;);
@@ -909,13 +916,19 @@ export class BlockSyncService {
w3_provider: settings.w3.provider,
});
if (address &#x3D;&#x3D;&#x3D; null) {
this.transactionService.getAllTransactions(offset, limit).pipe(first()).subscribe(res &#x3D;&gt; {
this.fetcher(settings, res);
});
this.transactionService
.getAllTransactions(offset, limit)
.pipe(first())
.subscribe((res) &#x3D;&gt; {
this.fetcher(settings, res);
});
} else {
this.transactionService.getAddressTransactions(address, offset, limit).pipe(first()).subscribe(res &#x3D;&gt; {
this.fetcher(settings, res);
});
this.transactionService
.getAddressTransactions(address, offset, limit)
.pipe(first())
.subscribe((res) &#x3D;&gt; {
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&lt;void&gt; {
async scan(
settings: Settings,
lo: number,
hi: number,
bloomBlockBytes: Uint8Array,
bloomBlocktxBytes: Uint8Array,
bloomRounds: any
): Promise&lt;void&gt; {
const w: Worker &#x3D; new Worker(&#x27;./../assets/js/block-sync/ondemand.js&#x27;);
w.onmessage &#x3D; (m) &#x3D;&gt; {
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 &#x3D; window.atob(transactionsInfo.block_filter);
const bOne: Uint8Array &#x3D; new Uint8Array(blockFilterBinstr.length);
bOne.map((e, i, v) &#x3D;&gt; v[i] &#x3D; blockFilterBinstr.charCodeAt(i));
bOne.map((e, i, v) &#x3D;&gt; (v[i] &#x3D; blockFilterBinstr.charCodeAt(i)));
const blocktxFilterBinstr: string &#x3D; window.atob(transactionsInfo.blocktx_filter);
const bTwo: Uint8Array &#x3D; new Uint8Array(blocktxFilterBinstr.length);
bTwo.map((e, i, v) &#x3D;&gt; v[i] &#x3D; blocktxFilterBinstr.charCodeAt(i));
bTwo.map((e, i, v) &#x3D;&gt; (v[i] &#x3D; 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>