Skip to content

Commit

Permalink
test(starknet_client): integration test with the starknet GW
Browse files Browse the repository at this point in the history
The test sends an Eth transfer transaction to the node that sends it in its turn to the Starknet GW.
  • Loading branch information
TzahiTaub committed Oct 9, 2023
1 parent 2cf68ee commit 41c06fb
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- run: >
cargo test --test '*' -- --include-ignored;
cargo test --test '*' -- --include-ignored --skip test_gw_integration_testnet;
cargo run -p papyrus_node --bin central_source_integration_test
rustfmt:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: nightly-tests

on:
schedule:
- cron: "30 0 * * *"
workflow_dispatch:
push:
branches:
- "tzahi/gw_integration_test_basic"

jobs:
GW-integration-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
- run: >
INTEGRATION_TESTNET_NODE_URL=${{ secrets.INTEGRATION_TESTNET_NODE_URL }}
SENDER_PRIVATE_KEY=${{ secrets.INTEGRATION_TESTNET_SENDER_PRIVATE_KEY }}
cargo test --test gateway_integration_test -p starknet_client test_gw_integration_testnet
-- --ignored;
retVal=$?;
if [ $retVal -ne 0 ]; then
echo "Integration test failed with exit code $retVal"
fi;
exit $retVal
145 changes: 137 additions & 8 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ serde_yaml = "0.9.16"
sha3 = "0.10.8"
simple_logger = "4.0.0"
starknet_api = "0.5.0-rc1"
starknet-core = "0.6.0"
starknet-crypto = "0.5.1"
strum = "0.25.0"
strum_macros = "0.25.2"
Expand Down
7 changes: 7 additions & 0 deletions crates/papyrus_rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ use validator::Validate;
use crate::api::get_methods_from_supported_apis;
use crate::middleware::{deny_requests_with_unsupported_path, proxy_rpc_request};
use crate::syncing_state::get_last_synced_block;
pub use crate::v0_4_0::transaction::{
InvokeTransaction,
InvokeTransactionV1,
TransactionOutput,
TransactionReceipt,
};
pub use crate::v0_4_0::write_api_result::AddInvokeOkResult;

/// Maximum size of a supported transaction body - 10MB.
pub const SERVER_MAX_BODY_SIZE: u32 = 10 * 1024 * 1024;
Expand Down
4 changes: 4 additions & 0 deletions crates/starknet_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ url.workspace = true
assert.workspace = true
assert_matches.workspace = true
enum-iterator.workspace = true
jsonrpsee = { workspace = true, features = ["full"] }
mockall.workspace = true
mockito.workspace = true
rand.workspace = true
rand_chacha.workspace = true
papyrus_common = { path = "../papyrus_common"}
papyrus_rpc = { path = "../papyrus_rpc"}
pretty_assertions.workspace = true
starknet_api = { workspace = true, features = ["testing"] }
starknet-core.workspace = true
test_utils = { path = "../test_utils" }
Loading

0 comments on commit 41c06fb

Please sign in to comment.