Skip to content

Commit 9203d88

Browse files
committed
Remove unused field
1 parent f74cf95 commit 9203d88

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

library/src/main/kotlin/one/mixin/bot/api/MixinResponse.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class MixinResponse<T>() {
2121
var prev: String? = null
2222
var next: String? = null
2323

24-
val isSuccess: Boolean
25-
get() = error == null
24+
fun isSuccess(): Boolean {
25+
return error == null
26+
}
2627
}

samples/src/main/java/jvmMain/kotlin/Sample.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private suspend fun createPin(client: HttpClient, userAesKey: String) {
9696
val response = client.userService.createPin(
9797
PinRequest(requireNotNull(encryptPin(userAesKey, DEFAULT_PIN)))
9898
)
99-
if (response.isSuccess) {
99+
if (response.isSuccess()) {
100100
println("Create pin success ${response.data?.userId}")
101101
} else {
102102
println("Create pin fail")
@@ -117,7 +117,7 @@ private suspend fun transferToUser(
117117
encryptPin(aseKey, pin, System.nanoTime())
118118
)
119119
)
120-
if (response.isSuccess) {
120+
if (response.isSuccess()) {
121121
println("Transfer success: ${response.data?.snapshotId}")
122122
} else {
123123
println("Transfer fail ${response.error}")
@@ -127,7 +127,7 @@ private suspend fun transferToUser(
127127
private suspend fun getAsset(client: HttpClient) {
128128
// Get asset
129129
val assetResponse = client.assetService.getAsset(CNB_ID)
130-
if (assetResponse.isSuccess) {
130+
if (assetResponse.isSuccess()) {
131131
println("Assets ${assetResponse.data?.symbol}: ${assetResponse.data?.balance}")
132132
} else {
133133
println("Assets fail")
@@ -152,7 +152,7 @@ private suspend fun createAddress(client: HttpClient, userAesKey: String): Strin
152152
)
153153
)
154154

155-
if (addressesResponse.isSuccess) {
155+
if (addressesResponse.isSuccess()) {
156156
println("Create address ${addressesResponse.data?.addressId}")
157157
} else {
158158
println("Assets fail")
@@ -177,7 +177,7 @@ private suspend fun withdrawalToAddress(
177177
), UUID.randomUUID().toString(), "withdrawal test"
178178
)
179179
)
180-
if (withdrawalsResponse.isSuccess) {
180+
if (withdrawalsResponse.isSuccess()) {
181181
println("Withdrawal success: ${withdrawalsResponse.data?.snapshotId}")
182182
} else {
183183
println("Withdrawal fail")

0 commit comments

Comments
 (0)