mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-02-05 11:15:33 +00:00
[fuzzing] transfers out of the contract should always pass
When a transfer of tokens from the contract fails, then the fuzzer has found a bug. Changing `require` to `assert` ensures that the fuzzer considers this a test failure.
This commit is contained in:
parent
03e5546121
commit
a7dd840eaa
@ -203,7 +203,7 @@ contract Marketplace is Proofs, StateRetrieval {
|
|||||||
slot.currentCollateral;
|
slot.currentCollateral;
|
||||||
_marketplaceTotals.sent += amount;
|
_marketplaceTotals.sent += amount;
|
||||||
slot.state = SlotState.Paid;
|
slot.state = SlotState.Paid;
|
||||||
require(token.transfer(slot.host, amount), "Payment failed");
|
assert(token.transfer(slot.host, amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @notice Withdraws storage request funds back to the client that deposited them.
|
/// @notice Withdraws storage request funds back to the client that deposited them.
|
||||||
@ -228,7 +228,7 @@ contract Marketplace is Proofs, StateRetrieval {
|
|||||||
// deducted from the price.
|
// deducted from the price.
|
||||||
uint256 amount = request.price();
|
uint256 amount = request.price();
|
||||||
_marketplaceTotals.sent += amount;
|
_marketplaceTotals.sent += amount;
|
||||||
require(token.transfer(msg.sender, amount), "Withdraw failed");
|
assert(token.transfer(msg.sender, amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getActiveSlot(
|
function getActiveSlot(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user