diff --git a/config/README.md b/config/README.md index 2547484ca..96e396e88 100644 --- a/config/README.md +++ b/config/README.md @@ -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"] ``` @@ -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"] ``` diff --git a/config/examples/example.toml b/config/examples/example.toml index 770f5ce2c..e66b4e1d1 100644 --- a/config/examples/example.toml +++ b/config/examples/example.toml @@ -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] diff --git a/networks/known_networks_test.go b/networks/known_networks_test.go index 8585ba284..21b3d5a6d 100644 --- a/networks/known_networks_test.go +++ b/networks/known_networks_test.go @@ -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"] ` @@ -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"] ` @@ -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/"] ` @@ -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)) @@ -106,7 +106,7 @@ func TestMustGetSelectedNetworkConfig_DefaultUrlsFromEnv(t *testing.T) { testTOML := ` selected_networks = ["arbitrum_goerli"] - [WalletKeys] + [WalletKeys_secret] arbitrum_goerli = ["1810868fc221b9f50b5b3e0186d8a5f343f892e51ce12a9e818f936ec0b651ed"] ` @@ -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"] ` @@ -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/"] ` @@ -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"] `