Skip to content

Commit

Permalink
Show using snforge_std and sncast_std from registry (#2663)
Browse files Browse the repository at this point in the history
<!-- Reference any GitHub issues resolved by this PR -->

Closes #2599
  • Loading branch information
ddoktorski authored Nov 12, 2024
1 parent ae2bffc commit 35a3dc1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 deletions docs/src/appendix/cheatcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@
> ℹ️ **Info**
> To use cheatcodes you need to add `snforge_std` package as a development dependency in
> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#development-dependencies)
> using appropriate release tag.
> using the appropriate version.
>
> ```toml
> [dev-dependencies]
> snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.12.0" }
> snforge_std = "0.33.0"
> ```
2 changes: 1 addition & 1 deletion docs/src/appendix/scarb-toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ edition = "2023_11"
starknet = "2.8.2"

[dev-dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.30.0" }
snforge_std = "0.33.0"
starknet = ">=2.8.2"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", branch = "cairo-2" }

Expand Down
4 changes: 2 additions & 2 deletions docs/src/appendix/sncast-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
> ℹ️ **Info**
> To use the library functions you need to add `sncast_std` package as a dependency in
> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#adding-a-dependency)
> using appropriate release tag.
> using the appropriate version.
>```toml
> [dependencies]
> sncast_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.22.0" }
> sncast_std = "0.33.0"
> ```
4 changes: 2 additions & 2 deletions docs/src/appendix/snforge-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
> ℹ️ **Info**
> To use cheatcodes you need to add `snforge_std` package as a development dependency in
> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#development-dependencies)
> using appropriate release tag.
> using the appropriate version.
> ```toml
> [dev-dependencies]
> snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.12.0" }
> snforge_std = "0.33.0"
> ```
11 changes: 4 additions & 7 deletions docs/src/getting-started/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,22 @@ Add the following line under `[dev-dependencies]` section in the `Scarb.toml` fi
# ...

[dev-dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.27.0" }
snforge_std = "0.33.0"
```

Make sure that the version in `tag` matches `snforge`. You can check the currently installed version with
Make sure that the above version matches the installed `snforge` version. You can check the currently installed version with

```shell
$ snforge --version
snforge 0.27.0
snforge 0.33.0
```

It is also possible to add this dependency
using [`scarb add`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#adding-a-dependency-via-scarb-add)
command.

```shell
$ scarb add snforge_std \
--dev \
--git https://github.com/foundry-rs/starknet-foundry.git \
--tag v0.27.0
$ scarb add [email protected] --dev
```

Additionally, ensure that starknet-contract target is enabled in the `Scarb.toml` file.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/starknet/script.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ version = "0.1.0"

[dependencies]
starknet = ">=2.8.0"
sncast_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.30.0" }
sncast_std = "0.33.0"
```

To run the script, do:
Expand Down Expand Up @@ -254,7 +254,7 @@ version = "0.1.0"

[dependencies]
starknet = ">=2.8.0"
sncast_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.30.0" }
sncast_std = "0.33.0"
map = { path = "../contracts" }

[lib]
Expand Down
4 changes: 2 additions & 2 deletions docs/src/testing/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
> To use the library functions designed for testing smart contracts,
> you need to add `snforge_std` package as a dependency in
> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#development-dependencies)
> using appropriate release tag.
> using the appropriate version.
>```toml
> [dev-dependencies]
> snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.12.0" }
> snforge_std = "0.33.0"
> ```
Using unit testing as much as possible is a good practice, as it makes your test suites run faster. However, when
Expand Down
4 changes: 2 additions & 2 deletions docs/src/testing/using-cheatcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
> ℹ️ **Info**
> To use cheatcodes you need to add `snforge_std` package as a dependency in
> your [`Scarb.toml`](https://docs.swmansion.com/scarb/docs/guides/dependencies.html#development-dependencies)
> using appropriate release tag.
> using the appropriate version.
>
> ```toml
> [dev-dependencies]
> snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.9.0" }
> snforge_std = "0.33.0"
> ```
When testing smart contracts, often there are parts of code that are dependent on a specific blockchain state.
Expand Down

0 comments on commit 35a3dc1

Please sign in to comment.