diff --git a/src/tests/naming/test_abuses.cairo b/src/tests/naming/test_abuses.cairo index 784c294..10fdac4 100644 --- a/src/tests/naming/test_abuses.cairo +++ b/src/tests/naming/test_abuses.cairo @@ -299,6 +299,17 @@ fn test_transfer_from_returns_false() { set_contract_address(alpha); let aller: felt252 = 35683102; + // we check how much a domain costs + let (_, price) = pricing.compute_buy_price(5, 365); + + // we allow the naming to take our money + eth.approve(naming.contract_address, price); + + // we buy with no resolver, no sponsor, no discount and empty metadata + // in pay_domain transferFrom will return false + naming + .buy(1, aller, 365, ContractAddressZeroable::zero(), ContractAddressZeroable::zero(), 0, 0); +} #[test] #[available_gas(2000000000)] @@ -387,31 +398,13 @@ fn test_buy_empty_domain() { // we buy with no resolver, no sponsor, no discount and empty metadata naming - .buy(1, empty_domain, 365, ContractAddressZeroable::zero(), ContractAddressZeroable::zero(), 0, 0); -} - -#[test] -#[available_gas(2000000000)] -#[should_panic(expected: ('domain can\'t be empty', 'ENTRYPOINT_FAILED'))] -fn test_buy_empty_domain() { - // setup - let (eth, pricing, identity, naming) = deploy(); - let alpha = contract_address_const::<0x123>(); - - // we mint the id - set_contract_address(alpha); - identity.mint(1); - - set_contract_address(alpha); - let empty_domain: felt252 = 0; - - // we check how much a domain costs - let (_, price) = pricing.compute_buy_price(0, 365); - - // we allow the naming to take our money - eth.approve(naming.contract_address, price); - - // we buy with no resolver, no sponsor, no discount and empty metadata - naming - .buy(1, empty_domain, 365, ContractAddressZeroable::zero(), ContractAddressZeroable::zero(), 0, 0); + .buy( + 1, + empty_domain, + 365, + ContractAddressZeroable::zero(), + ContractAddressZeroable::zero(), + 0, + 0 + ); }