Skip to content

Commit

Permalink
fix: unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbrugneaux committed Sep 2, 2024
1 parent fd80328 commit 596224c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/web3-core/src/web3_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from 'web3-types';
import { ConfigHardforkMismatchError, ConfigChainMismatchError } from 'web3-errors';
import { isNullish, toHex } from 'web3-utils';
import { ValidationSchemaInput, Schema } from 'web3-validator';
import { ValidationSchemaInput } from 'web3-validator';
import { TransactionTypeParser } from './types.js';
// eslint-disable-next-line import/no-cycle
import { TransactionBuilder } from './web3_context.js';
Expand Down Expand Up @@ -523,11 +523,11 @@ export abstract class Web3Config
this.config.transactionTypeParser = val;
}

public get customTransactionSchema() {
public get customTransactionSchema(): ValidationSchemaInput | undefined {
return this.config.customTransactionSchema;
}

public set customTransactionSchema(schema: ValidationSchemaInput) {
public set customTransactionSchema(schema: ValidationSchemaInput | undefined) {
this._triggerConfigChange('customTransactionSchema', schema);
this.config.customTransactionSchema = schema;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-core/src/web3_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ export class Web3Context<
this._requestManager =
requestManager ??
new Web3RequestManager<API>(
config,
provider,
config?.enableExperimentalFeatures?.useSubscriptionWhenCheckingBlockTimeout,
requestManagerMiddleware,
config,
);

if (subscriptionManager) {
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-core/src/web3_request_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import {
} from './utils.js';
import { Web3EventEmitter } from './web3_event_emitter.js';
import { RequestManagerMiddleware } from './types.js';
import { Web3ConfigEvent, Web3ConfigOptions } from './web3_config.js';
import { Web3ConfigOptions } from './web3_config.js';

export enum Web3RequestManagerEvent {
PROVIDER_CHANGED = 'PROVIDER_CHANGED',
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth/src/utils/format_transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function formatTransaction<
transaction: TransactionType,
returnFormat: ReturnFormat = DEFAULT_RETURN_FORMAT as ReturnFormat,
options: {
transactionSchema?: ValidationSchemaInput | typeof transactionSchema;
transactionSchema?: ValidationSchemaInput | typeof transactionSchema | undefined;
fillInputAndData?: boolean;
} = {
transactionSchema: transactionInfoSchema,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const prepareTransactionForSigning = async (

validateTransactionForSigning(
formattedTransaction as unknown as FormatType<Transaction, typeof ETH_DATA_FORMAT>,
undefined,
{
transactionSchema: web3Context.config.customTransactionSchema,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export const validateTransactionForSigning = (
validateHardfork(transaction);

const formattedTransaction = formatTransaction(transaction as Transaction, ETH_DATA_FORMAT, {
transactionSchema: options.transactionInfoSchema,
transactionSchema: options.transactionSchema,
});
validateGas(formattedTransaction);

Expand Down

0 comments on commit 596224c

Please sign in to comment.