Skip to content

Commit 56504d8

Browse files
wenlinleekyonRay
andauthored
tx gasprice for auth mode (#883)
* tx_gas_price for auth mode * update --------- Co-authored-by: Kyon <32325790+kyonRay@users.noreply.github.com>
1 parent 56aac84 commit 56504d8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/org/fisco/bcos/sdk/v3/client/ClientImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ public SystemConfig getSystemConfigByKey(String key) {
987987
String gasPrice =
988988
this.getSystemConfigByKey(nodeToSendRequest, key).getSystemConfig().getValue();
989989
BigInteger gasPriceValue =
990-
BigInteger.valueOf(Integer.parseInt(Hex.trimPrefix(gasPrice), 16));
990+
BigInteger.valueOf(Integer.parseInt(Hex.trimPrefix(gasPrice), 10));
991991
this.getSystemConfigByKey(nodeToSendRequest, key)
992992
.getSystemConfig()
993993
.setValue(gasPriceValue.toString());

src/main/java/org/fisco/bcos/sdk/v3/contract/auth/manager/AuthManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.fisco.bcos.sdk.v3.transaction.codec.decode.ReceiptParser;
3535
import org.fisco.bcos.sdk.v3.transaction.codec.decode.RevertMessageParser;
3636
import org.fisco.bcos.sdk.v3.transaction.model.exception.ContractException;
37+
import org.fisco.bcos.sdk.v3.utils.Numeric;
3738

3839
public class AuthManager {
3940

@@ -372,6 +373,10 @@ public BigInteger createSetSysConfigProposal(String key, String value)
372373
+ nodeVersionString
373374
+ ")");
374375
}
376+
if (key.equals(SystemConfigService.TX_GAS_PRICE)) {
377+
BigInteger gasPrice = new BigInteger(value);
378+
value = Numeric.toHexString(gasPrice);
379+
}
375380
TransactionReceipt tr =
376381
committeeManager.createSetSysConfigProposal(
377382
key, value, DEFAULT_BLOCK_NUMBER_INTERVAL);

0 commit comments

Comments
 (0)