Skip to content

Commit 8c6f55a

Browse files
authored
Remove redundant raises (#3640)
* Remove redundant raises * Lint
1 parent 3c55545 commit 8c6f55a

File tree

9 files changed

+18
-24
lines changed

9 files changed

+18
-24
lines changed

execution_chain/core/gaslimit.nim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Nimbus
2-
# Copyright (c) 2018-2024 Status Research & Development GmbH
2+
# Copyright (c) 2018-2025 Status Research & Development GmbH
33
# Licensed under either of
44
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
55
# http://www.apache.org/licenses/LICENSE-2.0)
@@ -54,8 +54,7 @@ proc calcEip1599BaseFee*(com: CommonRef; parent: Header): UInt256 =
5454

5555
# consensus/misc/eip1559.go(32): func VerifyEip1559Header(config [..]
5656
proc verifyEip1559Header(com: CommonRef;
57-
parent, header: Header): Result[void, string]
58-
{.raises: [].} =
57+
parent, header: Header): Result[void, string] =
5958
## Verify that the gas limit remains within allowed bounds
6059
let limit = if com.isLondonOrLater(parent.number):
6160
parent.gasLimit

execution_chain/core/tx_pool/tx_desc.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ proc classifyValid(xp: TxPoolRef; tx: Transaction, sender: Address): bool =
235235
true
236236

237237
proc validateBlobTransactionWrapper(tx: PooledTransaction, fork: EVMFork):
238-
Result[void, string] {.raises: [].} =
238+
Result[void, string] =
239239
if tx.blobsBundle.isNil:
240240
return err("tx wrapper is none")
241241

execution_chain/core/validate.nim

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ proc validateHeader(
102102
ok()
103103

104104
proc validateUncles(com: CommonRef; header: Header; txFrame: CoreDbTxRef,
105-
uncles: openArray[Header]): Result[void,string]
106-
{.gcsafe, raises: [].} =
105+
uncles: openArray[Header]): Result[void,string] =
107106
let hasUncles = uncles.len > 0
108107
let shouldHaveUncles = header.ommersHash != EMPTY_UNCLE_HASH
109108

@@ -376,8 +375,7 @@ proc validateHeaderAndKinship*(
376375
blk: Block;
377376
parent: Header;
378377
txFrame: CoreDbTxRef
379-
): Result[void, string]
380-
{.gcsafe, raises: [].} =
378+
): Result[void, string] =
381379
template header: Header = blk.header
382380

383381
if header.isGenesis:

execution_chain/db/aristo/aristo_profile.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ proc updateTotal(t: AristoDbProfListRef; fnInx: uint) =
6161

6262
# ---------------------
6363

64-
func ppUs(elapsed: Duration): string {.gcsafe, raises: [].} =
64+
func ppUs(elapsed: Duration): string =
6565
result = $elapsed.inMicroseconds
6666
let ns = elapsed.inNanoseconds mod 1_000 # fraction of a micro second
6767
if ns != 0:
@@ -70,7 +70,7 @@ func ppUs(elapsed: Duration): string {.gcsafe, raises: [].} =
7070
result &= &".{du:02}"
7171
result &= "us"
7272

73-
func ppMs(elapsed: Duration): string {.gcsafe, raises: [].} =
73+
func ppMs(elapsed: Duration): string =
7474
result = $elapsed.inMilliseconds
7575
let ns = elapsed.inNanoseconds mod 1_000_000 # fraction of a milli second
7676
if ns != 0:
@@ -79,7 +79,7 @@ func ppMs(elapsed: Duration): string {.gcsafe, raises: [].} =
7979
result &= &".{dm:02}"
8080
result &= "ms"
8181

82-
func ppSecs(elapsed: Duration): string {.gcsafe, raises: [].} =
82+
func ppSecs(elapsed: Duration): string =
8383
result = $elapsed.inSeconds
8484
let ns = elapsed.inNanoseconds mod 1_000_000_000 # fraction of a second
8585
if ns != 0:
@@ -88,7 +88,7 @@ func ppSecs(elapsed: Duration): string {.gcsafe, raises: [].} =
8888
result &= &".{ds:02}"
8989
result &= "s"
9090

91-
func ppMins(elapsed: Duration): string {.gcsafe, raises: [].} =
91+
func ppMins(elapsed: Duration): string =
9292
result = $elapsed.inMinutes
9393
let ns = elapsed.inNanoseconds mod 60_000_000_000 # fraction of a minute
9494
if ns != 0:

execution_chain/db/payload_body_db.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ proc getExecutionPayloadBodyV1*(
5454
var wds: seq[WithdrawalV1]
5555
body.withdrawals = Opt.some(wds)
5656
return ok(move(body))
57-
57+
5858
wrapRlpException info:
5959
let bytes = db.get(withdrawalsKey(withdrawalsRoot).toOpenArray).valueOr:
6060
if error.error != KvtNotFound:
@@ -66,13 +66,13 @@ proc getExecutionPayloadBodyV1*(
6666
wds.add(wd)
6767
body.withdrawals = Opt.some(wds)
6868
return ok(move(body))
69-
69+
7070
var list = rlp.decode(bytes, seq[WithdrawalV1])
7171
body.withdrawals = Opt.some(move(list))
7272

7373
ok(move(body))
7474

75-
func toPayloadBody*(blk: Block): ExecutionPayloadBodyV1 {.raises:[].} =
75+
func toPayloadBody*(blk: Block): ExecutionPayloadBodyV1 =
7676
var wds: seq[WithdrawalV1]
7777
if blk.withdrawals.isSome:
7878
for w in blk.withdrawals.get:

execution_chain/evm/interpreter/op_handlers/oph_create.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import
3838
# ------------------------------------------------------------------------------
3939

4040
proc execSubCreate(c: Computation; childMsg: Message;
41-
code: CodeBytesRef) {.raises: [].} =
41+
code: CodeBytesRef) =
4242
## Create new VM -- helper for `Create`-like operations
4343

4444
# need to provide explicit <c> and <child> for capturing in chainTo proc()

execution_chain/evm/state.nim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ func blockCtx(header: Header): BlockContext =
6666

6767
# --------------
6868

69-
proc `$`*(vmState: BaseVMState): string
70-
{.gcsafe, raises: [].} =
69+
proc `$`*(vmState: BaseVMState): string =
7170
if vmState.isNil:
7271
result = "nil"
7372
else:

execution_chain/rpc/server_api.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ proc setupServerAPI*(api: ServerAPIRef, server: RpcServer, ctx: EthContext) =
233233

234234
proc getLogsForBlock(
235235
chain: ForkedChainRef, header: Header, opts: FilterOptions
236-
): Opt[seq[FilterLog]] {.gcsafe, raises: [].} =
236+
): Opt[seq[FilterLog]] =
237237
if headerBloomFilter(header, opts.address, opts.topics):
238238
let
239239
blkHash = header.computeBlockHash
@@ -261,7 +261,7 @@ proc setupServerAPI*(api: ServerAPIRef, server: RpcServer, ctx: EthContext) =
261261
start: base.BlockNumber,
262262
finish: base.BlockNumber,
263263
opts: FilterOptions,
264-
): seq[FilterLog] {.gcsafe, raises: [].} =
264+
): seq[FilterLog] =
265265
var
266266
logs = newSeq[FilterLog]()
267267
blockNum = start

execution_chain/utils/utils.nim

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func sumHash*(hashes: varargs[Hash32]): Hash32 =
7878
ctx.finish result.data
7979
ctx.clear()
8080

81-
proc sumHash*(body: BlockBody): Hash32 {.gcsafe, raises: [].} =
81+
proc sumHash*(body: BlockBody): Hash32 =
8282
let txRoot = calcTxRoot(body.transactions)
8383
let ommersHash = keccak256(rlp.encode(body.uncles))
8484
let wdRoot = if body.withdrawals.isSome:
@@ -87,9 +87,7 @@ proc sumHash*(body: BlockBody): Hash32 {.gcsafe, raises: [].} =
8787
sumHash(txRoot, ommersHash, wdRoot)
8888

8989
proc sumHash*(header: Header): Hash32 =
90-
let wdRoot = if header.withdrawalsRoot.isSome:
91-
header.withdrawalsRoot.get
92-
else: EMPTY_ROOT_HASH
90+
let wdRoot = header.withdrawalsRoot.get(EMPTY_ROOT_HASH)
9391
sumHash(header.txRoot, header.ommersHash, wdRoot)
9492

9593
func hasBody*(h: Header): bool =

0 commit comments

Comments
 (0)