From 23b71845ffaaf47fcd308f766903aa9a0c704e3c Mon Sep 17 00:00:00 2001 From: Max Kalashnikoff Date: Wed, 17 Jan 2024 12:01:38 +0100 Subject: [PATCH] feat(providers): updating Pokt to the new endpoint --- SUPPORTED_CHAINS.md | 1 + src/env/pokt.rs | 20 ++++++++------------ src/providers/pokt.rs | 5 +---- tests/functional/http/pokt.rs | 34 +++++++++++++++++++++++++++++----- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/SUPPORTED_CHAINS.md b/SUPPORTED_CHAINS.md index 21be54cb2..c79634510 100644 --- a/SUPPORTED_CHAINS.md +++ b/SUPPORTED_CHAINS.md @@ -13,6 +13,7 @@ Chain name with associated `chainId` query param to use. - Arbitrum Goerli (`eip155:421613`) - Polygon (`eip155:137`) - Polygon Mumbai (`eip155:80001`) +- Polygon Zkevm (`eip155:1101`) - Celo (`eip155:42220`) - Aurora (`eip155:1313161554`) - Aurora Testnet (`eip155:1313161555`) diff --git a/src/env/pokt.rs b/src/env/pokt.rs index c14eed085..7093ec19c 100644 --- a/src/env/pokt.rs +++ b/src/env/pokt.rs @@ -46,14 +46,14 @@ fn default_supported_chains() -> HashMap { Weight::new(Priority::Normal).unwrap(), ), ), - // Avax C-Chain - // ( - // "eip155:43114".into(), - // ( - // "avax-mainnet".into(), - // Weight::new(Priority::Normal).unwrap(), - // ), - // ), + // AVAX mainnet + ( + "eip155:43114".into(), + ( + "avax-mainnet".into(), + Weight::new(Priority::Normal).unwrap(), + ), + ), // Gnosis ( "eip155:100".into(), @@ -76,10 +76,6 @@ fn default_supported_chains() -> HashMap { "eip155:5".into(), ("eth-goerli".into(), Weight::new(Priority::Normal).unwrap()), ), - ( - "eip155:11155111".into(), - ("sepolia".into(), Weight::new(Priority::Normal).unwrap()), - ), // Optimism ( "eip155:10".into(), diff --git a/src/providers/pokt.rs b/src/providers/pokt.rs index c99ba96a8..0169e8f31 100644 --- a/src/providers/pokt.rs +++ b/src/providers/pokt.rs @@ -76,10 +76,7 @@ impl RpcProvider for PoktProvider { .get(chain_id) .ok_or(RpcError::ChainNotFound)?; - let uri = format!( - "https://{}.gateway.pokt.network/v1/lb/{}", - chain, self.project_id - ); + let uri = format!("https://{}.rpc.grove.city/v1/{}", chain, self.project_id); let hyper_request = hyper::http::Request::builder() .method(Method::POST) diff --git a/tests/functional/http/pokt.rs b/tests/functional/http/pokt.rs index 68590e2ec..24595eb10 100644 --- a/tests/functional/http/pokt.rs +++ b/tests/functional/http/pokt.rs @@ -9,20 +9,44 @@ use { #[test_context(ServerContext)] #[tokio::test] #[ignore] -async fn pokt_provider_eip155_43114_and_56_and_100(ctx: &mut ServerContext) { - // Avax +async fn pokt_provider_eip155(ctx: &mut ServerContext) { + // Avax mainnet check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:43114", "0xa86a").await; + // Gnosis + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:100", "0x64").await; + // Binance mainnet check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:56", "0x38").await; - // Gnosis - check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:100", "0x64").await + // Ethereum + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:1", "0x1").await; + + // Goerli + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:5", "0x5").await; + + // Optimism + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:10", "0xa").await; + + // Arbitrum + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:42161", "0xa4b1").await; + + // Polygon mainnet + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:137", "0x89").await; + + // Polygon mumbai + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:80001", "0x13881").await; + + // Polygon zkevm + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:1101", "0x44d").await; + + // Polygon celo + check_if_rpc_is_responding_correctly_for_supported_chain(ctx, "eip155:42220", "0xa4ec").await } #[test_context(ServerContext)] #[tokio::test] -async fn solana_mainnet(ctx: &mut ServerContext) { +async fn pokt_provider_solana_mainnet(ctx: &mut ServerContext) { let addr = format!( "{}/v1?projectId={}&chainId=", ctx.server.public_addr, ctx.server.project_id