Skip to content

Commit

Permalink
cover all topics
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Jun 23, 2023
1 parent c8c6f86 commit 27e733c
Show file tree
Hide file tree
Showing 6 changed files with 284 additions and 225 deletions.
154 changes: 74 additions & 80 deletions bindings/cosmos/precompile/relayer/i_relayer_module.abigen.go

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions contracts/src/Relayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,17 @@ interface IRelayerModule {
PacketData packetData
);
event AcknowledgePacket(
string indexed packetTimeoutHeight,
string indexed packetTimeoutTimestamp,
string indexed packetSequence,
string packetSrcPort,
string packetSrcChannel,
string packetDstPort,
string indexed packetSrcPort,
string indexed packetSrcChannel,
string indexed packetDstPort,
string packetDstChannel,
string packetChannelOrdering,
string packetConnection
);
event TimeoutPacket(
string indexed packetTimeoutHeight,
string indexed packetTimeoutTimestamp,
string indexed packetSequence,
string packetSrcPort,
string packetSrcChannel,
string packetDstPort,
string indexed packetSrcPort,
string indexed packetSrcChannel,
string indexed packetDstPort,
string packetDstChannel,
string packetChannelOrdering
);
Expand Down
18 changes: 6 additions & 12 deletions integration_tests/contracts/contracts/Relayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,17 @@ interface IRelayerModule {
PacketData packetData
);
event AcknowledgePacket(
string indexed packetTimeoutHeight,
string indexed packetTimeoutTimestamp,
string indexed packetSequence,
string packetSrcPort,
string packetSrcChannel,
string packetDstPort,
string indexed packetSrcPort,
string indexed packetSrcChannel,
string indexed packetDstPort,
string packetDstChannel,
string packetChannelOrdering,
string packetConnection
);
event TimeoutPacket(
string indexed packetTimeoutHeight,
string indexed packetTimeoutTimestamp,
string indexed packetSequence,
string packetSrcPort,
string packetSrcChannel,
string packetDstPort,
string indexed packetSrcPort,
string indexed packetSrcChannel,
string indexed packetDstPort,
string packetDstChannel,
string packetChannelOrdering
);
Expand Down
13 changes: 13 additions & 0 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,19 @@ def ibc_transfer(
)
)

def ibc_escrow_address(self, port, channel):
return json.loads(
self.raw(
"query",
"ibc-transfer",
"escrow-address",
port,
channel,
home=self.data_dir,
node=self.node_rpc,
)
)

def export(self):
return self.raw("export", home=self.data_dir)

Expand Down
22 changes: 2 additions & 20 deletions integration_tests/ibc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,26 +177,6 @@ def hermes_transfer(ibc):
return src_amount


def rly_transfer(ibc):
# chainmain-1 -> cronos_777-1
my_ibc0 = "chainmain-1"
my_ibc1 = "cronos_777-1"
my_channel = "channel-0"
dst_addr = eth_to_bech32(ADDRS["signer2"])
src_amount = 10
src_denom = "basecro"
path = ibc.cronos.base_dir.parent / "relayer"
# dstchainid srcchainid srcportid srchannelid
cmd = (
f"rly tx transfer {my_ibc0} {my_ibc1} {src_amount}{src_denom} "
f"{dst_addr} {my_channel} "
f"--path chainmain-cronos "
f"--home {str(path)}"
)
subprocess.run(cmd, check=True, shell=True)
return src_amount


def get_balance(chain, addr, denom):
balance = chain.cosmos_cli().balance(addr, denom)
print("balance", balance, addr, denom)
Expand Down Expand Up @@ -301,6 +281,7 @@ def check_balance_change():
wait_for_fn("balance change", check_balance_change)
assert chains[0].balance(sender, base_denom) == old_amt_sender_base
assert chains[1].balance(receiver, "basecro") == old_amt_receiver_base - fee_amount
return amount


def ibc_denom(channel, denom):
Expand Down Expand Up @@ -379,3 +360,4 @@ def check_contract_balance_change():

wait_for_fn("check contract balance change", check_contract_balance_change)
assert cronos_balance_after_send == amount
return amount, contract.address
Loading

0 comments on commit 27e733c

Please sign in to comment.