Skip to content

Commit 81a3f0e

Browse files
committed
rm assembleTransactionProcessor predicate null of cryptoKeyPair
1 parent 6081b6f commit 81a3f0e

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessor.java

+1-10
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,7 @@ public TransactionResponse sendTransactionAndGetResponse(
244244
public TransactionResponse sendTransactionAndGetResponse(
245245
String to, String abi, String functionName, String data, CryptoKeyPair cryptoKeyPair)
246246
throws TransactionBaseException, ABICodecException {
247-
String signedData;
248-
if (cryptoKeyPair == null) {
249-
signedData = createSignedTransaction(to, data, this.cryptoKeyPair);
250-
} else {
251-
signedData = createSignedTransaction(to, data, cryptoKeyPair);
252-
}
247+
String signedData = createSignedTransaction(to, data, cryptoKeyPair);
253248
TransactionReceipt receipt = this.transactionPusher.push(signedData);
254249
try {
255250
return transactionDecoder.decodeReceiptWithValues(abi, functionName, receipt);
@@ -468,10 +463,6 @@ public String createSignedConstructor(String abi, String bin, List<Object> param
468463
public String createSignedConstructor(
469464
String abi, String bin, List<Object> params, CryptoKeyPair cryptoKeyPair)
470465
throws ABICodecException {
471-
if (cryptoKeyPair == null) {
472-
return createSignedTransaction(
473-
null, abiCodec.encodeConstructor(abi, bin, params), this.cryptoKeyPair);
474-
}
475466
return createSignedTransaction(
476467
null, abiCodec.encodeConstructor(abi, bin, params), cryptoKeyPair);
477468
}

sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ public void sendTransactionAsync(
8686
if (cryptoKeyPair == null) {
8787
client.sendRawTransactionAndGetReceiptAsync(
8888
createSignedTransaction(to, data, this.cryptoKeyPair), callback);
89+
} else {
90+
client.sendRawTransactionAndGetReceiptAsync(
91+
createSignedTransaction(to, data, cryptoKeyPair), callback);
8992
}
90-
client.sendRawTransactionAndGetReceiptAsync(
91-
createSignedTransaction(to, data, cryptoKeyPair), callback);
9293
}
9394

9495
@Override

0 commit comments

Comments
 (0)