Skip to content

x/bank SendCoins and SendRestriction #81

Discussion options

You must be logged in to vote

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.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@wr1159
Comment options

@julienrbrt
Comment options

@wr1159
Comment options

@julienrbrt
Comment options

@wr1159
Comment options

Answer selected by julienrbrt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants