Deposit, withdraw and delete ignore economy failures

Abierto Apto para principiantes
#66 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

Lee Transaction.process y TransactionTest para conocer el manejo de errores y el patrón de pruebas existentes; después, localiza las implementaciones de deposit, withdraw y DeleteCommand. Comprueba cómo se gestiona cada respuesta de economy antes de que cambie el saldo del store y añade pruebas con una economy que rechace las operaciones para los tres comandos. El trabajo estará terminado cuando cada transacción rechazada deje el store sin cambios y notifique TRANSACTION_FAILED.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Problem

/shop deposit, /shop withdraw and /shop delete ignore the result of their economy calls. If the economy plugin rejects the change, the store's balance changes anyway and the player is told it worked.

Transaction.process already handles this correctly by moving the player's money first and stopping if that fails.

Reproduced with an economy that rejects every change:

  • /shop deposit 100 added 100 to the store without taking anything from the player, and reported success.
  • /shop withdraw 40 removed 40 from the store without paying the player, and reported success.

DeleteCommand has the same pattern: it clears the balance and removes the store whatever depositPlayer returns.

Scope

  • Check EconomyResponse.transactionSuccess() before changing the store, in all three commands.
  • Send TRANSACTION_FAILED when the economy rejects the change, and leave the store as it was.

Done when

  • A rejected deposit, withdrawal or delete payout changes nothing and tells the player it failed.
  • Tests cover each command with a rejecting economy, using the existing approach in TransactionTest.
Lenguaje dominante
Java
Estrellas
1
Forks
0
Merge medio
2 h 35 min
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de BrendonButler/Shops

Todos los issues de BrendonButler/Shops

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.