Skip to content

Commit 452fe17

Browse files
committed
Merge branch 'dev'
2 parents 5291320 + 462cc34 commit 452fe17

File tree

9 files changed

+42
-13
lines changed

9 files changed

+42
-13
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.4"
27+
minterBlockchainSDK = "0.5.6"
2828
}
2929
3030
dependencies {

RELEASE.md

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

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+
39
## 0.5.4
410
- Removed `transactionCount` method and moved this info to balance model `Balance.txCount`
511

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.4'
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/TransactionSign.java

Lines changed: 6 additions & 2 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
*
@@ -35,7 +35,7 @@
3535
*/
3636
@Parcel
3737
public final class TransactionSign {
38-
private String mSign;
38+
String mSign;
3939

4040
public TransactionSign(String sign) {
4141
mSign = sign;
@@ -48,5 +48,9 @@ public String getTxSign() {
4848
return mSign;
4949
}
5050

51+
public final void clear() {
52+
mSign = null;
53+
}
54+
5155

5256
}

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

src/main/java/network/minter/blockchain/repo/BlockChainAccountRepository.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ public Call<BCResult<Balance>> getBalance(@Nonnull String address) {
8282
* @see TransactionSendResult
8383
*/
8484
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);
8692
}
8793

8894
@Nonnull

src/test/java/network/minter/blockchain/repos/TransactionsRepositoryTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
/**
4646
* minter-android-blockchain. 2019
47+
*
4748
* @author Eduard Maximovich [edward.vstock@gmail.com]
4849
*/
4950
public class TransactionsRepositoryTest {

0 commit comments

Comments
 (0)