Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 25, 2024
1 parent 81daa98 commit bdf116b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 1 addition & 3 deletions integration_tests/ibc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions integration_tests/test_ibc_rly.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
ibc_multi_transfer,
ibc_transfer,
prepare_network,
rly_transfer,
)
from .utils import (
ADDRS,
Expand Down Expand Up @@ -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,
)


Expand Down Expand Up @@ -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()
Expand Down
13 changes: 3 additions & 10 deletions x/cronos/keeper/precompiles/relayer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package precompiles

import (
"context"
"errors"
"fmt"

Expand Down Expand Up @@ -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)

Check warning on line 222 in x/cronos/keeper/precompiles/relayer.go

View check run for this annotation

Codecov / codecov/patch

x/cronos/keeper/precompiles/relayer.go#L219-L222

Added lines #L219 - L222 were not covered by tests
}
input := args[0].([]byte)

Check warning on line 224 in x/cronos/keeper/precompiles/relayer.go

View check run for this annotation

Codecov / codecov/patch

x/cronos/keeper/precompiles/relayer.go#L224

Added line #L224 was not covered by tests
e := &Executor{
Expand Down Expand Up @@ -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)

Check warning on line 263 in x/cronos/keeper/precompiles/relayer.go

View check run for this annotation

Codecov / codecov/patch

x/cronos/keeper/precompiles/relayer.go#L263

Added line #L263 was not covered by tests
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)

Check warning on line 265 in x/cronos/keeper/precompiles/relayer.go

View check run for this annotation

Codecov / codecov/patch

x/cronos/keeper/precompiles/relayer.go#L265

Added line #L265 was not covered by tests
case TimeoutOnClose:
res, err = exec(e, bc.ibcKeeper.TimeoutOnClose)
default:
Expand Down

0 comments on commit bdf116b

Please sign in to comment.