fix(tpu-v2): provide ethcoin support in tpu kickstart process#2300
Conversation
d08fa86 to
df7778c
Compare
This reverts commit df7778c.
…swap_kickstart_handler_for_taker in swap_kick_starts func
onur-ozkan
left a comment
There was a problem hiding this comment.
Please ping me once you are done with reviews @borngraced
|
Can you add test coverage for ETH ? Seems like we have one for UTXOs https://github.com/KomodoPlatform/komodo-defi-framework/blob/ea5f3076084e568f528e6927f5aa9f6fb0b03435/mm2src/mm2_main/tests/docker_tests/swap_proto_v2_tests.rs#L722-L723 |
I can, but it will be on sepolia and use feature flag |
No problem I guess, better than nothing |
…-for-payment-spend-kickstart
…-for-payment-spend-kickstart
6c332f2 to
1e10d83
Compare
1e10d83 to
d48cc25
Compare
…d' into fix-tpu-v2-wait-for-payment-spend-kickstart
|
Added |
| let uuids = block_on(start_swaps(&mut mm_bob, &mut mm_alice, &[(ETH, ETH1)], 1.0, 1.0, 77.)); | ||
| log!("{:?}", uuids); | ||
| let parsed_uuids: Vec<Uuid> = uuids.iter().map(|u| u.parse().unwrap()).collect(); | ||
|
|
||
| for uuid in uuids.iter() { | ||
| log_swap_status_before_stop(&mm_bob, uuid, "Maker"); | ||
| log_swap_status_before_stop(&mm_alice, uuid, "Taker"); | ||
| } |
There was a problem hiding this comment.
nit: uuids is just a single item in a vector. you might want to extract it.
There was a problem hiding this comment.
The loop handles unexpected cases where there might be more than one swap.
Logging all uuids (even if vec has one element) ensures we don’t miss anything if something goes wrong, making the test more reliable.
There was a problem hiding this comment.
The loop handles unexpected cases where there might be more than one swap.
tbh, i don't think this should be our way to approach things, this will leave us with a lot of dept.
and i don't think there should even be any unexpected cases in a test.
that's my opinion about the reasoning, but the thing is still a nit.
| // Restart Bob and Alice | ||
| bob_conf.conf["dbdir"] = mm_bob.folder.join("DB").to_str().unwrap().into(); | ||
| bob_conf.conf["log"] = mm_bob.folder.join("mm2_dup.log").to_str().unwrap().into(); |
There was a problem hiding this comment.
nit: or you might just use MarketMakerIt::seednode_trade_v2
There was a problem hiding this comment.
As I see we do this in every kickstart test
https://github.com/KomodoPlatform/komodo-defi-framework/blob/5750415eb12e6207c49da77d53ba60894967c612/mm2src/mm2_main/tests/docker_tests/swaps_file_lock_tests.rs#L149-L163
RaiiDump is used to avoid the issue rust-lang/rust#42474
https://github.com/KomodoPlatform/komodo-defi-framework/blob/5750415eb12e6207c49da77d53ba60894967c612/mm2src/mm2_test_helpers/src/for_tests.rs#L1205-L1214
According the last comments some problems still occur, so its better to follow current approach in tests
| alice_conf.conf["dbdir"] = mm_alice.folder.join("DB").to_str().unwrap().into(); | ||
| alice_conf.conf["log"] = mm_alice.folder.join("mm2_dup.log").to_str().unwrap().into(); | ||
| alice_conf.conf["seednodes"] = vec![mm_bob.ip.to_string()].into(); |
There was a problem hiding this comment.
nit: or MarketMakerIt::light_node_trade_v2
There was a problem hiding this comment.
btw, why create a different mm2_dup.log? u could not call mm_dump if u want.
|
Merge blocked by #2261 |
…d' into fix-tpu-v2-wait-for-payment-spend-kickstart # Conflicts: # mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
…d' into fix-tpu-v2-wait-for-payment-spend-kickstart
) This commit also provides EthCoin support in kickstart handler for taker and maker swaps #2300
This pr provides EthCoin support in kickstart handler for taker and maker swaps
added
test_v2_eth_eth_kickstart