nikosgram/gringotts

Deposited amount not handled correctly on INSUFFICIENT_SPACE

Opened this issue · 0 comments

This line seems to be incorrect, since amount is simply set to 0, but some funds may have been deposited:

case INSUFFICIENT_SPACE:
return new EconomyResponse(0, account.balance(), ResponseType.FAILURE, LANG
.plugin_vault_insufficientSpace);

I would submit a PR, but what is the correct Vault approach here?
Should amount be the actual deposited amount, or the remaining amount (which could not be deposited)?
Also is ResponseType.FAILURE correct in this case?

The vault documentation is not really helpful here:
http://milkbowl.github.io/VaultAPI/net/milkbowl/vault/economy/EconomyResponse.html#amount
http://milkbowl.github.io/VaultAPI/net/milkbowl/vault/economy/EconomyResponse.html#type