Skip to content

Commit

Permalink
Problem: precompile with hermes is not tested (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe authored Feb 21, 2024
1 parent e16b913 commit 0ef7528
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 41 deletions.
1 change: 1 addition & 0 deletions integration_tests/configs/ibc_rly_evm.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ibc {
relayer+: {
chains: [super.chains[0] {
precompiled_contract_address: '0x0000000000000000000000000000000000000065',
json_rpc_address: 'http://127.0.0.1:26701',
}] + super.chains[1:],
},
}
2 changes: 1 addition & 1 deletion integration_tests/ibc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def check_channel_ready():
return False
return state == target

wait_for_fn("channel ready", check_channel_ready)
wait_for_fn("channel ready", check_channel_ready, timeout=30)


def get_next_channel(cli, connid):
Expand Down
36 changes: 0 additions & 36 deletions integration_tests/install_hermes.nix

This file was deleted.

6 changes: 3 additions & 3 deletions integration_tests/test_ibc_rly.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
cronos_transfer_source_tokens,
cronos_transfer_source_tokens_with_proxy,
get_balance,
hermes_transfer,
ibc_denom,
ibc_incentivized_transfer,
prepare_network,
rly_transfer,
)
from .utils import (
ADDRS,
Expand Down Expand Up @@ -53,7 +53,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 @@ -229,7 +229,7 @@ def test_ibc(ibc):
w3 = ibc.cronos.w3
wait_for_new_blocks(ibc.cronos.cosmos_cli(), 1)
start = w3.eth.get_block_number()
rly_transfer(ibc)
hermes_transfer(ibc)
denom = ibc_denom(channel, src_denom)
dst_addr = eth_to_bech32(cronos_signer2)
old_dst_balance = get_balance(ibc.cronos, dst_addr, dst_denom)
Expand Down
2 changes: 1 addition & 1 deletion nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import sources.nixpkgs {
paths = with pkgs.openssl; [ out dev ];
};
};
hermes = pkgs.callPackage ../integration_tests/install_hermes.nix { };
hermes = pkgs.callPackage ./hermes.nix { src = sources.ibc-rs; };
})
(_: pkgs: { test-env = pkgs.callPackage ./testenv.nix { }; })
(_: pkgs: {
Expand Down
35 changes: 35 additions & 0 deletions nix/hermes.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ src
, lib
, stdenv
, darwin
, rustPlatform
, symlinkJoin
, openssl
, pkg-config
}:

rustPlatform.buildRustPackage rec {
name = "hermes";
inherit src;
cargoBuildFlags = "-p ibc-relayer-cli";
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
pkg-config
openssl
darwin.libiconv
darwin.apple_sdk.frameworks.SystemConfiguration
];
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"ibc-proto-0.38.0" = "sha256-UhpWBzraC6fMPJ0BVK6CxdrywoEayNq0tBU0N3MxmB4=";
};
};
doCheck = false;
RUSTFLAGS = "--cfg ossl111 --cfg ossl110 --cfg ossl101";
OPENSSL_NO_VENDOR = "1";
OPENSSL_DIR = symlinkJoin {
name = "openssl";
paths = with openssl; [ out dev ];
};
}
12 changes: 12 additions & 0 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@
"url": "https://github.com/crypto-org-chain/gravity-bridge/archive/d984b1562242efab5d7595d4108472ed27eba06f.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"ibc-rs": {
"branch": "v1.7.0",
"description": "IBC modules and relayer - Formal specifications and Rust implementation",
"homepage": "",
"owner": "informalsystems",
"repo": "ibc-rs",
"rev": "0181c462486b7801d4ec720aa34f34576fcf981b",
"sha256": "1mwm0ia69wlshr5m5a8vblc6zh244rrxxm7np5df74jg330nyw7z",
"type": "tarball",
"url": "https://github.com/devashishdxt/hermes/archive/0181c462486b7801d4ec720aa34f34576fcf981b.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
"branch": "master",
"description": "Easy dependency management for Nix projects",
Expand Down

0 comments on commit 0ef7528

Please sign in to comment.