Skip to content

Commit

Permalink
refactor: Define params as const and using spread syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomenezes committed Dec 18, 2023
1 parent 0620f70 commit cb8f5b9
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/handlers/InputAdded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,11 @@ export default class InputAdded implements Handler {
transactionHash: log.transaction?.hash,
});

input.erc20Deposit = await this.prepareErc20Deposit(
input,
block,
ctx,
{
inputId,
},
);

input.erc721Deposit = await this.prepareErc721Deposit(
input,
block,
ctx,
{
inputId,
},
);
const params = [input, block, ctx, { inputId }] as const;

input.erc20Deposit = await this.prepareErc20Deposit(...params);

input.erc721Deposit = await this.prepareErc721Deposit(...params);

this.inputStorage.set(inputId, input);
ctx.log.info(`${inputId} (Input) stored`);
Expand Down

0 comments on commit cb8f5b9

Please sign in to comment.