Skip to content

Commit

Permalink
fix test_basic
Browse files Browse the repository at this point in the history
tidy up

tidy up

remove debugging

tidy up

fix test_basic

tidy up

tidy up

remove debugging

tidy up

fix multisig

join validator works
  • Loading branch information
leejw51crypto committed Apr 27, 2021
1 parent 40a8fe1 commit 4560356
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 84 deletions.
72 changes: 42 additions & 30 deletions integration_tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json
import time

import json
from .utils import wait_for_block


def test_simple(cluster):
"""
- check number of validators
Expand All @@ -26,37 +26,49 @@ def test_transfer(cluster):
"""
community_addr = cluster.address("community")
reserve_addr = cluster.address("reserve")

community_balance = cluster.balance(community_addr)
reserve_balance = cluster.balance(reserve_addr)

tx = cluster.transfer(community_addr, reserve_addr, "1cro")
print("transfer tx", tx["txhash"])
assert tx["logs"] == [
{
"events": [
{
"attributes": [
{"key": "action", "value": "send"},
{"key": "sender", "value": community_addr},
{"key": "module", "value": "bank"},
],
"type": "message",
},
{
"attributes": [
{"key": "recipient", "value": reserve_addr},
{"key": "sender", "value": community_addr},
{"key": "amount", "value": "100000000basecro"},
],
"type": "transfer",
},
],
"log": "",
"msg_index": 0,
}
]

assert json.dumps(tx["logs"]) == json.dumps(
[
{
"events": [
{
"attributes": [
{"key": "receiver", "value": reserve_addr},
{"key": "amount", "value": "100000000basecro"},
],
"type": "coin_received",
},
{
"attributes": [
{"key": "spender", "value": community_addr},
{"key": "amount", "value": "100000000basecro"},
],
"type": "coin_spent",
},
{
"attributes": [
{"key": "action", "value": "/cosmos.bank.v1beta1.Msg/Send"},
{"key": "sender", "value": community_addr},
{"key": "module", "value": "bank"},
],
"type": "message",
},
{
"attributes": [
{"key": "recipient", "value": reserve_addr},
{"key": "sender", "value": community_addr},
{"key": "amount", "value": "100000000basecro"},
],
"type": "transfer",
},
],
"log": "",
"msg_index": 0,
}
]
)
assert cluster.balance(community_addr) == community_balance - 100000000
assert cluster.balance(reserve_addr) == reserve_balance + 100000000
query_txs_1 = cluster.query_all_txs(community_addr)
Expand Down
Loading

0 comments on commit 4560356

Please sign in to comment.