diff --git a/_core/smart/sdk-quickstart.md b/_core/smart/sdk-quickstart.md index c829e2dd..29af0078 100644 --- a/_core/smart/sdk-quickstart.md +++ b/_core/smart/sdk-quickstart.md @@ -174,7 +174,7 @@ npm run test ✓ should have a valid syntax deploying an instance of the contract ✓ should print hello world message - ✓ should echo number + ✓ should echo number (54ms) 3 passing (182ms) diff --git a/_core/smart/tutorial-counter.md b/_core/smart/tutorial-counter.md index 303f2364..6e781d1c 100644 --- a/_core/smart/tutorial-counter.md +++ b/_core/smart/tutorial-counter.md @@ -37,7 +37,6 @@ You have to select a template and a name for your local folder. For the counter ```bash ? Template - one of [hello-world, counter]: counter -? Project name: (clarity-counter) ``` Finally, the project dependencies are installed and your project is ready for development. Because you already completed the [Hello World tutorial](tutorial.html), the project structure is familiar to you. The main difference is that we have additional tests for a new counter smart contract. @@ -65,6 +64,10 @@ counter contract test suite 1 passing (734ms) 3 failing + +... # error details + +npm ERR! Test failed. See above for more details. ``` It looks like we see some failed tests! That is on purpose - we will implement the new smart contract in the next steps! After every step in this tutorial, we will rerun the tests to ensure we're on the right track. @@ -89,7 +92,7 @@ Let's get familiar with the tests to understand what the new smart contract shou The file was already created during the project setup. -2. With the editor of your choice, open the file and add the following lines of code: +2. With the editor of your choice, open `contracts/counter.clar` and add the following lines of code: ```cl (define-data-var counter int 0) @@ -151,16 +154,19 @@ Let's get familiar with the tests to understand what the new smart contract shou ```cl (define-data-var counter int 0) + + (define-public (get-counter) + (ok (var-get counter))) + (define-public (increment) (begin (var-set counter (+ (var-get counter) 1)) (ok (var-get counter)))) + (define-public (decrement) (begin (var-set counter (- (var-get counter) 1)) (ok (var-get counter)))) - (define-public (get-counter) - (ok (var-get counter))) ``` With the completion of this tutorial, you ... diff --git a/_core/smart/tutorial.md b/_core/smart/tutorial.md index 5d29a8cb..7d7e3add 100644 --- a/_core/smart/tutorial.md +++ b/_core/smart/tutorial.md @@ -44,15 +44,13 @@ In this step, you initialize a starter project for Clarity development: ```bash ? Template - one of [hello-world, counter]: (hello-world) - ? Project name: (clarity-hello-world) ``` Finally, after the project dependencies have been installed, your project is ready for development. -3. The project is located in a new folder, `clarity-hello-world` by default. Jump into the folder and have a look at the file structure: +3. The project resources are created in your current folder. Have a look at the project structure: ```bash - cd clarity-hello-world ls ```