Skip to content

Commit 022c20d

Browse files
committed
Merge branch 'dev'
# Conflicts: # README.md
2 parents 433ddec + 7cb6475 commit 022c20d

File tree

5 files changed

+79
-37
lines changed

5 files changed

+79
-37
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ project build.gradle
2424
```groovy
2525
2626
ext {
27-
minterBlockchainSDK = "0.1.4"
27+
minterBlockchainSDK = "0.2.0"
2828
}
2929
3030
dependencies {
@@ -44,7 +44,7 @@ Use our nodes
4444
MinterBlockChainApi.initialize();
4545
```
4646

47-
Or you can pass you own
47+
Or it's HIGHLY RECOMMENDED to use you own node instead of Minter's.
4848
```java
4949
MinterBlockChainApi.initialize("https://your-node.local");
5050
```

RELEASE.md

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

3+
## 0.2.0
4+
- BREAKING CHANGES:
5+
- refactored blockchain api result codes, now they are is valid and representative
6+
- removed android support dependencies, replaced with guava (proguard included)
7+
38
## 0.1.4
49
- https base minter node url
510

build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ buildscript {
3131
mavenLocal()
3232
}
3333
dependencies {
34-
classpath 'com.android.tools.build:gradle:3.2.0-rc03'
34+
classpath 'com.android.tools.build:gradle:3.2.0'
3535
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
3636
}
3737
}
@@ -58,7 +58,7 @@ apply plugin: 'com.jfrog.bintray'
5858

5959

6060
group = 'network.minter.android'
61-
version = '0.1.4'
61+
version = '0.2.0'
6262

6363
ext {
6464
minterMinSdk = 16
@@ -84,7 +84,7 @@ android {
8484
minSdkVersion minterMinSdk
8585
targetSdkVersion minterMaxSdk
8686

87-
versionCode 2
87+
versionCode 3
8888
versionName version
8989

9090
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -154,7 +154,7 @@ dependencies {
154154
netMainImplementation "network.minter.android:minter-android-core:${minterCoreVers}"
155155

156156

157-
implementation 'com.android.support:support-core-utils:27.1.1'
157+
// implementation 'com.android.support:support-core-utils:28.0.0'
158158
// network
159159
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
160160
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
@@ -166,6 +166,7 @@ dependencies {
166166

167167
// stuff
168168
implementation 'com.jakewharton.timber:timber:4.6.1'
169+
implementation 'com.google.guava:guava:26.0-android'
169170

170171
// testing
171172
testImplementation 'junit:junit:4.12'

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

Lines changed: 63 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
/**
3232
* minter-android-blockchain. 2018
33-
*
3433
* @author Eduard Maximovich <edward.vstock@gmail.com>
3534
*/
3635
public class BCResult<Result> {
@@ -42,32 +41,69 @@ public class BCResult<Result> {
4241
public String message;
4342

4443
public enum ResultCode {
45-
Unknown(-1),
46-
EmptyResponse(1000),
47-
@SerializedName("0") Success(0),
48-
@SerializedName("1") DecodeError(1),
49-
@SerializedName("107") InsufficientFundsB(107),
50-
@Deprecated
51-
@SerializedName("2") InsufficientFunds(2),
52-
@Deprecated
53-
@SerializedName("3") UnknownTransactionType(3),
54-
@Deprecated
55-
@SerializedName("4") WrongNonce(4),
56-
@Deprecated
57-
@SerializedName("5") CoinNotExists(5),
58-
@Deprecated
59-
@SerializedName("6") CoinAlreadyExists(6),
60-
@SerializedName("301") CoinDoesNotExists(301),
61-
@Deprecated
62-
@SerializedName("7") WrongCrr(7),
63-
@Deprecated
64-
@SerializedName("8") CrossConvert(8),
65-
@Deprecated
66-
@SerializedName("9") CandidateExists(9),
67-
@Deprecated
68-
@SerializedName("10") WrongCommission(10),
69-
@Deprecated
70-
@SerializedName("11") CandidateNotFound(11);
44+
// general
45+
@SerializedName("0")
46+
Success(0),
47+
@SerializedName("101")
48+
WrongNonce(101),
49+
@SerializedName("102")
50+
CoinNotExists(102),
51+
@SerializedName("103")
52+
CoinReserveNotSufficient(103),
53+
@SerializedName("105")
54+
TxTooLarge(105),
55+
@SerializedName("106")
56+
DecodeError(106),
57+
@SerializedName("107")
58+
InsufficientFunds(107),
59+
@SerializedName("109")
60+
TxPayloadTooLarge(109),
61+
@SerializedName("110")
62+
TxServiceDataTooLarge(110),
63+
64+
// coin creation
65+
@SerializedName("201")
66+
CoinAlreadyExists(201),
67+
@SerializedName("202")
68+
WrongCrr(202),
69+
@SerializedName("203")
70+
InvalidCoinSymbol(203),
71+
@SerializedName("204")
72+
InvalidCoinName(204),
73+
74+
// convert
75+
@SerializedName("301")
76+
CrossConvert(301),
77+
78+
// candidate
79+
@SerializedName("401")
80+
CandidateExists(401),
81+
@SerializedName("402")
82+
WrongCommission(402),
83+
@SerializedName("403")
84+
CandidateNotFound(403),
85+
@SerializedName("404")
86+
StakeNotFound(404),
87+
@SerializedName("405")
88+
InsufficientStake(405),
89+
@SerializedName("406")
90+
IsNotOwnerOfCandidate(406),
91+
@SerializedName("407")
92+
IncorrectPubKey(407),
93+
@SerializedName("408")
94+
StakeShouldBePositive(408),
95+
96+
// check
97+
@SerializedName("501")
98+
CheckInvalidLock(501),
99+
@SerializedName("502")
100+
CheckExpired(502),
101+
@SerializedName("503")
102+
CheckUsed(503),
103+
@SerializedName("504")
104+
TooHighGasPrice(504),
105+
@SerializedName("505")
106+
WrongGasCoin(505);
71107

72108
final int resVal;
73109

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
package network.minter.blockchain.models;
2828

29-
import android.support.v4.util.ObjectsCompat;
29+
import com.google.common.base.Objects;
3030

3131
import org.parceler.Parcel;
3232

@@ -79,16 +79,16 @@ public BigDecimal getBalance() {
7979

8080
@Override
8181
public int hashCode() {
82-
return ObjectsCompat.hash(coin, balance);
82+
return Objects.hashCode(coin, balance);
8383
}
8484

8585
@Override
8686
public boolean equals(Object o) {
8787
if (this == o) return true;
8888
if (o == null || getClass() != o.getClass()) return false;
8989
CoinBalance balance1 = (CoinBalance) o;
90-
return ObjectsCompat.equals(coin, balance1.coin) &&
91-
ObjectsCompat.equals(balance, balance1.balance);
90+
return Objects.equal(coin, balance1.coin) &&
91+
Objects.equal(balance, balance1.balance);
9292
}
9393
}
9494

0 commit comments

Comments
 (0)