Skip to content

Commit 5118de7

Browse files
mazurromanclaude
andcommitted
Merge main into rm/optional-type-hints-evm-repl, resolve conflict
Both branches touched __init__'s signature. Resolution combines both changes: Optional[str]/Optional[int] for all nullable scalar params (this branch) and Optional[List[str]] = None for constructor_args / function_args with the `or []` body normalisation (from main). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 parents 04b208a + 93fb5bd commit 5118de7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/soldb/compiler/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class CompilerConfig:
2121
build_dir: str = "./build"
2222

2323
# ETHDebug compilation flags
24-
ethdebug_flags: List[str] = None
25-
24+
ethdebug_flags: Optional[List[str]] = None
25+
2626
# Production compilation flags (optional)
27-
production_flags: List[str] = None
27+
production_flags: Optional[List[str]] = None
2828

2929
def __post_init__(self):
3030
if self.ethdebug_flags is None:

src/soldb/core/evm_repl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def prompt(self):
3737
return self._get_prompt()
3838

3939
def __init__(self, contract_address: Optional[str] = None, debug_file: Optional[str] = None,
40-
rpc_url: str = "http://localhost:8545", ethdebug_dir: Optional[str] = None, constructor_args: List[str] = [],
41-
function_name: Optional[str] = None, function_args: List[str] = [],
40+
rpc_url: str = "http://localhost:8545", ethdebug_dir: Optional[str] = None, constructor_args: Optional[List[str]] = None,
41+
function_name: Optional[str] = None, function_args: Optional[List[str]] = None,
4242
abi_path: Optional[str] = None, from_addr: Optional[str] = None, block: Optional[int] = None,
4343
tracer: Optional[TransactionTracer] = None, contract_name: Optional[str] = None, value: int = 0):
4444
super().__init__()
@@ -109,7 +109,7 @@ def __init__(self, contract_address: Optional[str] = None, debug_file: Optional[
109109
self.source_lines = {} # filename -> lines
110110
self.current_function = None # Current function context
111111
self.function_name = function_name
112-
self.function_args = function_args
112+
self.function_args = function_args or []
113113
self.init = False
114114
self.abi_path = abi_path
115115
self.from_addr = from_addr

src/soldb/parsers/dwarf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _parse_from_zasm(self):
197197
try:
198198
push_num = int(''.join(filter(str.isdigit, line.split()[0])))
199199
current_pc += 1 + push_num
200-
except:
200+
except ValueError:
201201
current_pc += 1
202202
else:
203203
current_pc += 1

src/soldb/utils/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def decode_event_log(tracer, log_entry: Dict[str, Any]) -> Dict[str, Any]:
204204
text_signature = response_data['text_signature']
205205
if isinstance(text_signature, list) and text_signature:
206206
text_signature = text_signature[0]
207-
except:
207+
except Exception:
208208
pass
209209

210210
if data_length % 32 == 0:

0 commit comments

Comments
 (0)