Skip to content

Commit fd23f75

Browse files
committed
lint
1 parent 53ab499 commit fd23f75

File tree

10 files changed

+76
-31
lines changed

10 files changed

+76
-31
lines changed

app/app.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,7 @@ func New(
715715
// Since the callbacks middleware itself is an ics4wrapper, it needs to be passed to the ica controller keeper
716716
app.ICAControllerKeeper.WithICS4Wrapper(icaICS4Wrapper)
717717

718-
var icaHostStack porttypes.IBCModule
719-
icaHostStack = icahost.NewIBCModule(app.ICAHostKeeper)
718+
icaHostStack := icahost.NewIBCModule(app.ICAHostKeeper)
720719

721720
// Create static IBC router, add transfer route, then set and seal it
722721
ibcRouter := porttypes.NewRouter()

integration_tests/test_ibc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ def ibc(request, tmp_path_factory):
3232
incentivized = request.param
3333
name = "ibc"
3434
path = tmp_path_factory.mktemp(name)
35-
yield from prepare_network(path, name, incentivized=incentivized, is_ibc_transfer=True)
35+
yield from prepare_network(
36+
path,
37+
name,
38+
incentivized=incentivized,
39+
is_ibc_transfer=True,
40+
)
3641

3742

3843
def test_ibc_transfer(ibc):

integration_tests/test_ibc_rly.py

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,12 @@ def test_ibc(ibc):
247247
w3 = ibc.cronos.w3
248248
wait_for_new_blocks(ibc.cronos.cosmos_cli(), 1)
249249
start = w3.eth.get_block_number()
250-
is_hermes = ibc.hermes != None
250+
is_hermes = ibc.hermes is not None
251251

252252
if is_hermes:
253253
ibc_transfer(ibc, hermes_transfer)
254-
# we don't check the logs for Hermes due to it doesn't sent evm messages to call the cronos precompiled contract.
254+
# we don't check the logs for Hermes due to it doesn't sent evm messages
255+
# to call the cronos precompiled contract.
255256
else:
256257
ibc_transfer(ibc, rly_transfer)
257258
denom = ibc_denom(channel, src_denom)
@@ -263,12 +264,41 @@ def test_ibc(ibc):
263264
transfer_addr = module_address("transfer")
264265
seq = get_send_packet_seq(chainmain_cli)
265266
expected = [
266-
recv_packet(seq, relayer0, cronos_signer2, src_amount, src_denom),
267-
*send_from_module_to_acc(transfer_addr, cronos_signer2, src_amount, denom),
268-
fungible(cronos_signer2, relayer, src_amount, src_denom),
269-
*send_from_acc_to_module(cronos_signer2, cronos_addr, src_amount, denom),
270-
*send_from_module_to_acc(cronos_addr, cronos_signer2, dst_amount, dst_denom),
271-
write_ack(seq, relayer0, cronos_signer2, src_amount, src_denom),
267+
recv_packet(
268+
seq,
269+
relayer0,
270+
cronos_signer2,
271+
src_amount,
272+
src_denom),
273+
*
274+
send_from_module_to_acc(
275+
transfer_addr,
276+
cronos_signer2,
277+
src_amount,
278+
denom),
279+
fungible(
280+
cronos_signer2,
281+
relayer,
282+
src_amount,
283+
src_denom),
284+
*
285+
send_from_acc_to_module(
286+
cronos_signer2,
287+
cronos_addr,
288+
src_amount,
289+
denom),
290+
*
291+
send_from_module_to_acc(
292+
cronos_addr,
293+
cronos_signer2,
294+
dst_amount,
295+
dst_denom),
296+
write_ack(
297+
seq,
298+
relayer0,
299+
cronos_signer2,
300+
src_amount,
301+
src_denom),
272302
]
273303
assert len(logs) == len(expected)
274304
height = logs[0]["blockNumber"]
@@ -289,7 +319,7 @@ def get_escrow_address(cli, channel):
289319
)
290320

291321

292-
@pytest.mark.skip("skipping test_ibc_incentivized_transfer due to unsupported precompiled contract in hermes relayer")
322+
@pytest.mark.skip("skipping due to unsupported precompiled contract in hermes")
293323
def test_ibc_incentivized_transfer(ibc):
294324
w3 = ibc.cronos.w3
295325
cli = ibc.cronos.cosmos_cli()
@@ -386,12 +416,12 @@ def assert_transfer_source_tokens_topics(ibc, fn):
386416
assert ftopic == topic, method_name
387417

388418

389-
@pytest.mark.skip("skipping test_cronos_transfer_source_tokens due to unsupported precompiled contract in hermes relayer")
419+
@pytest.mark.skip("skipping due to unsupported precompiled contract in hermes")
390420
def test_cronos_transfer_source_tokens(ibc):
391421
assert_transfer_source_tokens_topics(ibc, cronos_transfer_source_tokens)
392422

393423

394-
@pytest.mark.skip("skipping test_cronos_transfer_source_tokens_with_proxy due to unsupported precompiled contract in hermes relayer")
424+
@pytest.mark.skip("skipping due to unsupported precompiled contract in hermes")
395425
def test_cronos_transfer_source_tokens_with_proxy(ibc):
396426
assert_transfer_source_tokens_topics(ibc, cronos_transfer_source_tokens_with_proxy)
397427

integration_tests/test_ibc_rly_gas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def test_ibc(ibc):
3333
cli = ibc.cronos.cosmos_cli()
3434
wait_for_new_blocks(cli, 1)
3535
ibc_transfer(ibc)
36-
36+
3737
if ibc.hermes is None:
3838
ibc_incentivized_transfer(ibc)
39-
39+
4040
ibc_multi_transfer(ibc)
4141
diff = 0.15
4242
record = log_gas_records(cli)

integration_tests/test_ibc_update_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ def ibc(request, tmp_path_factory):
1414
"prepare-network"
1515
name = "ibc"
1616
path = tmp_path_factory.mktemp(name)
17-
yield from prepare_network(path, name, is_relay=False, is_ibc_transfer=True, incentivized=False)
17+
yield from prepare_network(
18+
path,
19+
name,
20+
is_relay=False,
21+
is_ibc_transfer=True,
22+
incentivized=False,
23+
)
1824

1925

2026
def test_ibc_update_client(ibc, tmp_path):

integration_tests/test_ica.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def submit_msgs(msg_num, timeout_in_s=no_timeout, gas="200000"):
112112
submit_msgs(msg_num, 0.005, "600000")
113113
assert cli_host.balance(ica_address, denom=denom) == balance
114114
if order == ChannelOrder.UNORDERED.value:
115-
# regiser new account for unordered channel, will not update the original channel.
115+
# regiser new account for unordered channel, will not update the original
116+
# channel.
116117
register_acc(cli_controller, connid)
117118
else:
118119
# rly: ibc_upgrade_channels not work

integration_tests/test_ica_incentivized.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def ibc(request, tmp_path_factory):
2222
yield from prepare_network(path, name)
2323

2424

25-
@pytest.mark.skip(reason="skip for now, the ibc-fee module has been removed in the ibc-go v10")
25+
@pytest.mark.skip("The ibc-fee module has been removed in the ibc-go v10")
2626
def test_incentivized(ibc):
2727
connid = "connection-0"
2828
cli_host = ibc.chainmain.cosmos_cli()

integration_tests/test_ica_precompile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def check_log():
227227
wait_for_fn("packet log", check_log)
228228

229229

230-
@pytest.mark.skip("skipping test_sc_call due to unsupported precompiled contract in hermes relayer")
230+
@pytest.mark.skip("skipping due to unsupported precompiled contract in hermes")
231231
@pytest.mark.parametrize("order", [Ordering.ORDERED.value, Ordering.UNORDERED.value])
232232
def test_sc_call(ibc, order):
233233
cli_host = ibc.chainmain.cosmos_cli()

nix/default.nix

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,27 @@ import sources.nixpkgs {
6060
];
6161
};
6262
};
63-
})
63+
})
6464
(_: pkgs: {
65-
hermes = let
65+
hermes =
66+
let
6667
# The informalsystems/hermes v1.13.1 requires rust version >= v1.83
6768
# The nixpkgs 24.11 is using rust version v1.82
6869
# Use fenix to select different rust toolchain version
69-
rustToolchain = (import sources.fenix {
70-
inherit system;
71-
}).fromToolchainFile {
72-
file = ./rust-toolchain.toml;
73-
sha256 = "sha256-s1RPtyvDGJaX/BisLT+ifVfuhDT1nZkZ1NcK8sbwELM=";
74-
};
70+
rustToolchain =
71+
(import sources.fenix {
72+
inherit system;
73+
}).fromToolchainFile
74+
{
75+
file = ./rust-toolchain.toml;
76+
sha256 = "sha256-s1RPtyvDGJaX/BisLT+ifVfuhDT1nZkZ1NcK8sbwELM=";
77+
};
7578
fenixRustPlatform = pkgs.makeRustPlatform {
7679
cargo = rustToolchain;
7780
rustc = rustToolchain;
7881
};
79-
in pkgs.callPackage ./hermes.nix {
82+
in
83+
pkgs.callPackage ./hermes.nix {
8084
src = sources.hermes;
8185
rustPlatform = fenixRustPlatform;
8286
};

nix/hermes.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rustPlatform.buildRustPackage rec {
2222
protobuf
2323
];
2424
cargoLock = {
25-
lockFile = "${src}/Cargo.lock";
25+
lockFile = "${src}/Cargo.lock";
2626
};
2727
doCheck = false;
2828
RUSTFLAGS = "--cfg ossl111 --cfg ossl110 --cfg ossl101";
@@ -36,4 +36,4 @@ rustPlatform.buildRustPackage rec {
3636
};
3737
PROTOC = "${protobuf}/bin/protoc";
3838
PROTOC_INCLUDE = "${protobuf}/include";
39-
}
39+
}

0 commit comments

Comments
 (0)