Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcl committed Feb 15, 2024
1 parent c5b01e8 commit 6b645fb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ Sample TOML config:
```toml
selected_networks = ["arbitrum_goerli", "optimism_goerli"]

[RpcHttpUrls]
[RpcHttpUrls_secret]
arbitrum_goerli = ["https://devnet-2.mt/ABC/rpc/"]

[WalletKeys]
[WalletKeys_secret]
arbitrum_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
optimism_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
```
Expand All @@ -85,13 +85,13 @@ then your TOML file should look like that:
[Network]
selected_networks = ["arbitrum_goerli"]

[Network.RpcHttpUrls]
[Network.RpcHttpUrls_secret]
arbitrum_goerli = ["https://devnet-2.mt/ABC/rpc/"]

[Network.RpcWsUrls]
[Network.RpcWsUrls_secret]
arbitrum_goerli = ["ws://devnet-2.mt/ABC/rpc/"]

[Network.WalletKeys]
[Network.WalletKeys_secret]
arbitrum_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
```

Expand Down
6 changes: 3 additions & 3 deletions config/examples/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ bearer_token="my-awesome-token"
[Network]
selected_networks=["polygon_mumbai"]

[Network.RpcHttpUrls]
[Network.RpcHttpUrls_secret]
polygon_mumbai = ["https://polygon-endpoint.io"]

[Network.RpcWsUrls]
[Network.RpcWsUrls_secret]
polygon_mumbai = ["wss://polygon-endpoint.io"]

[Network.WalletKeys]
[Network.WalletKeys_secret]
polygon_mumbai = ["change-me-to-your-PK"]

[PrivateEthereumNetwork]
Expand Down
32 changes: 16 additions & 16 deletions networks/known_networks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ func TestMustGetSelectedNetworkConfig_Missing_RpcHttpUrls(t *testing.T) {
testTOML := `
selected_networks = ["arbitrum_goerli"]
[RpcWsUrls]
[RpcWsUrls_secret]
arbitrum_goerli = ["wss://devnet-1.mt/ABC/rpc/"]
[WalletKeys]
[WalletKeys_secret]
arbitrum_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
`

Expand All @@ -52,10 +52,10 @@ func TestMustGetSelectedNetworkConfig_Missing_RpcWsUrls(t *testing.T) {
testTOML := `
selected_networks = ["arbitrum_goerli"]
[RpcHttpUrls]
[RpcHttpUrls_secret]
arbitrum_goerli = ["https://devnet-1.mt/ABC/rpc/"]
[WalletKeys]
[WalletKeys_secret]
arbitrum_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
`

Expand All @@ -74,10 +74,10 @@ func TestMustGetSelectedNetworkConfig_Missing_WalletKeys(t *testing.T) {
testTOML := `
selected_networks = ["arbitrum_goerli"]
[RpcHttpUrls]
[RpcHttpUrls_secret]
arbitrum_goerli = ["https://devnet-1.mt/ABC/rpc/"]
[RpcWsUrls]
[RpcWsUrls_secret]
arbitrum_goerli = ["wss://devnet-1.mt/ABC/rpc/"]
`

Expand All @@ -93,10 +93,10 @@ func TestMustGetSelectedNetworkConfig_Missing_WalletKeys(t *testing.T) {

func TestMustGetSelectedNetworkConfig_DefaultUrlsFromEnv(t *testing.T) {
networkConfigTOML := `
[RpcHttpUrls]
[RpcHttpUrls_secret]
arbitrum_goerli = ["https://devnet-1.mt/ABC/rpc/"]
[RpcWsUrls]
[RpcWsUrls_secret]
arbitrum_goerli = ["wss://devnet-1.mt/ABC/rpc/"]
`
encoded := base64.StdEncoding.EncodeToString([]byte(networkConfigTOML))
Expand All @@ -106,7 +106,7 @@ func TestMustGetSelectedNetworkConfig_DefaultUrlsFromEnv(t *testing.T) {
testTOML := `
selected_networks = ["arbitrum_goerli"]
[WalletKeys]
[WalletKeys_secret]
arbitrum_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
`

Expand Down Expand Up @@ -135,15 +135,15 @@ func TestMustGetSelectedNetworkConfig_MultipleNetworks(t *testing.T) {
testTOML := `
selected_networks = ["arbitrum_goerli", "optimism_goerli"]
[RpcHttpUrls]
[RpcHttpUrls_secret]
arbitrum_goerli = ["https://devnet-1.mt/ABC/rpc/"]
optimism_goerli = ["https://devnet-1.mt/ABC/rpc/"]
[RpcWsUrls]
[RpcWsUrls_secret]
arbitrum_goerli = ["wss://devnet-1.mt/ABC/rpc/"]
optimism_goerli = ["wss://devnet-1.mt/ABC/rpc/"]
[WalletKeys]
[WalletKeys_secret]
arbitrum_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
optimism_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
`
Expand All @@ -161,11 +161,11 @@ func TestMustGetSelectedNetworkConfig_MultipleNetworks(t *testing.T) {

func TestMustGetSelectedNetworkConfig_DefaultUrlsFromSecret_OverrideOne(t *testing.T) {
networkConfigTOML := `
[RpcHttpUrls]
[RpcHttpUrls_secret]
arbitrum_goerli = ["https://devnet-1.mt/ABC/rpc/"]
optimism_goerli = ["https://devnet-1.mt/ABC/rpc/"]
[RpcWsUrls]
[RpcWsUrls_secret]
arbitrum_goerli = ["wss://devnet-1.mt/ABC/rpc/"]
optimism_goerli = ["wss://devnet-1.mt/ABC/rpc/"]
`
Expand All @@ -176,10 +176,10 @@ func TestMustGetSelectedNetworkConfig_DefaultUrlsFromSecret_OverrideOne(t *testi
testTOML := `
selected_networks = ["arbitrum_goerli", "optimism_goerli"]
[RpcHttpUrls]
[RpcHttpUrls_secret]
arbitrum_goerli = ["https://devnet-2.mt/ABC/rpc/"]
[WalletKeys]
[WalletKeys_secret]
arbitrum_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
optimism_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"]
`
Expand Down

0 comments on commit 6b645fb

Please sign in to comment.