You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[VSCode IDE extension walkthrough video](https://youtu.be/y0beoihLppA)
23
27
24
-
### Start with contract build**
28
+
## Interaction with mxpy
29
+
30
+
Start with contract build
25
31
26
32
```
27
33
mxpy contract build
@@ -31,8 +37,9 @@ mxpy contract build
31
37
32
38
To use testnet switch to `--chain="T"` and --proxy="https://testnet-gateway.multiversx.com".
33
39
34
-
### Example mxpy interaction commands
35
-
##### These commands should be run one folder up from the cloned 'multiversx-simple-sc' folder or you would need to adjust your --project path
40
+
### mxpy interaction commands
41
+
42
+
We asume that the pem file is outside of the project directory. You can adjust the `--pem` path in each command. The smart contract address should be the one you'll get from deployment. Adjust the timestamp when creating a piggy bank (`--arguments <timestamp in future>`).
As an argument for the `createPiggy` function, we will pass the timestamp for the lock time (it should be in the future, of course, use https://www.epochconverter.com/).
56
61
57
-
You can also use snippets. In the terminal run `. interactions/devnet.snippets.sh && createPiggy`.
58
-
59
62
**Add amount:**
60
63
(here, with the working SC address example, change it, if you deployed yours, you should have one)
You can also use snippets. In the terminal run `. interactions/devnet.snippets.sh && upgrade`.
89
-
90
-
### Snippets
91
-
92
-
You will find interaction snippets in `interactions/snippets.sh`. It is convenient to use when working with VSCode and MultiversX SDK plugin.
93
-
94
-
After deploying the smart contract, you need to edit the `SC_ADDRESS`. Also, make sure that the relative path to your wallet PEM file is correct. You will need to set it in `USER_PEM`.
95
-
96
-
### Testing
87
+
## Testing
97
88
98
-
You will find tests in `tests/piggybank_rust_test.rs`. To run a test, you can use click on the `Run Test` button from under the test name in VS Code or you can run it with `cargo test --test piggybank_rust_test`.
89
+
Tests are based on [blackbox testing](https://docs.multiversx.com/developers/testing/rust/sc-blackbox-calls) approach.
90
+
You will find tests in `tests/piggybank_rust_test.rs`.
91
+
To run a test, you can click on the `Run Test` button from under the test name in VS Code.
92
+
You can also run it with `cargo test --test piggybank_rust_test`.
93
+
Or you can use `sc-meta` tool: `sc-meta test`.
99
94
100
-
###Development
95
+
## Development
101
96
Besides cloning the repository, you can also use buildo-begins CLI:
102
97
-`npx buildo-begins@latest init` - from the list, choose Piggy Bank smart contract. You can also initialize the dapp for interactions.
0 commit comments