Skip to content

Commit

Permalink
style: resolve style guide violations
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastijankuzner authored and github-actions[bot] committed Oct 3, 2024
1 parent 0fc00ea commit 94bff42
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/crypto-config/source/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {injectable } from "@mainsail/container";
import { Contracts,Exceptions } from "@mainsail/contracts";
import { injectable } from "@mainsail/container";
import { Contracts, Exceptions } from "@mainsail/contracts";
import { Utils } from "@mainsail/kernel";
import deepmerge from "deepmerge";
import clone from "lodash.clone";
Expand Down
2 changes: 1 addition & 1 deletion packages/state/source/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { inject,injectable } from "@mainsail/container";
import { inject, injectable } from "@mainsail/container";
import { Contracts, Events, Identifiers } from "@mainsail/contracts";
import { Utils } from "@mainsail/kernel";

Expand Down
4 changes: 2 additions & 2 deletions packages/transaction-pool-service/source/mempool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Mempool implements Contracts.TransactionPool.Mempool {
}

const transactions = senderMempool.removeTransaction(id);
this.#removeDisposableMempool(address)
this.#removeDisposableMempool(address);

return transactions;
}
Expand All @@ -73,7 +73,7 @@ export class Mempool implements Contracts.TransactionPool.Mempool {
continue;
}

removedTransactions.push(...await senderMempool.reAddTransactions());
removedTransactions.push(...(await senderMempool.reAddTransactions()));
}

return removedTransactions;
Expand Down
4 changes: 2 additions & 2 deletions packages/transaction-pool-service/source/sender-mempool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class SenderMempool implements Contracts.TransactionPool.SenderMempool {
}
const transactions = this.#transactions.splice(index, this.#transactions.length - index).reverse();

for(const transaction of transactions) {
for (const transaction of transactions) {
this.senderState.revert(transaction);
}

Expand All @@ -94,7 +94,7 @@ export class SenderMempool implements Contracts.TransactionPool.SenderMempool {
for (const transaction of transactions) {
try {
await this.addTransaction(transaction);
} catch {
} catch {
removedTransactions.push(transaction);
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/transaction-pool-service/source/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export class Service implements Contracts.TransactionPool.Service {

const removedTransactions = await this.mempool.reAddTransactions(sendersAddresses);


for (const transaction of removedTransactions) {
this.storage.removeTransaction(transaction.id);
this.logger.debug(`Removed tx ${transaction.id}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/transaction-pool-worker/source/handlers/commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class CommitHandler {
@inject(Identifiers.Services.Log.Service)
protected readonly logger!: Contracts.Kernel.Logger;

public async handle(height: number, sendersAddresses: string[] ): Promise<void> {
public async handle(height: number, sendersAddresses: string[]): Promise<void> {
try {
this.stateStore.setHeight(height);

Expand Down
10 changes: 3 additions & 7 deletions packages/transaction-pool-worker/source/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,14 @@ export class Worker implements Contracts.TransactionPool.Worker {
return this.ipcSubprocess.getQueueSize();
}


async onCommit(unit: Contracts.Processor.ProcessableUnit): Promise<void> {
const sendersAddresses: Set<string> = new Set();

for(const transaction of unit.getBlock().transactions) {
for (const transaction of unit.getBlock().transactions) {
sendersAddresses.add(await this.addressFactory.fromPublicKey(transaction.data.senderPublicKey));
};
}

await this.ipcSubprocess.sendRequest("commit",
unit.height,
[...sendersAddresses.keys()],
);
await this.ipcSubprocess.sendRequest("commit", unit.height, [...sendersAddresses.keys()]);
}

public async start(): Promise<void> {
Expand Down

0 comments on commit 94bff42

Please sign in to comment.