Skip to content

Commit

Permalink
Fix order of parameters passed to priv_call method (hyperledger-web3j…
Browse files Browse the repository at this point in the history
  • Loading branch information
magooster authored Apr 14, 2020
1 parent c594443 commit bdf146e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions besu/src/main/java/org/web3j/protocol/besu/Besu.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Request<?, EthGetCode> privGetCode(
String privacyGroupId, String address, DefaultBlockParameter defaultBlockParameter);

Request<?, org.web3j.protocol.core.methods.response.EthCall> privCall(
String privacyGroupId,
org.web3j.protocol.core.methods.request.Transaction transaction,
DefaultBlockParameter defaultBlockParameter,
String privacyGroupId);
DefaultBlockParameter defaultBlockParameter);
}
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ public Request<?, EthGetCode> privGetCode(

@Override
public Request<?, EthCall> privCall(
String privacyGroupId,
final Transaction transaction,
final DefaultBlockParameter defaultBlockParameter,
String privacyGroupId) {
final DefaultBlockParameter defaultBlockParameter) {
return new Request<>(
"priv_call",
Arrays.asList(transaction, defaultBlockParameter, privacyGroupId),
Arrays.asList(privacyGroupId, transaction, defaultBlockParameter),
web3jService,
org.web3j.protocol.core.methods.response.EthCall.class);
}
Expand Down
8 changes: 4 additions & 4 deletions besu/src/test/java/org/web3j/protocol/besu/RequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,18 @@ public void testPrivGetCode() throws Exception {
@Test
public void testEthCall() throws Exception {
web3j.privCall(
MOCK_PRIVACY_GROUP_ID.toString(),
Transaction.createEthCallTransaction(
"0xa70e8dd61c5d32be8058bb8eb970870f07233155",
"0xb60e8dd61c5d32be8058bb8eb970870f07233155",
"0x0"),
DefaultBlockParameter.valueOf("latest"),
MOCK_PRIVACY_GROUP_ID.toString())
DefaultBlockParameter.valueOf("latest"))
.send();

verifyResult(
"{\"jsonrpc\":\"2.0\",\"method\":\"priv_call\","
+ "\"params\":[{\"from\":\"0xa70e8dd61c5d32be8058bb8eb970870f07233155\","
+ "\"params\":[\"DyAOiF/ynpc+JXa2YAGB0bCitSlOMNm+ShmB/7M6C4w=\",{\"from\":\"0xa70e8dd61c5d32be8058bb8eb970870f07233155\","
+ "\"to\":\"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"data\":\"0x0\"},"
+ "\"latest\",\"DyAOiF/ynpc+JXa2YAGB0bCitSlOMNm+ShmB/7M6C4w=\"],\"id\":1}");
+ "\"latest\"],\"id\":1}");
}
}

0 comments on commit bdf146e

Please sign in to comment.