Skip to content

Commit

Permalink
chore(test): rm skip-zero-root-validation feature
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-melnychuk committed Sep 12, 2024
1 parent 5b058b5 commit 1e1cfb5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --features skip-zero-root-validation
- run: cargo test

check:
if: startsWith(github.head_ref, 'dependabot/')
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ version = "0.5.1"
default = ["rpc"]
rpc = ["dep:axum"]

## FOR TESTING ONLY
## skip proof validation of state root is 0x0
skip-zero-root-validation = []

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ cargo test

## Run integration tests against live endpoint
export BEERUS_TEST_STARKNET_URL=https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0_7/${ALCHEMY_API_KEY}
BEERUS_TEST_RUN=1 cargo test --features skip-zero-root-validation
BEERUS_TEST_RUN=1 cargo test
```

#### Docker
Expand Down
7 changes: 4 additions & 3 deletions tests/exe.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use beerus::{
client::State,
exe::call,
gen::{self, blocking::Rpc, client::blocking::Client, Felt, FunctionCall},
gen::{self, blocking::Rpc, client::blocking::Client, FunctionCall},
};

mod common;

use common::error::Error;

// TODO Add call to `starkli balance` as a test

#[test]
fn test_call_deprecated_contract_class() -> Result<(), Error> {
let client = client!();
Expand All @@ -33,8 +35,7 @@ fn test_call_deprecated_contract_class() -> Result<(), Error> {
});
let function_call: FunctionCall = serde_json::from_value(json)?;

let mut state = get_latest_state(&client);
state.root = Felt::try_new("0x0")?; // disable merkle proof validation
let state = get_latest_state(&client);
let call_info = call(&client, function_call, state)?;

assert!(call_info.execution.retdata.0.is_empty());
Expand Down

0 comments on commit 1e1cfb5

Please sign in to comment.