Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: no register support for payee and counterpartyPayee #1665

Merged
merged 5 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## UNRELEASED

### Features

* [#1665](https://github.com/crypto-org-chain/cronos/pull/1665) Support register for payee and counterpartyPayee in relayer precompile.

### Improvements

* [#1664](https://github.com/crypto-org-chain/cronos/pull/1664) Update cometbft to 0.38.13.
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ func New(
evmS,
[]evmkeeper.CustomContractFn{
func(_ sdk.Context, rules ethparams.Rules) vm.PrecompiledContract {
return cronosprecompiles.NewRelayerContract(app.IBCKeeper, appCodec, rules, app.Logger())
return cronosprecompiles.NewRelayerContract(app.IBCKeeper, app.IBCFeeKeeper, appCodec, rules, app.Logger())
},
func(ctx sdk.Context, rules ethparams.Rules) vm.PrecompiledContract {
return cronosprecompiles.NewIcaContract(ctx, app.ICAControllerKeeper, &app.CronosKeeper, appCodec, gasConfig)
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/configs/ibc.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ config {
'account-prefix': 'cro',
'coin-type': 394,
'app-config': {
'minimum-gas-prices': '500basecro',
'minimum-gas-prices': '0basecro',
},
validators: [
{
Expand Down Expand Up @@ -68,7 +68,7 @@ config {
},
{
name: 'signer2',
coins: '10000000000000cro',
coins: '10000000000000cro,100000000000ibcfee',
mnemonic: '${SIGNER2_MNEMONIC}',
},
] + [
Expand Down
23 changes: 21 additions & 2 deletions integration_tests/contracts/contracts/TestRelayer.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {IRelayerFunctions} from "./src/RelayerFunctions.sol";

contract TestRelayer {
address constant relayer = 0x0000000000000000000000000000000000000065;
address constant relayerContract = 0x0000000000000000000000000000000000000065;
IRelayerFunctions relayer = IRelayerFunctions(relayerContract);
address payee;
address counterpartyPayee;

function batchCall(bytes[] memory payloads) public {
for (uint256 i = 0; i < payloads.length; i++) {
(bool success,) = relayer.call(payloads[i]);
(bool success,) = relayerContract.call(payloads[i]);
require(success);
}
}
mmsqe marked this conversation as resolved.
Show resolved Hide resolved

function callRegisterPayee(string calldata portID, string calldata channelID, address payeeAddr) public returns (bool) {
require(payee == address(0) || payee == msg.sender, "register fail");
bool result = relayer.registerPayee(portID, channelID, payeeAddr);
require(result, "call failed");
payee = msg.sender;
}
mmsqe marked this conversation as resolved.
Show resolved Hide resolved

function callRegisterCounterpartyPayee(string calldata portID, string calldata channelID, string calldata counterpartyPayeeAddr) public returns (bool) {
require(counterpartyPayee == address(0) || counterpartyPayee == msg.sender, "register fail");
bool result = relayer.registerCounterpartyPayee(portID, channelID, counterpartyPayeeAddr);
require(result, "call failed");
counterpartyPayee = msg.sender;
}
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
}
2 changes: 1 addition & 1 deletion integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def ibc_transfer(
to,
amount,
channel, # src channel
target_version, # chain version number of target chain
target_version=1, # chain version number of target chain
event_query_tx_for=False,
**kwargs,
):
Expand Down
Loading
Loading