Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Rojo <miguelangel.rojofernandez@mastercard.com>
  • Loading branch information
freemanzMrojo committed Aug 19, 2022
1 parent 1441f72 commit 606c53a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ protected String createFlexiblePrivacyGroup(
final String commitmentHash =
callGetParticipantsMethodAndReturnCommitmentHash(privacyGroupId, groupCreator, privateFrom);
final PrivateTransactionReceipt expectedReceipt =
buildExpectedAddMemberTransactionReceipt(
privacyGroupId, groupCreator, addresses.toArray(new String[] {}));
buildExpectedAddMemberTransactionReceipt(privacyGroupId, groupCreator, addresses);

for (final PrivacyNode member : members) {
member.verify(
Expand All @@ -106,7 +105,7 @@ protected String callGetParticipantsMethodAndReturnCommitmentHash(
}

protected PrivateTransactionReceipt buildExpectedAddMemberTransactionReceipt(
final String privacyGroupId, final PrivacyNode groupCreator, final String[] members) {
final String privacyGroupId, final PrivacyNode groupCreator, final List<String> members) {
return buildExpectedAddMemberTransactionReceipt(
privacyGroupId, groupCreator, groupCreator.getEnclaveKey(), members);
}
Expand All @@ -115,7 +114,7 @@ protected PrivateTransactionReceipt buildExpectedAddMemberTransactionReceipt(
final String privacyGroupId,
final PrivacyNode groupCreator,
final String privateFrom,
final String[] members) {
final List<String> members) {

final StringBuilder output = new StringBuilder();
// hex prefix
Expand All @@ -128,7 +127,7 @@ protected PrivateTransactionReceipt buildExpectedAddMemberTransactionReceipt(
new DynamicArray<>(
DynamicBytes.class,
Utils.typeMap(
Arrays.stream(members)
members.stream()
.map(Bytes::fromBase64String)
.map(Bytes::toArrayUnsafe)
.collect(Collectors.toList()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ private String createFlexiblePrivacyGroup(final MultiTenancyPrivacyGroup group)
privacyGroupId, groupCreatorNode, groupCreatorTenant);
final PrivateTransactionReceipt expectedReceipt =
buildExpectedAddMemberTransactionReceipt(
privacyGroupId, groupCreatorNode, groupCreatorTenant, members.toArray(new String[] {}));
privacyGroupId, groupCreatorNode, groupCreatorTenant, members);

for (final MultiTenancyPrivacyNode mtpn : multiTenancyPrivacyNodes) {
final PrivacyNode privacyNode = mtpn.getPrivacyNode();
Expand Down

0 comments on commit 606c53a

Please sign in to comment.