From c9ee4de2c785e34ee99d1e937c29a3a2e6842b60 Mon Sep 17 00:00:00 2001 From: laruh Date: Sun, 10 Mar 2024 15:02:21 +0700 Subject: [PATCH] use parse_pubkey --- .../tests/docker_tests/nft_swap_proto_v2_tests.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm2src/mm2_main/tests/docker_tests/nft_swap_proto_v2_tests.rs b/mm2src/mm2_main/tests/docker_tests/nft_swap_proto_v2_tests.rs index 5e70512571..04ccec6e05 100644 --- a/mm2src/mm2_main/tests/docker_tests/nft_swap_proto_v2_tests.rs +++ b/mm2src/mm2_main/tests/docker_tests/nft_swap_proto_v2_tests.rs @@ -1,6 +1,7 @@ use super::eth_docker_tests::{eth_coin_with_random_privkey, global_nft_with_random_privkey, nft_swap_contract}; +use coins::eth::EthCoin; use coins::nft::nft_structs::{Chain, ContractType}; -use coins::{SendNftMakerPaymentArgs, SwapOps, ToBytes}; +use coins::{CoinAssocTypes, SendNftMakerPaymentArgs, SwapOps, ToBytes}; use common::{block_on, now_sec}; use mm2_number::BigUint; @@ -11,22 +12,22 @@ fn send_and_spend_erc721_maker_payment() { // in prod we will need to enable global NFT for taker or add new field (for nft swap address) in EthCoin, // as EtomicSwapNft will have its own contract address, due to EIP-170 contract size limitations. // TODO need to add NFT conf in coin conf and refactor enable nft a bit - let taker_global_nft = eth_coin_with_random_privkey(nft_swap_contract()); + let taker_eth_coin = eth_coin_with_random_privkey(nft_swap_contract()); let time_lock = now_sec() - 100; - let taker_pubkey = taker_global_nft.derive_htlc_pubkey(&[]); + let taker_pubkey = taker_eth_coin.derive_htlc_pubkey(&[]); - let _send_payment_args = SendNftMakerPaymentArgs { + let _send_payment_args: SendNftMakerPaymentArgs = SendNftMakerPaymentArgs { time_lock, taker_secret_hash: &[], maker_secret_hash: &[], amount: 1.into(), - taker_pub: &taker_pubkey, + taker_pub: &taker_eth_coin.parse_pubkey(&taker_pubkey).unwrap(), swap_unique_data: &[], token_address: &[], token_id: &BigUint::from(1u32).to_bytes(), chain: &Chain::Eth.to_bytes(), contract_type: &ContractType::Erc721.to_bytes(), - swap_contract_address: &Some(nft_swap_contract().as_bytes().into()), + swap_contract_address: nft_swap_contract().as_bytes(), }; }