Skip to content

Commit 0920f48

Browse files
committed
Support network in default location and readme
1 parent 88e9e02 commit 0920f48

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import soroban
2020
soroban.invoke(contract_id="AAAA...", function_name="increment")
2121
```
2222

23-
Identity and Network configurations are automatically pulled from the global
24-
or local configuration.
23+
Identity and Network configurations are automatically pulled from the
24+
local configuration or the current working directory. See bellow.
2525

2626
It also provides a CLI
2727
```shell

src/soroban/models.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ class Identity(BaseSettings):
3333
keypair: Keypair | None = None
3434

3535
model_config = SettingsConfigDict(
36-
env_file=["identity.toml", ".soroban/identity/identity.toml"]
36+
env_file=[
37+
"identity.toml",
38+
pathlib.Path(".soroban") / "identity" / "identity.toml",
39+
]
3740
)
3841

3942
@model_validator(mode="after")
@@ -81,7 +84,9 @@ class NetworkConfig(BaseSettings):
8184
network_passphrase: str = Network.TESTNET_NETWORK_PASSPHRASE
8285
base_fee: int = 100
8386

84-
model_config = SettingsConfigDict(env_file="network.toml")
87+
model_config = SettingsConfigDict(
88+
env_file=["network.toml", pathlib.Path(".soroban") / "network" / "network.toml"]
89+
)
8590

8691
@model_validator(mode="after")
8792
def load_urls(self) -> "NetworkConfig":

0 commit comments

Comments
 (0)