Skip to content

Commit

Permalink
fix methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dalaocu committed Nov 12, 2021
1 parent 4d09f11 commit 6081b6f
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ public TransactionResponse sendTransactionAndGetResponse(
throws TransactionBaseException, ABICodecException {
String signedData;
if (cryptoKeyPair == null) {
signedData = createSignedTransaction(to, data, cryptoKeyPair);
} else {
signedData = createSignedTransaction(to, data, this.cryptoKeyPair);
} else {
signedData = createSignedTransaction(to, data, cryptoKeyPair);
}
TransactionReceipt receipt = this.transactionPusher.push(signedData);
try {
Expand Down Expand Up @@ -282,8 +282,19 @@ public TransactionResponse sendTransactionAndGetResponse(
public TransactionResponse sendTransactionWithStringParamsAndGetResponse(
String to, String abi, String functionName, List<String> params)
throws ABICodecException, TransactionBaseException {
return sendTransactionWithStringParamsAndGetResponse(
to, abi, functionName, params, this.cryptoKeyPair);
}

public TransactionResponse sendTransactionWithStringParamsAndGetResponse(
String to,
String abi,
String functionName,
List<String> params,
CryptoKeyPair cryptoKeyPair)
throws ABICodecException, TransactionBaseException {
String data = abiCodec.encodeMethodFromString(abi, functionName, params);
return sendTransactionAndGetResponse(to, abi, functionName, data);
return sendTransactionAndGetResponse(to, abi, functionName, data, cryptoKeyPair);
}

@Override
Expand Down Expand Up @@ -314,11 +325,8 @@ public TransactionResponse sendTransactionAndGetResponseByContractLoader(
String functionName,
List<Object> funcParams)
throws ABICodecException, TransactionBaseException {
return sendTransactionAndGetResponse(
contractAddress,
contractLoader.getABIByContractName(contractName),
functionName,
funcParams);
return sendTransactionAndGetResponseByContractLoader(
contractName, contractAddress, functionName, funcParams, this.cryptoKeyPair);
}

public TransactionResponse sendTransactionAndGetResponseByContractLoader(
Expand Down

0 comments on commit 6081b6f

Please sign in to comment.