x/bank SendCoins and SendRestriction #81
-
Hi, I would like to know what happens in I have written a In my |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
The coins are first deducted, and then we check the send restriction. |
Beta Was this translation helpful? Give feedback.
The coins are first deducted, and then we check the send restriction.
In the tx flow, is there is an error, then the tx is reverted.
In a module flow (that isn't in a tx, so begin/endblock call or whatever), the balances will indeed be deducted and then throw an error. This is why you need to run this in a cache context and only write it if it succeeds without an error.
If you want my opinion, I agree that we should swap those two conditions to avoid footguns.