Skip to content

Commit

Permalink
chore: added Telegram tests (#81)
Browse files Browse the repository at this point in the history
* chore: added some Telegram tests

* chore: added /help tests

* chore: added /aliases tests

* chore: forgot to commit file

* chore: moved templates manager to a separate module

* chore: added /status tests

* chore: added /alias tests

* chore: added internal error test

* chore: added rest telegram tests

* chore: added reporters test

* chore: removed unused utils

* chore: added tests for telegram templates manager

* chore: added more stub tests

* chore: added one more test
  • Loading branch information
freak12techno authored Dec 28, 2024
1 parent 5f1cd79 commit b0c76e7
Show file tree
Hide file tree
Showing 49 changed files with 2,573 additions and 195 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ linters:
- funlen
- nlreturn
- wrapcheck
- gomnd
- cyclop
- err113
- exhaustruct
Expand Down
3 changes: 3 additions & 0 deletions assets/aliases.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[subscription]
[subscription.chain]
wallet = "test"
2 changes: 2 additions & 0 deletions assets/responses/get-aliases.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<strong>ChainName</strong>
- test -> <code>wallet</code>
13 changes: 13 additions & 0 deletions assets/responses/help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<a href="https://github.com/QuokkaStake/cosmos-transactions-bot">cosmos-transactions-bot</a> v1.2.3

This bot can track any transactions on any Cosmos-compatible network
and report them on different reporters (currently, only Telegram is supported).

Created by <a href="https://quokkastake.io">🐹 Quokka Stake</a> with ❤️.

The bot can understand the following commands:
- /help - display this message
- /status - see nodes status
- /config - see app config
- /alias [chain] [address] [alias] - set an alias for wallet
- /aliases - see wallets aliases
1 change: 1 addition & 0 deletions assets/responses/set-alias.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Saved alias: alias -> <code>address</code>
5 changes: 5 additions & 0 deletions assets/responses/status.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<strong>Nodes status</strong>

<strong>Chain chain1:</strong>
🔴 <code>https://example1.com</code> -> not active
🔴 <code>https://example2.com</code> -> not active
14 changes: 14 additions & 0 deletions assets/telegram-bot-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ok": true,
"result": {
"id": 123,
"is_bot": true,
"first_name": "TestBot",
"username": "TestBot",
"can_join_groups": true,
"can_read_all_group_messages": false,
"supports_inline_queries": false,
"can_connect_to_business": false,
"has_main_web_app": false
}
}
Loading

0 comments on commit b0c76e7

Please sign in to comment.