Skip to content

Commit

Permalink
fix sender
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Jul 28, 2022
1 parent bd520d5 commit 0fe9774
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions integration_tests/test_ibc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from .network import Chainmain, Cronos, Hermes, setup_custom_cronos
from .utils import (
KEYS,
ADDRS,
CONTRACTS,
deploy_contract,
Expand Down Expand Up @@ -112,7 +113,10 @@ def check_balance_change():


def test_precompiles_ibc(ibc):
"test sending basecro from crypto-org chain to cronos"
"""
test sending basetcro from cronos to crypto-org-chain using precompile ibc transfer.
depends on `test_ibc` to send the original coins.
"""
# wait for hermes
output = subprocess.getoutput(
f"curl -s -X GET 'http://127.0.0.1:{ibc.hermes.port}/state' | jq"
Expand All @@ -121,12 +125,14 @@ def test_precompiles_ibc(ibc):

portId = "transfer"
channelId = "channel-0"
src_amount = 10
src_denom = "basetcro"
# receiver = ADDRS["signer2"]
coin_receiver = ibc.chainmain.cosmos_cli().address("signer2")
dst_amount = 2
src_amount = dst_amount * (10**10) # the decimal places difference
src_denom = "basetcro"

w3 = ibc.cronos.w3
addr = ADDRS["validator"]
addr = ADDRS["signer2"]
src_addr = f"{eth_to_bech32(addr)}"

def print_balances():
Expand All @@ -142,7 +148,7 @@ def print_balances():
tx = contract.functions.nativeTransfer(
portId, channelId, coin_receiver, src_amount, src_denom,
).buildTransaction({"from": addr})
receipt = send_transaction(w3, tx)
receipt = send_transaction(w3, tx, KEYS["signer2"])
assert receipt.status == 1, "expect transfer success"

last_ack_seq = contract.caller.getLastAckSeq()
Expand Down

0 comments on commit 0fe9774

Please sign in to comment.