Skip to content

Commit

Permalink
use parse_pubkey
Browse files Browse the repository at this point in the history
  • Loading branch information
laruh committed Mar 10, 2024
1 parent 56303c6 commit c9ee4de
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions mm2src/mm2_main/tests/docker_tests/nft_swap_proto_v2_tests.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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<EthCoin> = 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(),
};
}

0 comments on commit c9ee4de

Please sign in to comment.