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

Changes variable order for priv_getCode #1163

Merged
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
Changes variable order for priv_getCode
  • Loading branch information
josh-richardson committed Feb 21, 2020
commit 90bfa9695b2120eb17dd03873556b8b21ba56957
2 changes: 1 addition & 1 deletion besu/src/main/java/org/web3j/protocol/besu/Besu.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Request<?, PrivCreatePrivacyGroup> privCreatePrivacyGroup(
Request<?, PrivGetTransactionReceipt> privGetTransactionReceipt(final String transactionHash);

Request<?, EthGetCode> privGetCode(
String address, DefaultBlockParameter defaultBlockParameter, String privacyGroupId);
String privacyGroupId, String address, DefaultBlockParameter defaultBlockParameter);

Request<?, org.web3j.protocol.core.methods.response.EthCall> privCall(
org.web3j.protocol.core.methods.request.Transaction transaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ public Request<?, PrivGetTransactionReceipt> privGetTransactionReceipt(

@Override
public Request<?, EthGetCode> privGetCode(
final String privacyGroupId,
final String address,
final DefaultBlockParameter defaultBlockParameter,
final String privacyGroupId) {
final DefaultBlockParameter defaultBlockParameter) {
ArrayList<String> result =
new ArrayList<>(Arrays.asList(address, defaultBlockParameter.getValue()));
if (privacyGroupId != null) result.add(privacyGroupId);
new ArrayList<>(
Arrays.asList(privacyGroupId, address, defaultBlockParameter.getValue()));
return new Request<>("priv_getCode", result, web3jService, EthGetCode.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public EthGetCode getCode(
throws IOException {
return this.besu
.privGetCode(
contractAddress, defaultBlockParameter, this.getPrivacyGroupId().toString())
this.getPrivacyGroupId().toString(), contractAddress, defaultBlockParameter)
.send();
}
}
6 changes: 3 additions & 3 deletions besu/src/test/java/org/web3j/protocol/besu/RequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ public void testPrivGetTransactionReceipt() throws Exception {
@Test
public void testPrivGetCode() throws Exception {
web3j.privGetCode(
MOCK_PRIVACY_GROUP_ID.toString(),
"A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=",
DefaultBlockParameterName.LATEST,
MOCK_PRIVACY_GROUP_ID.toString())
DefaultBlockParameterName.LATEST)
.send();

verifyResult(
"{\"jsonrpc\":\"2.0\",\"method\":\"priv_getCode\","
+ "\"params\":[\"A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=\",\"latest\",\"DyAOiF/ynpc+JXa2YAGB0bCitSlOMNm+ShmB/7M6C4w=\"],\"id\":1}");
+ "\"params\":[\"DyAOiF/ynpc+JXa2YAGB0bCitSlOMNm+ShmB/7M6C4w=\",\"A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo=\",\"latest\"],\"id\":1}");
}

@Test
Expand Down