Skip to content

Commit 2de7397

Browse files
authored
Change typecasting to as type format (#3969)
* Change typecasting to as type format * fix nit
1 parent b843695 commit 2de7397

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

packages/binarytree/src/db/checkpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class CheckpointDB implements DB {
165165
value !== undefined
166166
? value instanceof Uint8Array
167167
? value
168-
: unprefixedHexToBytes(<string>value)
168+
: unprefixedHexToBytes(value as string)
169169
: undefined
170170
this._cache?.set(keyHex, returnValue)
171171
if (this.hasCheckpoints()) {
@@ -250,7 +250,7 @@ export class CheckpointDB implements DB {
250250
}
251251
this._stats.db.writes += 1
252252
if (op.type === 'put' && this.valueEncoding === ValueEncoding.String) {
253-
convertedOp.value = bytesToUnprefixedHex(<Uint8Array>convertedOp.value)
253+
convertedOp.value = bytesToUnprefixedHex(convertedOp.value as Uint8Array)
254254
}
255255
return convertedOp
256256
})

packages/block/src/block/block.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export class Block {
158158
* Returns a Array of the raw Bytes Arrays of this block, in order.
159159
*/
160160
raw(): BlockBytes {
161-
const bytesArray = <BlockBytes>[
161+
const bytesArray: BlockBytes = [
162162
this.header.raw(),
163163
this.transactions.map((tx) =>
164164
tx.supports(Capability.EIP2718TypedTransaction) ? tx.serialize() : tx.raw(),

packages/mpt/src/db/checkpointDB.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class CheckpointDB implements DB {
165165
value !== undefined
166166
? value instanceof Uint8Array
167167
? value
168-
: unprefixedHexToBytes(<string>value)
168+
: unprefixedHexToBytes(value as string)
169169
: undefined
170170
this._cache?.set(keyHex, returnValue)
171171
if (this.hasCheckpoints()) {
@@ -250,7 +250,7 @@ export class CheckpointDB implements DB {
250250
}
251251
this._stats.db.writes += 1
252252
if (op.type === 'put' && this.valueEncoding === ValueEncoding.String) {
253-
convertedOp.value = bytesToUnprefixedHex(<Uint8Array>convertedOp.value)
253+
convertedOp.value = bytesToUnprefixedHex(convertedOp.value as Uint8Array)
254254
}
255255
return convertedOp
256256
})

packages/mpt/src/mpt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export class MerklePatriciaTrie {
333333
let progress = 0
334334
for (let i = 0; i < partialPath.stack.length - 1; i++) {
335335
stack[i] = partialPath.stack[i]
336-
progress += stack[i] instanceof BranchMPTNode ? 1 : (<ExtensionMPTNode>stack[i]).keyLength()
336+
progress += stack[i] instanceof BranchMPTNode ? 1 : (stack[i] as ExtensionMPTNode).keyLength()
337337
}
338338
this.DEBUG && this.debug(`Target (${targetKey.length}): [${targetKey}]`, ['find_path'])
339339
let result: Path | null = null

packages/tx/src/1559/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ export class FeeMarket1559Tx
351351
}
352352

353353
sign(privateKey: Uint8Array, extraEntropy: Uint8Array | boolean = false): FeeMarket1559Tx {
354-
return <FeeMarket1559Tx>Legacy.sign(this, privateKey, extraEntropy)
354+
return Legacy.sign(this, privateKey, extraEntropy) as FeeMarket1559Tx
355355
}
356356

357357
public isSigned(): boolean {

packages/tx/src/2930/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export class AccessList2930Tx
325325
}
326326

327327
sign(privateKey: Uint8Array, extraEntropy: Uint8Array | boolean = false): AccessList2930Tx {
328-
return <AccessList2930Tx>Legacy.sign(this, privateKey, extraEntropy)
328+
return Legacy.sign(this, privateKey, extraEntropy) as AccessList2930Tx
329329
}
330330

331331
isSigned(): boolean {

packages/tx/src/4844/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ export class Blob4844Tx implements TransactionInterface<typeof TransactionType.B
441441
}
442442

443443
sign(privateKey: Uint8Array, extraEntropy: Uint8Array | boolean = false): Blob4844Tx {
444-
return <Blob4844Tx>Legacy.sign(this, privateKey, extraEntropy)
444+
return Legacy.sign(this, privateKey, extraEntropy) as Blob4844Tx
445445
}
446446

447447
public isSigned(): boolean {

packages/tx/src/7702/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export class EOACode7702Tx implements TransactionInterface<typeof TransactionTyp
391391
}
392392

393393
sign(privateKey: Uint8Array, extraEntropy: Uint8Array | boolean = false): EOACode7702Tx {
394-
return <EOACode7702Tx>Legacy.sign(this, privateKey, extraEntropy)
394+
return Legacy.sign(this, privateKey, extraEntropy) as EOACode7702Tx
395395
}
396396

397397
public isSigned(): boolean {

packages/tx/src/legacy/tx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export class LegacyTx implements TransactionInterface<typeof TransactionType.Leg
397397
}
398398

399399
sign(privateKey: Uint8Array, extraEntropy: Uint8Array | boolean = false): LegacyTx {
400-
return <LegacyTx>Legacy.sign(this, privateKey, extraEntropy)
400+
return Legacy.sign(this, privateKey, extraEntropy) as LegacyTx
401401
}
402402

403403
/**

packages/util/src/withdrawal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function withdrawalToBytesArray(withdrawal: Withdrawal | WithdrawalData):
4444
? new Uint8Array()
4545
: toType(validatorIndex, TypeOutput.Uint8Array)
4646
const addressBytes =
47-
address instanceof Address ? (<Address>address).bytes : toType(address, TypeOutput.Uint8Array)
47+
address instanceof Address ? address.bytes : toType(address, TypeOutput.Uint8Array)
4848

4949
const amountBytes =
5050
toType(amount, TypeOutput.BigInt) === BIGINT_0

0 commit comments

Comments
 (0)