Skip to content

Commit 368dfde

Browse files
authored
Fix docs and minor stuff + bump version before release (#559)
<!-- Reference any GitHub issues resolved by this PR --> Closes # ## Introduced changes <!-- A brief description of the changes --> - - ## Breaking changes <!-- List of all breaking changes, if applicable --> ## Checklist <!-- Make sure all of these are complete --> - [ ] Linked relevant issue - [ ] Updated relevant documentation - [ ] Added relevant tests - [ ] Performed self-review of the code - [ ] Added changes to `CHANGELOG.md`
1 parent 402ec0b commit 368dfde

File tree

16 files changed

+46
-51
lines changed

16 files changed

+46
-51
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- support for `roll`ing/`warp`ing/`prank`ing the constructor logic (precalculate address, prank, assert pranked state in constructor)
1717
- `spy_events` cheatcode
1818
- support for printing in contracts
19+
- `spoof` cheatcode
1920

2021
### Cast
2122

CONTRIBUTING.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,43 @@ To run tests scripts, you have to install:
2020
- [asdf](https://asdf-vm.com/guide/getting-started.html)
2121
- [starknet-devnet](https://0xspaceshard.github.io/starknet-devnet/docs/intro)
2222

23-
> ⚠️ Make sure you run `./scripts/prepare_for_tests.sh` after setting up the development environment, otherwise the
24-
> tests will fail.
23+
> ⚠️ Make sure you run `./scripts/prepare_for_tests.sh`
24+
> and then set [Scarb](https://docs.swmansion.com/scarb/) version
25+
> [compatible](https://github.com/foundry-rs/starknet-foundry/releases) with both `snforge` and `sncast`
26+
> after setting up the development environment, otherwise the tests will fail.
2527
2628
Before creating a contribution, make sure your code passes the following checks
2729

2830
```shell
29-
./scripts/test_forge.sh
30-
./scripts/test_cast.sh
31-
cargo fmt --check
32-
cargo lint
31+
$ cargo test
32+
$ cargo fmt --check
33+
$ cargo lint
3334
```
3435

3536
Otherwise, it won't be possible to merge your contribution.
3637

37-
You can also run specific set of tests, by directly running `cargo test`.
38+
You can also run a specific set of tests, by directly running `cargo test`.
3839

3940
For forge tests, make sure you are in `crates/forge` directory:
4041
```shell
41-
forge $ cargo test --lib # runs all unit tests
42-
forge $ cargo test integration # runs all integration tests
43-
forge $ cargo test e2e # runs all e2e tests
42+
$ cargo test --lib # runs all unit tests
43+
$ cargo test integration # runs all integration tests
44+
$ cargo test e2e # runs all e2e tests
4445
```
4546

4647
Similarly, to run cast tests make sure you are in `crates/cast` directory:
4748
```shell
48-
cast $ cargo test --lib # runs lib unit tests
49-
cast $ cargo test helpers # runs helpers unit tests
50-
cast $ cargo test integration # runs all integration tests
51-
cast $ cargo test e2e # runs all e2e tests
49+
$ cargo test --lib # runs lib unit tests
50+
$ cargo test helpers # runs helpers unit tests
51+
$ cargo test integration # runs all integration tests
52+
$ cargo test e2e # runs all e2e tests
53+
```
54+
55+
Or to run cheatnet tests make sure you are in `crates/cheatnet` directory:
56+
```shell
57+
$ cargo test --lib # runs lib unit tests
58+
$ cargo test cheatcodes # runs all cheatcodes tests
59+
$ cargo test starknet # runs all starknet tests
5260
```
5361

5462
## Contributing

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88

99
[workspace.package]
1010
name = "starknet-foundry"
11-
version = "0.4.1"
11+
version = "0.5.0"
1212
edition = "2021"
1313
repository = "https://github.com/foundry-rs/starknet-foundry"
1414
license = "MIT"

crates/cheatnet/tests/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ fn init() {
99
use camino::Utf8PathBuf;
1010
let contracts_path = Utf8PathBuf::from("tests").join("contracts");
1111

12-
std::process::Command::new("scarb")
12+
let output = std::process::Command::new("scarb")
1313
.current_dir(contracts_path)
1414
.arg("build")
1515
.output()
1616
.unwrap();
17+
assert!(output.status.success());
1718
}

crates/forge/tests/e2e/common/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub(crate) fn setup_package(package_name: &str) -> TempDir {
5353

5454
/// In the context of GITHUB actions, get the source branch that triggered the workflow run.
5555
/// Locally returns current branch.
56-
pub(crate) fn gen_current_branch() -> String {
56+
pub(crate) fn get_current_branch() -> String {
5757
let name: &str = "BRANCH_NAME";
5858
match env::var(name) {
5959
Ok(v) => v,

crates/forge/tests/e2e/running.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use assert_fs::fixture::{FileWriteStr, PathChild, PathCopy};
22
use camino::Utf8PathBuf;
33
use indoc::{formatdoc, indoc};
44

5-
use crate::e2e::common::runner::{gen_current_branch, runner, setup_package};
5+
use crate::e2e::common::runner::{get_current_branch, runner, setup_package};
66
use assert_fs::TempDir;
77
use std::str::FromStr;
88

@@ -52,7 +52,7 @@ fn simple_package_with_git_dependency() {
5252
let temp = TempDir::new().unwrap();
5353
temp.copy_from("tests/data/simple_package", &["**/*.cairo", "**/*.toml"])
5454
.unwrap();
55-
let branch = gen_current_branch();
55+
let branch = get_current_branch();
5656
let manifest_path = temp.child("Scarb.toml");
5757
manifest_path
5858
.write_str(&formatdoc!(

docs/src/appendix/cheatcodes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
> using appropriate release tag.
1919
>```toml
2020
> [dependencies]
21-
> snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.4.0" }
21+
> snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.5.0" }
2222
> ```

docs/src/appendix/forge-library.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
> using appropriate release tag.
1414
>```toml
1515
> [dependencies]
16-
> snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.4.0" }
16+
> snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.5.0" }
1717
> ```

docs/src/development/environment-setup.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,23 @@ It is not possible to run tests without these installed.
2424

2525
## Running Tests
2626

27-
> ⚠️ Make sure you run `./scripts/prepare_for_tests.sh` after setting up the development environment, otherwise the
28-
> tests will fail.
27+
> ⚠️ Make sure you run `./scripts/prepare_for_tests.sh`
28+
> and then set [Scarb](https://docs.swmansion.com/scarb/) version
29+
> [compatible](https://github.com/foundry-rs/starknet-foundry/releases) with both `snforge` and `sncast`
30+
> after setting up the development environment, otherwise the tests will fail.
2931
3032
Tests can be run with:
3133

3234
```shell
33-
$ ./scripts/test_cast.sh
34-
$ ./scripts/test_forge.sh
35+
$ cargo test
3536
```
3637

3738
## Formatting and Lints
3839

3940
Starknet Foundry uses [rustfmt](https://github.com/rust-lang/rustfmt) for formatting. You can run the formatter with
4041

4142
```shell
42-
cargo fmt
43+
$ cargo fmt
4344
```
4445

4546
For linting, it uses [clippy](https://github.com/rust-lang/rust-clippy). You can run it with this command:

0 commit comments

Comments
 (0)