Skip to content

Commit

Permalink
Test forking of HTTPS origin (#470)
Browse files Browse the repository at this point in the history
* Remove unused dependency: tower
  • Loading branch information
FabijanC authored May 20, 2024
1 parent 1d9d2da commit a6fc0a1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
16 changes: 0 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ keywords = ["starknet", "cairo", "testnet", "local", "server"]
axum = { version = "0.7" }
http-body-util = { version = "0.1" }
tower-http = { version = "0.5", features = ["full"] }
tower = { version = "0.4", features = ["full"] }

# async
tokio = { version = "1", features = [
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,11 @@ $ docker run -e RUST_LOG=<LEVEL> shardlabs/starknet-devnet-rs
```

By default, logging of request and response data is turned off.
To see the request and/or response body, additional level have to be provided via `RUST_LOG` environment variable.
To log the request body use `REQUEST`, to log the response body use `RESPONSE`.
To see the request and/or response body, additional levels can be specified via the `RUST_LOG` environment variable: `REQUEST` for request body, `RESPONSE` for response body.

NOTE! that logging request and response requires at least logging level `INFO`.
NOTE! Logging request and response requires at least logging level `INFO`.

The following two commands will log request and response data with log level `INFO`.
Example:
For example, the following two commands will log request and response data with log level `INFO`.

```
$ RUST_LOG="REQUEST,RESPONSE" starknet-devnet
Expand Down
1 change: 0 additions & 1 deletion crates/starknet-devnet-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ axum = { workspace = true }
http-body-util = { workspace = true }
reqwest = { workspace = true }
tower-http = { workspace = true }
tower = { workspace = true }

# tracing
tracing = { workspace = true }
Expand Down
21 changes: 21 additions & 0 deletions crates/starknet-devnet/tests/test_fork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,4 +586,25 @@ mod fork_tests {
.unwrap();
assert_eq!(second_fork_block_number, [FieldElement::from(5_u8)]); // origin block + declare + deploy
}

#[tokio::test]
async fn test_forking_https() {
let origin_url = "https://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7";
let fork_block = 2;
let fork_devnet = BackgroundDevnet::spawn_with_additional_args(&[
"--fork-network",
origin_url,
"--fork-block",
&fork_block.to_string(),
])
.await
.unwrap();

fork_devnet
.json_rpc_client
// -1 to force fetching from origin
.get_block_with_tx_hashes(BlockId::Number(fork_block - 1))
.await
.unwrap();
}
}

0 comments on commit a6fc0a1

Please sign in to comment.