🐛 Fix bugs
This commit is contained in:
		@@ -187,15 +187,11 @@ class SnCommand(
 | 
			
		||||
 | 
			
		||||
                try {
 | 
			
		||||
                    val transactionSrv = SnBalanceService(sn);
 | 
			
		||||
                    val transaction = transactionSrv.addBalance(amount, "Withdraw from GoatCraft", accountId);
 | 
			
		||||
                   transactionSrv.addBalance(amount, "Withdraw from GoatCraft", accountId);
 | 
			
		||||
                    val transactionHintComponent =
 | 
			
		||||
                        TextComponent(
 | 
			
		||||
                            ChatColor.GREEN.toString() + (messages["command_withdraw_done"]
 | 
			
		||||
                                ?: "Done! transaction number ") + ChatColor.WHITE + ChatColor.BOLD + "#${
 | 
			
		||||
                                transaction.id.take(
 | 
			
		||||
                                    6
 | 
			
		||||
                                )
 | 
			
		||||
                            }"
 | 
			
		||||
                                ?: "Done! ")
 | 
			
		||||
                        )
 | 
			
		||||
 | 
			
		||||
                    p0.playSound(p0.player!!, Sound.BLOCK_ANVIL_PLACE, 1.0F, 1.0F)
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,7 @@ class SnBalanceService(private val sn: SnService) {
 | 
			
		||||
        ignoreUnknownKeys = true
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fun addBalance(amount: Double, remark: String, accountID: String): SnTransaction {
 | 
			
		||||
    fun addBalance(amount: Double, remark: String, accountID: String) {
 | 
			
		||||
        val body = SnTransactionRequest(
 | 
			
		||||
            amount = amount,
 | 
			
		||||
            remark = remark,
 | 
			
		||||
@@ -65,10 +65,6 @@ class SnBalanceService(private val sn: SnService) {
 | 
			
		||||
 | 
			
		||||
        sn.client.newCall(request).execute().use { response ->
 | 
			
		||||
            if (!response.isSuccessful) throw IOException("Unexpected code $response")
 | 
			
		||||
            val responseBody = response.body!!.string()
 | 
			
		||||
            val out = json.decodeFromString<SnTransaction>(responseBody)
 | 
			
		||||
 | 
			
		||||
            return out
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user