Skip to content

Commit

Permalink
fixed removeparticipant smart contract method
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 09e51ef commit c6f7c48
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.tuweni.bytes.Bytes;
import org.web3j.abi.FunctionEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.Utils;
import org.web3j.abi.datatypes.Bool;
import org.web3j.abi.datatypes.DynamicArray;
import org.web3j.abi.datatypes.DynamicBytes;
import org.web3j.abi.datatypes.Function;
Expand Down Expand Up @@ -235,7 +237,13 @@ public String privxRemoveFromPrivacyGroup(
}

private Bytes encodeRemoveFromGroupFunctionCall(final Bytes toRemove) {
return Bytes.concatenate(FlexibleGroupManagement.REMOVE_PARTICIPANT_METHOD_SIGNATURE, toRemove);
final Function function =
new Function(
"removeParticipant",
Arrays.asList(new DynamicBytes(toRemove.toArrayUnsafe())),
Arrays.asList(new TypeReference<Bool>() {}));

return Bytes.fromHexString(FunctionEncoder.encode(function));
}

public String privxLockPrivacyGroup(
Expand Down
Loading

0 comments on commit c6f7c48

Please sign in to comment.