user6124: This is about Week3/Homework1 of the third Plutus-Pioneer-Program.
Why does the grab endpoint need two slots to resolve and release the funds back to the wallet1?

This will not create a transaction


This will create the transaction



Code to the contract

user2897: This happens because 1 slot is not enough to meet the interval when using Constraints.mustValidateIn.
Check this post for more information on why that happens: Constraints.mustValidateIn in a StateMachine

6124: <p>This is about Week3/Homework1 of the third Plutus-Pioneer-Program.</p>
<p>Why does the grab endpoint need two slots to resolve and release the funds back to the wallet1?</p>
<ol>
<li><p>This will not create a transaction
<a href="https://i.stack.imgur.com/LWiDq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LWiDq.png" alt="Wait for 1 slot after the grab endpoint was called" /></a></p>
</li>
<li><p>This will create the transaction</p>
</li>
</ol>
<p><a href="https://i.stack.imgur.com/Cg0D4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cg0D4.png" alt="Wait for 2 slots after the grab endpoint was called" /></a></p>
<p><a href="https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week03/src/Week03/Homework1.hs" rel="nofollow noreferrer">Code to the contract</a></p>
 2897: <p>This happens because 1 slot is not enough to meet the interval when using <code>Constraints.mustValidateIn</code>.</p>
<p>Check this post for more information on why that happens: <a href="https://cardano.stackexchange.com/questions/3672/constraints-mustvalidatein-in-a-statemachine">Constraints.mustValidateIn in a StateMachine</a></p>
