Skip to content

Commit

Permalink
Restore prompt in shell snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
franciszekjob committed Nov 10, 2024
1 parent 23493ab commit 62bb35a
Show file tree
Hide file tree
Showing 28 changed files with 90 additions and 90 deletions.
18 changes: 9 additions & 9 deletions crates/sncast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ All subcommand usages are shown for two scenarios - when all necessary arguments
### Declare a contract

```shell
sncast --account myuser \
$ sncast --account myuser \
--url http://127.0.0.1:5050/rpc \
declare \
--contract-name SimpleBalance
Expand All @@ -52,7 +52,7 @@ transaction_hash: 0x7ad0d6e449e33b6581a4bb8df866c0fce3919a5ee05a30840ba521dafee2
With arguments taken from `snfoundry.toml` file (default profile name):

```shell
sncast declare \
$ sncast declare \
--contract-name SimpleBalance
```

Expand All @@ -71,7 +71,7 @@ transaction_hash: 0x7ad0d6e449e33b6581a4bb8df866c0fce3919a5ee05a30840ba521dafee2
### Deploy a contract

```shell
sncast --account myuser \
$ sncast --account myuser \
--url http://127.0.0.1:5050/rpc \
deploy --class-hash 0x8448a68b5ea1affc45e3fd4b8b480ea36a51dc34e337a16d2567d32d0c6f8a
```
Expand All @@ -90,7 +90,7 @@ transaction_hash: 0x64a62a000240e034d1862c2bbfa154aac6a8195b4b2e570f38bf4fd47a5a
With arguments taken from `snfoundry.toml` file (default profile name):

```shell
sncast deploy --class-hash 0x8448a68b5ea1affc45e3fd4b8b480ea36a51dc34e337a16d2567d32d0c6f8a
$ sncast deploy --class-hash 0x8448a68b5ea1affc45e3fd4b8b480ea36a51dc34e337a16d2567d32d0c6f8a
```

<details open>
Expand All @@ -108,7 +108,7 @@ transaction_hash: 0x64a62a000240e034d1862c2bbfa154aac6a8195b4b2e570f38bf4fd47a5a
### Invoke a contract

```shell
sncast --url http://127.0.0.1:5050 \
$ sncast --url http://127.0.0.1:5050 \
--account example_user \
invoke \
--contract-address 0x4a739ab73aa3cac01f9da5d55f49fb67baee4919224454a2e3f85b16462a911 \
Expand All @@ -130,7 +130,7 @@ transaction_hash: 0x7ad0d6e449e33b6581a4bb8df866c0fce3919a5ee05a30840ba521dafee2
With arguments taken from `snfoundry.toml` file (default profile name):

```shell
sncast invoke \
$ sncast invoke \
--contract-address 0x4a739ab73aa3cac01f9da5d55f49fb67baee4919224454a2e3f85b16462a911 \
--function "some_function" \
--calldata 1 2 3
Expand All @@ -149,7 +149,7 @@ transaction_hash: 0x7ad0d6e449e33b6581a4bb8df866c0fce3919a5ee05a30840ba521dafee2
### Call a contract

```shell
sncast --url http://127.0.0.1:5050 \
$ sncast --url http://127.0.0.1:5050 \
call \
--contract-address 0x4a739ab73aa3cac01f9da5d55f49fb67baee4919224454a2e3f85b16462a911 \
--function "some_function" \
Expand All @@ -170,7 +170,7 @@ response: [0x0]
With arguments taken from `snfoundry.toml` file (default profile name):

```shell
sncast call \
$ sncast call \
--contract-address 0x4a739ab73aa3cac01f9da5d55f49fb67baee4919224454a2e3f85b16462a911 \
--function some_function \
--calldata 1 2 3
Expand All @@ -195,7 +195,7 @@ Please make sure you're using scarb installed via asdf - otherwise some tests ma
To verify, run:

```shell
which scarb
$ which scarb
```

<details open>
Expand Down
2 changes: 1 addition & 1 deletion design_documents/parametrizing_tests_with_fixed_values.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ If a test case has a custom name, it should be displayed to the user.
An example output could look similarly to this:

```shell
snforge test
$ snforge test
[PASS] tests::parametrized(a = 1, b = 2) # unnamed test case
[PASS] tests::parametrized[a_test](a = 3, b = 5) # named test case
[FAIL] tests::parametrized[my_case](a = 4, b = 5) # named test case
Expand Down
8 changes: 4 additions & 4 deletions docs/src/getting-started/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We demonstrate how to create a new project, compile, and test it.
To start a new project with Starknet Foundry, run `snforge init`

```shell
snforge init project_name
$ snforge init project_name
```

Let's check out the project structure
Expand Down Expand Up @@ -34,7 +34,7 @@ tree . -L 1
And run tests with `snforge test`

```shell
snforge test
$ snforge test
```

<details open>
Expand Down Expand Up @@ -71,14 +71,14 @@ snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag
Make sure that the version in `tag` matches `snforge`. You can check the currently installed version with

```shell
snforge --version
$ snforge --version
```

<details>
<summary>Click to expand</summary>

```shell
snforge 0.27.0
$ snforge 0.27.0
```
</details>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ As for now, Starknet Foundry on Windows needs manual installation, but necessary
4. Verify installation by running the following command in new terminal session:

```shell
snforge --version
$ snforge --version
sncast --version
```

Expand Down
4 changes: 2 additions & 2 deletions docs/src/projects/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defined in the profile.
> the rest of them using CLI flags. You can also override parameters from the configuration using CLI flags.
```shell
sncast --profile myprofile \
$ sncast --profile myprofile \
call \
--contract-address 0x38b7b9507ccf73d79cb42c2cc4e58cf3af1248f342112879bfdf5aa4f606cc9 \
--function get \
Expand Down Expand Up @@ -88,7 +88,7 @@ url = "http://127.0.0.1:5050/rpc"
With this, there's no need to include the `--profile` argument when using `sncast`.

```shell
sncast call \
$ sncast call \
--contract-address 0x38b7b9507ccf73d79cb42c2cc4e58cf3af1248f342112879bfdf5aa4f606cc9 \
--function get \
--calldata 0x0 \
Expand Down
4 changes: 2 additions & 2 deletions docs/src/snforge-advanced-features/fuzz-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The test will be run many times against different randomly generated values.
Then run `snforge test` like usual.

```shell
snforge test
$ snforge test
```

<details open>
Expand Down Expand Up @@ -65,7 +65,7 @@ It is possible to configure the number of runs of the random fuzzer as well as i
It can also be configured globally, via command line arguments:

```shell
snforge test --fuzzer-runs 1234 --fuzzer-seed 1111
$ snforge test --fuzzer-runs 1234 --fuzzer-seed 1111
```

Or in `Scarb.toml` file:
Expand Down
6 changes: 3 additions & 3 deletions docs/src/snforge-advanced-features/profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can inspect the call tree, see how many resources are used for different par
All you have to do is use the [`--save-trace-data`](../appendix/snforge/test.md#--save-trace-data) flag:

```shell
snforge test --save-trace-data
$ snforge test --save-trace-data
```

The files with traces will be saved to `snfoundry_trace` directory. Each one of these files can then be used as an input
Expand All @@ -18,7 +18,7 @@ for the [cairo-profiler](https://github.com/software-mansion/cairo-profiler).
If you want `snforge` to call `cairo-profiler` on generated files automatically, use [`--build-profile`](../appendix/snforge/test.md#--build-profile) flag:

```shell
snforge test --build-profile
$ snforge test --build-profile
```

## Passing arguments to `cairo-profiler`
Expand All @@ -27,7 +27,7 @@ You can pass additional arguments to `cairo-profiler` by using the `--` separato
to `cairo-profiler`:

```shell
snforge test --build-profile -- --show-inlined-functions
$ snforge test --build-profile -- --show-inlined-functions
```

> 📝 **Note**
Expand Down
10 changes: 5 additions & 5 deletions docs/src/starknet/account-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ This section shows how to export your private key from specific wallets.
To import an account into the file holding the accounts info (`~/.starknet_accounts/starknet_open_zeppelin_accounts.json` by default), use the `account import` command.

```shell
sncast \
$ sncast \
account import \
--url http://127.0.0.1:5050 \
--name account_123 \
Expand All @@ -88,7 +88,7 @@ sncast \
If you don't want to pass the private key in the command (because of safety aspect), you can skip `--private-key` flag. You will be prompted to enter the private key in interactive mode.

```shell
sncast \
$ sncast \
account import \
--url http://127.0.0.1:5050 \
--name account_123 \
Expand All @@ -110,7 +110,7 @@ Type in your private key and press enter:
To import Argent account, set the `--type` flag to `argent`.

```shell
sncast \
$ sncast \
account import \
--url http://127.0.0.1:5050 \
--name account_argent \
Expand All @@ -124,7 +124,7 @@ sncast \
To import Braavos account, set the `--type` flag to `braavos`.

```shell
sncast \
$ sncast \
account import \
--url http://127.0.0.1:5050 \
--name account_braavos \
Expand All @@ -138,7 +138,7 @@ sncast \
To import OpenZeppelin account, set the `--type` flag to `oz` or `open_zeppelin`.

```shell
sncast \
$ sncast \
account import \
--url http://127.0.0.1:5050 \
--name account_oz \
Expand Down
18 changes: 9 additions & 9 deletions docs/src/starknet/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Do the following to start interacting with the Starknet:
#### Create account with the `sncast account create` command

```shell
sncast \
$ sncast \
account create \
--url http://127.0.0.1:5050 \
--name some-name
Expand Down Expand Up @@ -60,7 +60,7 @@ You can do it both by sending tokens from another starknet account or by bridgin
#### Deploy account with the `sncast account deploy` command
```shell
sncast \
$ sncast \
account deploy \
--url http://127.0.0.1:5050 \
--name some-name \
Expand All @@ -87,7 +87,7 @@ If you created an account with `sncast account create` it by default it will be
To import an account to the `default accounts file`, use the `account import` command.
```shell
sncast \
$ sncast \
account import \
--url http://127.0.0.1:5050 \
--name my_imported_account \
Expand All @@ -100,7 +100,7 @@ sncast \
List all accounts saved in `accounts file`, grouped based on the networks they are defined on.
```shell
sncast account list
$ sncast account list
```
```
Expand All @@ -125,7 +125,7 @@ There is also possibility to show private keys with the `--display-private-keys`
Delete an account from `accounts-file` and its associated Scarb profile. If you pass this command, you will be asked to confirm the deletion.
```shell
sncast account delete \
$ sncast account delete \
--name some-name \
--network alpha-sepolia
```
Expand All @@ -139,7 +139,7 @@ It is possible to create an account using custom openzeppelin, argent or braavos
with `--class-hash` flag:
```shell
sncast \
$ sncast \
account create \
--name some-name \
--url http://127.0.0.1:5050 \
Expand All @@ -151,7 +151,7 @@ sncast \
Instead of random generation, salt can be specified with `--salt`.
```shell
sncast \
$ sncast \
account create \
--url http://127.0.0.1:5050 \
--name some-name \
Expand Down Expand Up @@ -180,7 +180,7 @@ Accounts created and deployed with [starkli](https://book.starkli.rs/accounts#ac
> When passing the `--keystore` argument, `--account` argument must be a path to the starkli account JSON file.
```shell
sncast \
$ sncast \
--keystore keystore.json \
--account account.json \
declare \
Expand All @@ -194,7 +194,7 @@ sncast \
It is possible to create an openzeppelin account with keystore in a similar way [starkli](https://book.starkli.rs/accounts#accounts) does.
```shell
sncast \
$ sncast \
--keystore my_key.json \
--account my_account.json \
account create \
Expand Down
4 changes: 2 additions & 2 deletions docs/src/starknet/call.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For a detailed CLI description, see the [call command reference](../appendix/snc
### General Example

```shell
sncast call \
$ sncast call \
--contract-address 0x4a739ab73aa3cac01f9da5d55f49fb67baee4919224454a2e3f85b16462a911 \
--function "some_function" \
--calldata 1 2 3
Expand All @@ -41,7 +41,7 @@ response: [0x1, 0x23, 0x4]
You can call a contract at the specific block by passing `--block-id` argument.

```shell
sncast call \
$ sncast call \
--contract-address 0x4a739ab73aa3cac01f9da5d55f49fb67baee4919224454a2e3f85b16462a911 \
--function "some_function" \
--calldata 1 2 3 \
Expand Down
10 changes: 5 additions & 5 deletions docs/src/starknet/calldata-transformation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub mod DataTransformerContract {
A default form of calldata passed to commands requiring it is a series of hex-encoded felts:

```shell
sncast call \
$ sncast call \
--url http://127.0.0.1:5050 \
--contract-address 0x016ad425af4585102e139d4fb2c76ce786d1aaa1cfcd88a51f3ed66601b23cdd \
--function tuple_fn \
Expand All @@ -79,7 +79,7 @@ the [Starknet specification](https://docs.starknet.io/architecture-and-concepts/
We can write the same command as above, but with arguments:

```shell
sncast call \
$ sncast call \
--url http://127.0.0.1:5050 \
--contract-address 0x016ad425af4585102e139d4fb2c76ce786d1aaa1cfcd88a51f3ed66601b23cdd \
--function tuple_fn \
Expand Down Expand Up @@ -124,7 +124,7 @@ Numeric types (primitives and `felt252`) can be paseed with type suffix specifie
1. `complex_fn` - different data types:

```shell
sncast call \
$ sncast call \
--url http://127.0.0.1:5050 \
--contract-address 0x016ad425af4585102e139d4fb2c76ce786d1aaa1cfcd88a51f3ed66601b23cdd \
--function complex_fn \
Expand All @@ -147,7 +147,7 @@ sncast call \
Alternatively, you can continue the single quote for multiple lines.

```shell
sncast call \
$ sncast call \
--url http://127.0.0.1:5050 \
--contract-address 0x016ad425af4585102e139d4fb2c76ce786d1aaa1cfcd88a51f3ed66601b23cdd \
--function complex_fn \
Expand All @@ -169,7 +169,7 @@ true,
2. `nested_struct_fn` - struct nesting:

```shell
sncast call \
$ sncast call \
--url http://127.0.0.1:5050 \
--contract-address 0x016ad425af4585102e139d4fb2c76ce786d1aaa1cfcd88a51f3ed66601b23cdd \
--function nested_struct_fn \
Expand Down
2 changes: 1 addition & 1 deletion docs/src/starknet/declare.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ First make sure that you have created a `Scarb.toml` file for your contract (it
Then run:

```shell
sncast --account myuser \
$ sncast --account myuser \
declare \
--url http://127.0.0.1:5050/rpc \
--fee-token strk \
Expand Down
Loading

0 comments on commit 62bb35a

Please sign in to comment.