Skip to content

Commit

Permalink
[refactor]: update client configs, cover full in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Balashov <[email protected]>
  • Loading branch information
0x009922 committed Feb 16, 2024
1 parent c075c85 commit d10f251
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
22 changes: 22 additions & 0 deletions client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,26 @@ mod tests {
fn web_login_bad() {
let _err = WebLogin::from_str("alice:wonderland").expect_err("input has `:`");
}

#[test]
fn parse_full_toml_config() {
let _: RootPartial = toml::toml! {
chain_id = "00000000-0000-0000-0000-000000000000"
torii_url = "http://127.0.0.1:8080/"

[basic_auth]
web_login = "mad_hatter"
password = "ilovetea"

[account]
id = "alice@wonderland"
public_key = "ed01207233BFC89DCBD68C19FDE6CE6158225298EC1131B6A130D1AEB454C1AB5183C0"
private_key = { digest_function = "ed25519", payload = "9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0" }

[transaction]
time_to_live = 100_000
status_timeout = 100_000
nonce = false
}.try_into().unwrap();
}
}
9 changes: 4 additions & 5 deletions configs/client.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
[account]
# id =
# public_key =
# private_key.digest_function =
# private_key.payload =
# private_key = { algorithm = "", payload = "" }

[transaction]
# time_to_live = 100_000
# status_timeout = 100_000
# time_to_live = "100s"
# status_timeout = "100s"
## Nonce is TODO describe what it is
# nonce = false

9 changes: 5 additions & 4 deletions configs/swarm/client.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
chain_id = "00000000-0000-0000-0000-000000000000"
torii_url = "http://127.0.0.1:8080/"
basic_auth.web_login = "mad_hatter"
basic_auth.password = "ilovetea"

[basic_auth]
web_login = "mad_hatter"
password = "ilovetea"

[account]
id = "alice@wonderland"
public_key = "ed01207233BFC89DCBD68C19FDE6CE6158225298EC1131B6A130D1AEB454C1AB5183C0"
private_key.digest_function = "ed25519"
private_key.payload = "9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"
private_key = { digest_function = "ed25519", payload = "9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0" }

0 comments on commit d10f251

Please sign in to comment.