Skip to content

Commit 5e70d26

Browse files
committed
error handling on uninitialized api, renamed stake to value
1 parent e83b1ac commit 5e70d26

File tree

6 files changed

+25
-10
lines changed

6 files changed

+25
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ project build.gradle
2424
```groovy
2525
2626
ext {
27-
minterBlockchainSDK = "0.5.5"
27+
minterBlockchainSDK = "0.5.6"
2828
}
2929
3030
dependencies {

RELEASE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release notes
22

3+
## 0.5.6
4+
- Changed `stake` to `value` in delegate/unbound transactions
5+
36
## 0.5.5
47
- Fixed sending transaction: now blockchain requires 0x before transaction sign
58

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ apply plugin: 'com.jfrog.bintray'
5858

5959

6060
group = 'network.minter.android'
61-
version = '0.5.5'
61+
version = '0.5.6'
6262

6363
ext {
6464
minterMinSdk = 16

src/main/java/network/minter/blockchain/MinterBlockChainApi.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ public static void initialize(String baseNodeApiUrl) {
128128
}
129129

130130
public static MinterBlockChainApi getInstance() {
131+
if (INSTANCE == null) {
132+
throw new IllegalStateException("You forget to call MinterBlockchainApi.initialize");
133+
}
131134
return INSTANCE;
132135
}
133136

src/main/java/network/minter/blockchain/models/HistoryTransaction.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) by MinterTeam. 2018
2+
* Copyright (C) by MinterTeam. 2019
33
* @link <a href="https://github.com/MinterTeam">Org Github</a>
44
* @link <a href="https://github.com/edwardstock">Maintainer Github</a>
55
*
@@ -301,18 +301,27 @@ public static class TxDelegateUnbondResult extends TxBaseResult {
301301
@SerializedName("pub_key")
302302
public MinterPublicKey publicKey;
303303
public String coin;
304-
public String stake;
304+
public String value;
305305

306306
public MinterPublicKey getPublicKey() {
307307
return publicKey;
308308
}
309309

310-
public BigDecimal getStake() {
311-
if (stake == null || stake.isEmpty()) {
312-
stake = "0";
310+
public BigDecimal getValue() {
311+
if (value == null || value.isEmpty()) {
312+
value = "0";
313313
}
314314

315-
return new BigDecimal(stake);
315+
return new BigDecimal(value);
316+
}
317+
318+
/**
319+
* @return
320+
* @deprecated use {@link #getValue()}
321+
*/
322+
@Deprecated
323+
public BigDecimal getStake() {
324+
return getValue();
316325
}
317326

318327
public String getCoin() {

src/main/java/network/minter/blockchain/models/operational/TxDeclareCandidacy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public TxDeclareCandidacy setCoin(String coinName) {
156156
}
157157

158158
/**
159-
* Get normalized stake
159+
* Get normalized value
160160
*
161161
* @return big decimal value
162162
*/
@@ -170,7 +170,7 @@ public TxDeclareCandidacy setStake(String stakeBigInteger) {
170170
}
171171

172172
/**
173-
* Get normalized stake in double value
173+
* Get normalized value in double value
174174
* Be carefully! Value can be overflowed
175175
*
176176
* @return normalized double value

0 commit comments

Comments
 (0)