Skip to content
This repository was archived by the owner on Apr 25, 2022. It is now read-only.

Commit 2f75daf

Browse files
committed
test: test for two txs in different batches
1 parent 0bbd1f3 commit 2f75daf

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
source ./lib.sh
4+
5+
start_network
6+
7+
sender=$(client config new $(get_node_rpc))
8+
recipient_pubkley=$(client config new $(get_node_rpc) |
9+
client config get-public-key)
10+
11+
echo "$sender" |
12+
client send-asset 1 "$recipient_pubkley" 5
13+
sleep 1 # force new block
14+
echo "$sender" |
15+
client send-asset 2 "$recipient_pubkley" 5
16+
wait_for_sequence "$sender" 2
17+
18+
ensure_all_lines_match() {
19+
local lines=$1
20+
local match=$2
21+
22+
local lines_count=$(echo "$lines" | wc -l)
23+
24+
echo "$lines" |
25+
grep "$match" |
26+
wc -l |
27+
xargs test $lines_count -eq
28+
}
29+
30+
txs=$(client config new $(get_node_rpc) | client get-latest-transactions)
31+
32+
[ "$(echo "$txs" | wc -l)" -eq 2 ]
33+
ensure_all_lines_match "$txs" "$(echo "$sender" | client config get-public-key)"
34+
ensure_all_lines_match "$txs" "$recipient_pubkley"
35+
ensure_all_lines_match "$txs" 5
36+
ensure_all_lines_match "$txs" success

0 commit comments

Comments
 (0)