mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-01-27 06:45:53 +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;
|
||||
_marketplaceTotals.sent += amount;
|
||||
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.
|
||||
@ -228,7 +228,7 @@ contract Marketplace is Proofs, StateRetrieval {
|
||||
// deducted from the price.
|
||||
uint256 amount = request.price();
|
||||
_marketplaceTotals.sent += amount;
|
||||
require(token.transfer(msg.sender, amount), "Withdraw failed");
|
||||
assert(token.transfer(msg.sender, amount));
|
||||
}
|
||||
|
||||
function getActiveSlot(
|
||||
|
Loading…
x
Reference in New Issue
Block a user