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/quick-start/developers/_deploy_donation.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,21 @@ aelf-command create
22
22
ℹ️ Note: If you do not save your account information (by selecting n or N), do not export the wallet password. Only **proceed to the next** step if you have saved your account information.
23
23
:::
24
24
25
-
- Next, enter and confirm your password. Then export your wallet password as shown below:
25
+
- Next, enter and confirm your password. Then export your wallet address and password as shown below:
26
+
27
+
<Tabs>
28
+
<TabItemvalue="Linux and macOs"label="Linux and macOs"default>
29
+
```bash title="Terminal"
30
+
export WALLET_ADDRESS="YOUR_WALLET_ADDRESS"
31
+
```
32
+
</TabItem>
33
+
34
+
<TabItemvalue="Windows"label="Windows">
35
+
```bash title="Command Prompt"
36
+
$env:WALLET_ADDRESS = "YOUR_WALLET_ADDRESS"
37
+
```
38
+
</TabItem>
39
+
</Tabs>
26
40
27
41
<Tabs>
28
42
<TabItemvalue="Linux and macOs"label="Linux and macOs"default>
**Description**: The Donation dApp contract is moderately complex, enabling functionalities such as creating, editing, and deleting donation campaigns, tracking donations, and rewarding contributors. It also supports user-specific data retrieval and ensures secure interactions for managing ELF token-based campaigns.
8
8
9
-
**Purpose**: To provide a practical understanding of donation management systems using smart contracts, focusing on features like campaign creation, user-specific interactions, secure fund management, and reward distribution to enhance blockchain-based philanthropy.
9
+
**Purpose**: To provide a practical understanding of donation management systems using smart contracts, focusing on features like campaign creation, user-specific interactions, secure fund management, and reward distribution to enhance blockchain-based philanthropy. This tutorial also emphasizes unit testing practices for smart contracts to ensure reliability and security.
1.**Successful Donation**: Tests a complete donation flow, including:
807
+
- Campaign creation
808
+
- Token approval
809
+
- Donation execution
810
+
- Verification of campaign amount and donor list
811
+
812
+
2.**Campaign End Date Validation**: Tests that donations cannot be made to expired campaigns
813
+
814
+
3.**Target Amount Validation**: Tests that donations cannot exceed the campaign's target amount
815
+
816
+
Each test follows the Arrange-Act-Assert pattern and uses the `Shouldly` assertion library for clear, readable assertions.
817
+
818
+
:::Note
819
+
For a deeper dive into unit testing smart contracts, check out the complete test suite in our [GitHub repository](https://github.com/AElfProject/aelf-samples/tree/master/donation/1-smart-contract/test).
0 commit comments