Skip to content

Commit

Permalink
Fix tsc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
forshtat committed Feb 14, 2024
1 parent 1917021 commit fbb95cc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
9 changes: 5 additions & 4 deletions packages/bundler/src/modules/RIP7560BundleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const debug = Debug('aa.exec.cron')

export class RIP7560BundleManager extends BaseBundleManager implements IBundleManager {
sentBundles: SendBundleReturn[] = []
lastScannedBlock: number = 0

constructor (
mempoolManager: MempoolManager,
Expand Down Expand Up @@ -65,14 +66,14 @@ export class RIP7560BundleManager extends BaseBundleManager implements IBundleMa
(transaction as any).paymasterGas = transaction.paymasterVerificationGasLimit
userOpHashes.push(getRIP7560TransactionHash(transaction))
}
const transactionHash = await this.provider.send('eth_sendAATransactionsBundle', [
const bundleHash = await this.provider.send('eth_sendAATransactionsBundle', [
transactions, creationBlock, expectedRevenue, bundlerId
])
console.log(transactionHash)
console.log(bundleHash)
this.sentBundles.push({
transactionHash,
transactionHash: bundleHash,
userOpHashes
})
return transactionHash
return bundleHash
}
}
4 changes: 2 additions & 2 deletions packages/validation-manager/src/IValidationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export interface ValidateUserOpResult extends ValidationResult {

export interface IValidationManager {

validateInputParameters: (operation: BaseOperation, entryPointInput?: string) => void
validateInputParameters: (operation: BaseOperation, entryPointInput?: string, requireSignature?: boolean, requireGasParams?: boolean) => void

validateOperation: (userOp: BaseOperation, previousCodeHashes?: ReferencedCodeHashes) => Promise<ValidateUserOpResult>
validateOperation: (userOp: BaseOperation, previousCodeHashes?: ReferencedCodeHashes, checkStakes?: boolean) => Promise<ValidateUserOpResult>

getOperationHash: (userOp: BaseOperation) => Promise<string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { IValidationManager, ValidateUserOpResult } from './IValidationManager'

export class RIP7560ValidationManager implements IValidationManager {
validateInputParameters (operation: BaseOperation, entryPointInput: string): void {
validateInputParameters (operation: BaseOperation, entryPointInput?: string): void {
// throw new Error('Method not implemented.');
}

Expand Down
12 changes: 7 additions & 5 deletions packages/validation-manager/src/ValidationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,12 @@ export class ValidationManager implements IValidationManager {
* validate UserOperation.
* should also handle unmodified memory (e.g. by referencing cached storage in the mempool
* one item to check that was un-modified is the aggregator..
* @param userOp
* @param operation
* @param previousCodeHashes
* @param checkStakes
*/
async validateOperation (userOp: UserOperation, previousCodeHashes?: ReferencedCodeHashes, checkStakes = true): Promise<ValidateUserOpResult> {
async validateOperation (operation: BaseOperation, previousCodeHashes?: ReferencedCodeHashes, checkStakes: boolean = true): Promise<ValidateUserOpResult> {
const userOp = operation as UserOperation
if (previousCodeHashes != null && previousCodeHashes.addresses.length > 0) {
const { hash: codeHashes } = await this.getCodeHashes(previousCodeHashes.addresses)
// [COD-010]
Expand Down Expand Up @@ -257,14 +258,15 @@ export class ValidationManager implements IValidationManager {

/**
* perform static checking on input parameters.
* @param userOp
* @param operation
* @param entryPointInput
* @param requireSignature
* @param requireGasParams
*/
validateInputParameters (userOp: UserOperation, entryPointInput: string, requireSignature = true, requireGasParams = true): void {
validateInputParameters (operation: BaseOperation, entryPointInput?: string, requireSignature = true, requireGasParams = true): void {
const userOp = operation as UserOperation
requireCond(entryPointInput != null, 'No entryPoint param', ValidationErrors.InvalidFields)
requireCond(entryPointInput.toLowerCase() === this.entryPoint.address.toLowerCase(),
requireCond(entryPointInput?.toLowerCase() === this.entryPoint.address.toLowerCase(),
`The EntryPoint at "${entryPointInput}" is not supported. This bundler uses ${this.entryPoint.address}`,
ValidationErrors.InvalidFields)

Expand Down

0 comments on commit fbb95cc

Please sign in to comment.