Skip to content

Commit

Permalink
fixed format violations
Browse files Browse the repository at this point in the history
  • Loading branch information
fullkomnun committed Mar 30, 2020
1 parent 1c297b5 commit 07c528b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/main/java/org/web3j/quorum/tx/ClientTransactionManager.java
Expand Up @@ -24,8 +24,8 @@
import org.web3j.protocol.core.methods.response.EthSendTransaction;
import org.web3j.quorum.Quorum;
import org.web3j.quorum.methods.request.PrivateTransaction;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.ContractErrorUtil;
import org.web3j.tx.TransactionManager;

/** TransactionManager implementation for using a Quorum node to transact. */
public class ClientTransactionManager extends TransactionManager {
Expand Down Expand Up @@ -114,10 +114,11 @@ public EthSendTransaction sendTransaction(
@Override
public String sendCall(String to, String data, DefaultBlockParameter defaultBlockParameter)
throws IOException {
EthCall ethCall = quorum.ethCall(
Transaction.createEthCallTransaction(getFromAddress(), to, data),
defaultBlockParameter)
.send();
EthCall ethCall =
quorum.ethCall(
Transaction.createEthCallTransaction(getFromAddress(), to, data),
defaultBlockParameter)
.send();
ContractErrorUtil.assertCallNotReverted(ethCall);
return ethCall.getValue();
}
Expand Down
14 changes: 13 additions & 1 deletion src/main/kotlin/org/web3j/tx/ContractErrorUtil.kt
@@ -1,7 +1,19 @@
/*
* Copyright 2020 Web3 Labs Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
@file:JvmName("ContractErrorUtil")

package org.web3j.tx

import org.web3j.protocol.core.methods.response.EthCall

fun assertCallNotReverted(ethCall: EthCall) = TransactionManager.assertCallNotReverted(ethCall)
fun assertCallNotReverted(ethCall: EthCall) = TransactionManager.assertCallNotReverted(ethCall)

0 comments on commit 07c528b

Please sign in to comment.