From bdf116b1ee3da683fd76c52850949ba8ac19ef98 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Fri, 25 Oct 2024 17:30:37 +0800 Subject: [PATCH] cleanup --- CHANGELOG.md | 6 ++++++ integration_tests/ibc_utils.py | 4 +--- integration_tests/test_ibc_rly.py | 5 ++--- x/cronos/keeper/precompiles/relayer.go | 13 +++---------- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8734ce4c5e..616ed782f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## UNRELEASED + +### Features + +* [#1665](https://github.com/crypto-org-chain/cronos/pull/1665) Support register for payee and counterpartyPayee in relayer precompile. + *Oct 24, 2024* ## v1.4.0-rc2 diff --git a/integration_tests/ibc_utils.py b/integration_tests/ibc_utils.py index 5da5413bf9..478204753b 100644 --- a/integration_tests/ibc_utils.py +++ b/integration_tests/ibc_utils.py @@ -210,13 +210,11 @@ def prepare_network( cronos.cosmos_cli(), chainmain.cosmos_cli(), port_id, channel_id ) data = {"from": acc.address} - print("mm-contract", contract.functions) tx = contract.functions.callRegisterPayee( port_id, channel_id, ADDRS["signer1"] ).build_transaction(data) receipt = send_transaction(w3, tx, acc.key) - print("mm-receipt.status", receipt.status) - # assert receipt.status == 0 + assert receipt.status == 1, receipt port = None if is_relay: diff --git a/integration_tests/test_ibc_rly.py b/integration_tests/test_ibc_rly.py index 35c207b543..0e8e23ee91 100644 --- a/integration_tests/test_ibc_rly.py +++ b/integration_tests/test_ibc_rly.py @@ -15,7 +15,6 @@ ibc_multi_transfer, ibc_transfer, prepare_network, - rly_transfer, ) from .utils import ( ADDRS, @@ -52,7 +51,7 @@ def ibc(request, tmp_path_factory): yield from prepare_network( path, name, - relayer=cluster.Relayer.RLY.value, + relayer=cluster.Relayer.HERMES.value, ) @@ -236,7 +235,7 @@ def test_ibc(ibc): w3 = ibc.cronos.w3 wait_for_new_blocks(ibc.cronos.cosmos_cli(), 1) start = w3.eth.get_block_number() - ibc_transfer(ibc, rly_transfer) + ibc_transfer(ibc) denom = ibc_denom(channel, src_denom) logs = get_logs_since(w3, CONTRACT, start) chainmain_cli = ibc.chainmain.cosmos_cli() diff --git a/x/cronos/keeper/precompiles/relayer.go b/x/cronos/keeper/precompiles/relayer.go index 3f7995bd1f..5e8497e951 100644 --- a/x/cronos/keeper/precompiles/relayer.go +++ b/x/cronos/keeper/precompiles/relayer.go @@ -1,7 +1,6 @@ package precompiles import ( - "context" "errors" "fmt" @@ -220,7 +219,7 @@ func (bc *RelayerContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool if execErr != nil { return nil, execErr } - return method.Outputs.Pack([]byte{}) + return method.Outputs.Pack(true) } input := args[0].([]byte) e := &Executor{ @@ -261,15 +260,9 @@ func (bc *RelayerContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool case RecvPacket: res, err = exec(e, bc.ibcKeeper.RecvPacket) case Acknowledgement: - res, err = exec(e, func(goCtx context.Context, msg *channeltypes.MsgAcknowledgement) (*channeltypes.MsgAcknowledgementResponse, error) { - msg.Signer = sdk.AccAddress(evm.TxContext.Origin.Bytes()).String() - return bc.ibcKeeper.Acknowledgement(goCtx, msg) - }) + res, err = exec(e, bc.ibcKeeper.Acknowledgement) case Timeout: - res, err = exec(e, func(goCtx context.Context, msg *channeltypes.MsgTimeout) (*channeltypes.MsgTimeoutResponse, error) { - msg.Signer = sdk.AccAddress(evm.TxContext.Origin.Bytes()).String() - return bc.ibcKeeper.Timeout(goCtx, msg) - }) + res, err = exec(e, bc.ibcKeeper.Timeout) case TimeoutOnClose: res, err = exec(e, bc.ibcKeeper.TimeoutOnClose) default: