File tree Expand file tree Collapse file tree 9 files changed +42
-13
lines changed
main/java/network/minter/blockchain
test/java/network/minter/blockchain/repos Expand file tree Collapse file tree 9 files changed +42
-13
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ project build.gradle
24
24
``` groovy
25
25
26
26
ext {
27
- minterBlockchainSDK = "0.5.4 "
27
+ minterBlockchainSDK = "0.5.6 "
28
28
}
29
29
30
30
dependencies {
Original file line number Diff line number Diff line change 1
1
# Release notes
2
2
3
+ ## 0.5.6
4
+ - Changed ` stake ` to ` value ` in delegate/unbound transactions
5
+
6
+ ## 0.5.5
7
+ - Fixed sending transaction: now blockchain requires 0x before transaction sign
8
+
3
9
## 0.5.4
4
10
- Removed ` transactionCount ` method and moved this info to balance model ` Balance.txCount `
5
11
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ apply plugin: 'com.jfrog.bintray'
58
58
59
59
60
60
group = ' network.minter.android'
61
- version = ' 0.5.4 '
61
+ version = ' 0.5.6 '
62
62
63
63
ext {
64
64
minterMinSdk = 16
Original file line number Diff line number Diff line change @@ -128,6 +128,9 @@ public static void initialize(String baseNodeApiUrl) {
128
128
}
129
129
130
130
public static MinterBlockChainApi getInstance () {
131
+ if (INSTANCE == null ) {
132
+ throw new IllegalStateException ("You forget to call MinterBlockchainApi.initialize" );
133
+ }
131
134
return INSTANCE ;
132
135
}
133
136
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (C) by MinterTeam. 2018
2
+ * Copyright (C) by MinterTeam. 2019
3
3
* @link <a href="https://github.com/MinterTeam">Org Github</a>
4
4
* @link <a href="https://github.com/edwardstock">Maintainer Github</a>
5
5
*
@@ -301,18 +301,27 @@ public static class TxDelegateUnbondResult extends TxBaseResult {
301
301
@ SerializedName ("pub_key" )
302
302
public MinterPublicKey publicKey ;
303
303
public String coin ;
304
- public String stake ;
304
+ public String value ;
305
305
306
306
public MinterPublicKey getPublicKey () {
307
307
return publicKey ;
308
308
}
309
309
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" ;
313
313
}
314
314
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 ();
316
325
}
317
326
318
327
public String getCoin () {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (C) by MinterTeam. 2018
2
+ * Copyright (C) by MinterTeam. 2019
3
3
* @link <a href="https://github.com/MinterTeam">Org Github</a>
4
4
* @link <a href="https://github.com/edwardstock">Maintainer Github</a>
5
5
*
35
35
*/
36
36
@ Parcel
37
37
public final class TransactionSign {
38
- private String mSign ;
38
+ String mSign ;
39
39
40
40
public TransactionSign (String sign ) {
41
41
mSign = sign ;
@@ -48,5 +48,9 @@ public String getTxSign() {
48
48
return mSign ;
49
49
}
50
50
51
+ public final void clear () {
52
+ mSign = null ;
53
+ }
54
+
51
55
52
56
}
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ public TxDeclareCandidacy setCoin(String coinName) {
156
156
}
157
157
158
158
/**
159
- * Get normalized stake
159
+ * Get normalized value
160
160
*
161
161
* @return big decimal value
162
162
*/
@@ -170,7 +170,7 @@ public TxDeclareCandidacy setStake(String stakeBigInteger) {
170
170
}
171
171
172
172
/**
173
- * Get normalized stake in double value
173
+ * Get normalized value in double value
174
174
* Be carefully! Value can be overflowed
175
175
*
176
176
* @return normalized double value
Original file line number Diff line number Diff line change @@ -82,7 +82,13 @@ public Call<BCResult<Balance>> getBalance(@Nonnull String address) {
82
82
* @see TransactionSendResult
83
83
*/
84
84
public Call <BCResult <TransactionSendResult >> sendTransaction (@ Nonnull TransactionSign transactionSign ) {
85
- return getInstantService ().sendTransaction (transactionSign .getTxSign ());
85
+ //TODO: move it to sign
86
+ String sig = transactionSign .getTxSign ();
87
+ if (!sig .startsWith ("0x" )) {
88
+ sig = "0x" + sig ;
89
+ }
90
+ transactionSign .clear ();
91
+ return getInstantService ().sendTransaction (sig );
86
92
}
87
93
88
94
@ Nonnull
Original file line number Diff line number Diff line change 44
44
45
45
/**
46
46
* minter-android-blockchain. 2019
47
+ *
47
48
* @author Eduard Maximovich [edward.vstock@gmail.com]
48
49
*/
49
50
public class TransactionsRepositoryTest {
You can’t perform that action at this time.
0 commit comments