Skip to content

Commit

Permalink
fix: update broken blockcode (#1846)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenary authored Mar 25, 2024
1 parent 17ac938 commit e95fd55
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 23 deletions.
6 changes: 3 additions & 3 deletions docs/2.develop/contracts/anatomy.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal classes simply decorate it using the [`NEAR Bindgen` decorator/macro](#
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/donation-examples/blob/main/contract-rs/src/lib.rs"
start="7" end="12" />
start="13" end="16" />
</Language>
</CodeTabs>

Expand Down Expand Up @@ -99,7 +99,7 @@ In JavaScript you **must always** define a [default state](#default-state)

<Github fname="lib.rs" language="rust"
url="https://github.com/near-examples/donation-examples/blob/main/contract-rs/src/lib.rs"
start="25" end="32" />
start="35" end="40" />

:::info
To make the initialization mandatory use `#[derive(PanicOnDefault)]` in the contract's structure
Expand Down Expand Up @@ -134,7 +134,7 @@ In Javascript you **must always** assign values to **all the class' parameters**
<TabItem value="πŸ¦€ Rust">
<Github fname="lib.rs" language="rust"
url="https://github.com/near-examples/donation-examples/blob/main/contract-rs/src/lib.rs"
start="14" end="21" />
start="19" end="26" />
</TabItem>
</Tabs>

Expand Down
6 changes: 3 additions & 3 deletions docs/2.develop/contracts/crosscontract.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Calling another contract passing information is also a common scenario. Bellow y
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-rs/src/lib.rs"
start="51" end="74" />
start="52" end="75" />
<Github fname="external.rs"
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-rs/src/external.rs" />
</Language>
Expand Down Expand Up @@ -124,7 +124,7 @@ The callback methods in your contract must be public, so it can be called when t
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-rs/src/lib.rs"
start="67" end="73" />
start="67" end="74" />
</Language>
</CodeTabs>

Expand All @@ -140,7 +140,7 @@ In case the call finishes successfully, the resulting object will have a `status
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.ts"
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-rs/src/lib.rs"
start="47" end="47" />
start="47" end="49" />
</Language>
</CodeTabs>

Expand Down
4 changes: 2 additions & 2 deletions docs/2.develop/testing/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Lets take a look at the test of our [Quickstart Project](../quickstart.md) [πŸ‘‹
<CodeTabs>
<Language value="🌐 JavaScript" language="js">
<Github fname="main.ava.ts"
url="https://github.com/near-examples/hello-near-examples/blob/main/contract-ts/sandbox-ts/src/main.ava.ts" start="9" end="43"/>
url="https://github.com/near-examples/hello-near-examples/blob/main/contract-ts/sandbox-ts/main.ava.ts" start="8" end="43"/>
</Language>
</CodeTabs>

Expand All @@ -45,7 +45,7 @@ In most cases we will want to test complex methods involving multiple users and
<CodeTabs>
<Language value="🌐 JavaScript" language="js">
<Github fname="main.ava.ts"
url="https://github.com/near-examples/donation-examples/blob/main/contract-rs/sandbox-ts/src/main.ava.ts"
url="https://github.com/near-examples/donation-examples/blob/main/contract-ts/sandbox-ts/src/main.ava.ts"
start="50" end="73" />
</Language>
</CodeTabs>
Expand Down
4 changes: 2 additions & 2 deletions docs/2.develop/testing/unit.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The tests in the [Counter Example](https://github.com/near-examples/counters) re
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/counters/blob/main/contract-rs/src/lib.rs"
start="48" end="83" />
start="50" end="71" />
</Language>
</CodeTabs>

Expand All @@ -37,7 +37,7 @@ While doing unit testing you can modify the [Environment variables](../contracts
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/donation-examples/blob/main/contract-rs/src/lib.rs"
start="57" end="92" />
start="59" end="117" />
</Language>
</CodeTabs>

Expand Down
2 changes: 1 addition & 1 deletion docs/3.tutorials/examples/coin-flip.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The contract presents 2 methods: `flip_coin`, and `points_of`.
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/coin-flip-examples/blob/main/contract-rs/src/lib.rs"
start="49" end="83" />
start="49" end="81" />
</Language>
</CodeTabs>

Expand Down
2 changes: 1 addition & 1 deletion docs/3.tutorials/examples/count-near.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The contract presents 4 methods: `get_num`, `increment`, `decrement`, and `reset
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/counters/blob/main/contract-rs/src/lib.rs"
start="22" end="47" />
start="5" end="39" />
</Language>
</CodeTabs>

Expand Down
2 changes: 1 addition & 1 deletion docs/3.tutorials/examples/donation.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The example is divided in two main components:
β”‚ └── lib.rs
β”œβ”€β”€ Cargo.toml # package manager
β”œβ”€β”€ README.md
β”œβ”€β”€ rust-toolchain.toml
└── rust-toolchain.toml
```

</TabItem>
Expand Down
9 changes: 4 additions & 5 deletions docs/3.tutorials/examples/guest-book.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The example is divided in two main components:
β”‚ └── lib.rs
β”œβ”€β”€ Cargo.toml # package manager
β”œβ”€β”€ README.md
β”œβ”€β”€ rust-toolchain.toml
└── rust-toolchain.toml
```

</TabItem>
Expand Down Expand Up @@ -99,13 +99,12 @@ Go ahead and login with your NEAR account. If you don't have one, you will be ab
The frontend is composed by a single HTML file (`/index.html`) and uses REACT. Check `/App.js` and `/index.js` to understand how
components are displayed in the screen.

You will notice in `/index.js` the following code:
You will notice in `/src/App.jsx` the following code:

<CodeTabs>
<Language value="🌐 JavaScript" language="js">
<Github fname="index.js"
url="https://github.com/near-examples/guest-book-examples/blob/main/frontend/index.js"
start="17" end="27" />
<Github fname="App.jsx"
url="https://github.com/near-examples/guest-book-examples/blob/main/frontend/src/App.jsx"/>
</Language>
</CodeTabs>

Expand Down
9 changes: 4 additions & 5 deletions docs/3.tutorials/examples/xcc.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ The smart contract is available in two flavors: Rust and JavaScript

<TabItem value="πŸ¦€ Rust">

=======
```bash
β”Œβ”€β”€ tests # sandbox testing
β”‚ β”œβ”€β”€ hello-near
Expand Down Expand Up @@ -88,7 +87,7 @@ The contract exposes methods to query the greeting and change it. These methods
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-rs/src/lib.rs"
start="24" end="49" />
start="25" end="50" />
<Github fname="external.rs"
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-rs/src/external.rs" />
</Language>
Expand Down Expand Up @@ -130,13 +129,13 @@ in `sandbox-ts/` for the JavaScript version and in `tests/` for the Rust version
<CodeTabs>
<Language value="🌐 JavaScript" language="rust">
<Github fname="main.ava.ts"
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-ts/sandbox-ts/src/main.ava.ts"
start="9" end="59" />
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-ts/sandbox-ts/main.ava.ts"
start="8" end="52" />
</Language>
<Language value="πŸ¦€ Rust" language="rust">
<Github fname="lib.rs"
url="https://github.com/near-examples/cross-contract-calls/blob/main/contract-simple-rs/tests/tests.rs"
start="5" end="77" />
start="4" end="77" />
</Language>
</CodeTabs>

Expand Down

0 comments on commit e95fd55

Please sign in to comment.