Skip to content

Commit

Permalink
✨ Make call trace configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed Oct 5, 2023
1 parent 50708a3 commit c233d24
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 58 deletions.
16 changes: 16 additions & 0 deletions woke/config/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,21 @@ class DeploymentConfig(WokeConfigModel):
silent: bool = False


class GeneralConfig(WokeConfigModel):
call_trace_options: FrozenSet[str] = frozenset(
[
"contract_name",
"function_name",
"arguments",
"status",
"call_type",
"value",
"return_value",
"error",
]
)


class TopLevelConfig(WokeConfigModel):
subconfigs: List[Path] = []
api_keys: Dict[str, str] = {}
Expand All @@ -220,6 +235,7 @@ class TopLevelConfig(WokeConfigModel):
lsp: LspConfig = Field(default_factory=LspConfig)
testing: TestingConfig = Field(default_factory=TestingConfig)
deployment: DeploymentConfig = Field(default_factory=DeploymentConfig)
general: GeneralConfig = Field(default_factory=GeneralConfig)

@validator("subconfigs", pre=True, each_item=True)
def set_subconfig(cls, v):
Expand Down
8 changes: 8 additions & 0 deletions woke/config/woke_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
CompilerConfig,
DeploymentConfig,
DetectorsConfig,
GeneralConfig,
GeneratorConfig,
LspConfig,
TestingConfig,
Expand Down Expand Up @@ -371,3 +372,10 @@ def deployment(self) -> DeploymentConfig:
Return deployment-specific config options.
"""
return self.__config.deployment

@property
def general(self) -> GeneralConfig:
"""
Return general config options.
"""
return self.__config.general
Loading

0 comments on commit c233d24

Please sign in to comment.