Skip to content

Commit

Permalink
feat(providers): updating Pokt to the new endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother committed Jan 17, 2024
1 parent 38d3116 commit 23b7184
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 21 deletions.
1 change: 1 addition & 0 deletions SUPPORTED_CHAINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
20 changes: 8 additions & 12 deletions src/env/pokt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
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(),
Expand All @@ -76,10 +76,6 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
"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(),
Expand Down
5 changes: 1 addition & 4 deletions src/providers/pokt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
34 changes: 29 additions & 5 deletions tests/functional/http/pokt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23b7184

Please sign in to comment.