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
Copy file name to clipboardExpand all lines: docs/HelloMove.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ You should get the following output if everything works right.
22
22
23
23

24
24
25
-
As one can see the unit test `0x2::thoughts::test_basic_flow` has passed and we are ready for deployment.
25
+
As one can see the unit test `0x2::thoughts::test_basic_flow` has passed printing `"Hello Move"` thought and are ready for deployment.
26
26
27
27
# Understanding your Code
28
28
@@ -242,7 +242,7 @@ Within the test function we have added a `signer` called `aaron` whose address i
242
242
Well first create aaron's thought.
243
243
244
244
```Move
245
-
let thought = b"Hello World";
245
+
let thought = b"Hello Move";
246
246
```
247
247
248
248
Now, once thought as been created we need to add to the global storage. Since the thought is in bytes format we need to convert it to string using `string::utf8` function. Using aaron's signer we store his thought to the blockchain at aaron's address.
@@ -257,13 +257,13 @@ Now, we need to fetch aaron's address from his signer using `signer::address_of`
257
257
let aaron_address = signer::address_of(aaron);
258
258
```
259
259
260
-
Once we have fetched the address we need to check that the thought stored at the address actually matches with `"Hello World"`.
260
+
Once we have fetched the address we need to check that the thought stored at the address actually matches with `"Hello Move"`.
We call `assert!` function with the condition `aaron_thought == string::utf8(b"Hello World")` if the equality fails then the unit test will abort alerting something is wrong with our code.
266
+
We call `assert!` function with the condition `aaron_thought == string::utf8(b"Hello Move")` if the equality fails then the unit test will abort alerting something is wrong with our code.
267
267
268
268
```Move
269
269
module HelloMove::thoughts {
@@ -291,7 +291,7 @@ module HelloMove::thoughts {
291
291
#[test(aaron = @0xcafe)]
292
292
fun test_basic_flow(aaron: &signer) acquires MyResource {
293
293
// Create a thought for aaron.
294
-
let thought = b"Hello World";
294
+
let thought = b"Hello Move";
295
295
296
296
// Store it to the blockchain.
297
297
create_thoughts(aaron, string::utf8(thought));
@@ -302,8 +302,8 @@ module HelloMove::thoughts {
302
302
// Get the thought at his address.
303
303
let aaron_thought = get_thoughts(aaron_address);
304
304
305
-
// Check if the thought present at that address is actually "Hello World"
0 commit comments