Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Update test guide and configurations #4

Merged
merged 1 commit into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions configuration-template.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Relaychain network.
#
# Possible values: "kusama", "polkadot".
network = "polkadot"
network = "kusama"
# GraphQL HTTP(S) URI.
#
# This line can be commented out. Otherwise, it will replace the default URI of `network`.
Expand All @@ -18,7 +18,7 @@ network = "polkadot"
# winning the auction, but it becomes unsafe if there is a fork.
#
# finalized: Subscribe to the latest finalized block.
block-subscription-mode = "finalized"
block-subscription-mode = "best"

[bid]
# Parachain's identity you are bidding for.
Expand Down Expand Up @@ -85,7 +85,7 @@ upper-limit = "1000000000000000"
# Slothunter will calculate the value of `x` which is equal to `12` and then bid with the amount of `(x + increment)`.
# The calculation for winning the bid would be: `(x(12) + increment(1)) * 2 + 16 = 42 > 41`, hence, win.
# Since DOT's decimals are ten, there should be ten zeros here.
increment = "10000000000"
increment = "2000000000000"

[notification]
# Notification webhooks.
Expand All @@ -107,7 +107,7 @@ webhooks = [
# Notification mail configurations.
#
# If you don't wish to use any mail notifications, keep this(`[notification.mail]`) whole section commented out.
[notification.mail]
# [notification.mail]
# Notification will be sent to the following recipients.
# receivers = [
# "example1@gmail.com",
Expand Down
35 changes: 19 additions & 16 deletions test/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,35 @@
5. Change the `type` to test different bidding type
6. Adjust the `upper-limit` and `increment` to test more situation if you want
7. Add some `webhooks` to test the notification webhook component
- You can use [webhook.site](https://webhook.site), the result should be listed on the left of the website
- You can use any other webhook listener
- You can use [webhook.site](https://webhook.site), the result should be listed on the left of the website
- You can use any other webhook listener
8. Edit the `mail` to test the notification mail component
- Add some `receivers`
- Add a `sender`
- Recommending using Gmail for testing
- Add `username`, e.g. example@gmail.com
- Add `password`, e.g. [app password](https://support.google.com/accounts/answer/185833?hl=en)
- Add some `receivers`
- Add a `sender`
- Recommending using Gmail for testing
- Add `username`, e.g. example@gmail.com
- Add `password`, e.g. [app password](https://support.google.com/accounts/answer/185833?hl=en)
#### Test
1. Go to the root directory of this repository
2. Run
- `docker-compose -f test/integration/docker-compose.yml down && rm -rf test/integration/data/db && docker-compose -f test/integration/docker-compose.yml up -d` if you have run the basic test before
- `docker-compose -f test/integration/docker-compose.yml up -d` if you haven't run the basic test before
- `docker-compose -f test/integration/docker-compose.yml down && rm -rf test/integration/data/db && docker-compose -f test/integration/docker-compose.yml up -d` if you have run the basic test before
- `docker-compose -f test/integration/docker-compose.yml up -d` if you haven't run the basic test before
3. Run `cargo run -- -c test/integration/rococo.toml`
4. Open browser and navigate to [Polkadot/Substrate Portal](https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944#/explorer)
5. Navigate to `Developer tab -> Sudo tab -> auctions module -> newAuction call`
6. *Optional* for crowdloan
1. Navigate to `Network tab -> Parachains tab -> Crowdloan tab -> Add fund button`
2. Set `crowdfund cap` recommend `1000 UNIT`
3. Set `ending block` recommend `1000`
3. Set `periods` recommend `(0, 0)`
5. *Optional* for crowdloan
1. Navigate to `Network tab -> Parachains tab -> Crowdloan tab -> Add fund button`
2. Set `crowdfund cap` recommend `1000 UNIT`
3. Set `ending block` recommend `1000`
4. Set `periods` recommend `(0, 0)`
6. Navigate to `Developer tab -> Sudo tab -> auctions module -> newAuction call`
7. Submit the new auction call, remember to uncheck the `use a proxy for this call` in the pop-up window
8. A notification should appear in the webhook and mail to indicate the start of an auction
9. Additionally, a notification regarding the initial bid should be included in both the webhook and mail
10. Use `Charlie` and `Dave` to bid for `2001` and `2002` and check the results
11. Wait until the auction ends, uou should receive a notification via webhook and mail indicating that the auction has ended
- E.G.
- `Charlie` bid `5 UNIT` for `(0, 0)`. Slothunter should bid `7 UNIT` for `(0, 0)` with the default configurations
- `Dave` bid `1 UNIT` for `(1, 1)` first, and then `Charlie` bid `5 UNIT` for `(0, 1)`. Slothunter should bid `11 UNIT` for `(0, 0)` with the default configurations
11. Wait until the auction ends, you should receive a notification via webhook and mail indicating that the auction has ended

## Addition
- Default real account is `//Alice`
Expand Down
24 changes: 16 additions & 8 deletions test/integration/rococo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ upper-limit = "1000000000000000"
# Slothunter will calculate the value of `x` which is equal to `12` and then bid with the amount of `(x + increment)`.
# The calculation for winning the bid would be: `(x(12) + increment(1)) * 2 + 16 = 42 > 41`, hence, win.
# Since DOT's decimals are ten, there should be ten zeros here.
increment = "10000000000000"
increment = "2000000000000"

[notification]
# Notification webhooks.
Expand All @@ -105,22 +105,30 @@ increment = "10000000000000"
# - A Discord channel using a Discord webhook.
# - A Telegram channel using a Telegram bot.
# - A Slack channel using a Slack webhook.
webhooks = []
webhooks = [
# "https://example.com/webhook",
# "https://example.com/webhook1",
# "https://example.com/webhook2",
]
# Notification mail configurations.
#
# If you don't wish to use any mail notifications, keep this(`[notification.mail]`) whole section commented out.
[notification.mail]
# [notification.mail]
# Notification will be sent to the following recipients.
receivers = []
[notification.mail.sender]
# receivers = [
# "example1@gmail.com",
# "example2@gmail.com",
# "example@gmail.com",
# ]
# [notification.mail.sender]
# Sender's mail password:
# Note:
# This is usually an app-specific password instead of your account password.
# For example, you can generate an app-spceific password by following the instructions provided in this link: https://support.google.com/accounts/answer/185833?hl=en.
password = "PASSWORD"
# password = "google mail app password"
# Sender's mail address.
username = "USERNAME"
# username = "example@gmail.com"
# SMTP server address.
#
# The default value is the SMTP server address of Gmail.
smtp = "smtp.gmail.com"
# stmp = "smtp.gmail.com"