Skip to content

Commit 8673fc7

Browse files
authored
Merge pull request #2 from bluegene1/0.3.0
Solve the problem of small value of contract transfer value
2 parents b96bbe5 + b11f1d8 commit 8673fc7

File tree

8 files changed

+15
-12
lines changed

8 files changed

+15
-12
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ allprojects {
5555
google()
5656
jcenter()
5757
maven {
58-
url "http://192.168.9.39:8081/repository/maven-public"
58+
url "https://sdk.platon.network/nexus/content/groups/public/"
5959
}
6060
}
6161
}

framework/src/main/java/com/juzhen/framework/util/NumberParserUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public static String getPrettyNumber(double value, int maxDigit) {
255255
return "0.00";
256256
}
257257

258-
if (!bigDecimalStr.contains(".")) {
258+
if (maxDigit > 0 && !bigDecimalStr.contains(".")) {
259259
return bigDecimalStr.concat(".00");
260260
}
261261

wallet/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
android:label="@string/app_name"
3232
android:roundIcon="@mipmap/ic_launcher_round"
3333
android:supportsRtl="true"
34+
android:networkSecurityConfig="@xml/network_security_config"
3435
android:theme="@style/AppTheme">
3536

3637
<activity

wallet/src/main/java/com/juzix/wallet/component/ui/view/SendIndividualTransationActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public void setTransferAmount(double amount) {
276276

277277
@Override
278278
public void setTransferAmountTextColor(boolean isBiggerThanBalance) {
279-
etWalletAmount.setTextColor(isBiggerThanBalance ? ContextCompat.getColor(this, R.color.color_ff4747) : ContextCompat.getColor(this, R.color.color_7a8092));
279+
etWalletAmount.setTextColor(isBiggerThanBalance ? ContextCompat.getColor(this, R.color.color_ff4747) : ContextCompat.getColor(this, R.color.color_ffffff));
280280
}
281281

282282
@Override

wallet/src/main/java/com/juzix/wallet/component/ui/view/SendSharedTransationActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public void setTransferAmount(double amount) {
295295

296296
@Override
297297
public void setTransferAmountTextColor(boolean isBiggerThanBalance) {
298-
etWalletAmount.setTextColor(isBiggerThanBalance ? ContextCompat.getColor(this, R.color.color_ff4747) : ContextCompat.getColor(this, R.color.color_7a8092));
298+
etWalletAmount.setTextColor(isBiggerThanBalance ? ContextCompat.getColor(this, R.color.color_ff4747) : ContextCompat.getColor(this, R.color.color_ffffff));
299299
}
300300

301301
@Override

wallet/src/main/java/com/juzix/wallet/engine/SharedWalletTransactionManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ public int createWallet(Credentials credentials, String walletName, String indiv
138138
.requiredSignNumber(requiredSignNumber)
139139
.owner(members)
140140
.avatar(SharedWalletManager.getInstance().getWalletAvatar())
141-
.linkWalletAddress(individualWalletAddress)
142141
.build();
143142

144143
SharedWalletManager.getInstance().addWallet(sharedWalletEntity);
@@ -238,7 +237,7 @@ public int submitTransaction(
238237
try {
239238
long time = System.currentTimeMillis();
240239
String data = org.spongycastle.util.encoders.Hex.toHexString(memo.getBytes(Charset.forName("UTF-8")));
241-
String value = Convert.toWei(amount, Convert.Unit.ETHER).toPlainString();
240+
String value = NumberParserUtils.getPrettyNumber(Convert.toWei(amount, Convert.Unit.ETHER).doubleValue(), 0);
242241
Multisig multisig = Multisig.load(FileUtil.getStringFromAssets(App.getContext(), BIN_NAME), sharedWalletEntity.getPrefixContractAddress(), Web3jManager.getInstance().getWeb3j(), credentials, new StaticGasProvider(gasPrice, INVOKE_GAS_LIMIT));
243242
receipt = multisig.submitTransaction(to, sharedWalletEntity.getPrefixContractAddress(), value, data, BigInteger.valueOf(data.length()), BigInteger.valueOf(time), "").send();
244243

wallet/src/main/java/com/juzix/wallet/entity/SharedWalletEntity.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ public static final class Builder {
266266
private int unread;
267267
private int progress;
268268
private boolean finished;
269-
private String linkWalletAddress;
270269

271270
public Builder() {
272271
}
@@ -336,11 +335,6 @@ public Builder finished(boolean val) {
336335
return this;
337336
}
338337

339-
public Builder linkWalletAddress(String val) {
340-
linkWalletAddress = val;
341-
return this;
342-
}
343-
344338
public SharedWalletEntity build() {
345339
return new SharedWalletEntity(this);
346340
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<debug-overrides>
4+
<trust-anchors>
5+
<!-- Trust user added CAs while debuggable only -->
6+
<certificates src="user" />
7+
</trust-anchors>
8+
</debug-overrides>
9+
</network-security-config>

0 commit comments

Comments
 (0)