Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of parameters passed to priv_call method #1185

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}");
}
}