tidy up comments

This commit is contained in:
mattbradburyr3 2023-02-07 17:52:34 +00:00
parent 448ed1a86f
commit 2768f369bb
2 changed files with 1 additions and 39 deletions

View File

@ -26,15 +26,9 @@ public class ChatContract implements Contract {
public static class Create implements Command { }
public static class Update implements Command { }
// @Override
// public boolean isRelevant(@NotNull ContractState state, @NotNull Set<? extends PublicKey> myKeys) {
// return Contract.super.isRelevant(state, myKeys);
// }
@Override
public void verify(UtxoLedgerTransaction transaction) {
// Command command = requireNonNull( transaction.getCommands().get(0), "Require a single command"); // this doesn't ensure there is one command
requireThat( transaction.getCommands().size() == 1, "Require a single command.");
Command command = transaction.getCommands().get(0);

View File

@ -11,9 +11,6 @@ import org.jetbrains.annotations.NotNull;
import java.security.PublicKey;
import java.util.*;
// todo: Clear out commented code
//@CordaSerializable
@BelongsToContract(ChatContract.class)
public class ChatState implements ContractState {
@ -23,9 +20,6 @@ public class ChatState implements ContractState {
private String message;
public List<PublicKey> participants;
// public ChatState() { // todo why do we need this?
// }
// Allows serialisation and to use a specified UUID.
@ConstructorForDeserialization
public ChatState(UUID id,
@ -40,18 +34,6 @@ public class ChatState implements ContractState {
this.participants = participants;
}
// // Convenience constructor for initial ChatState objects that need a new UUID generated.
// public ChatState(String chatName,
// MemberX500Name messageFrom,
// String message,
// List<PublicKey> participants) {
// this(UUID.randomUUID(),
// chatName,
// messageFrom,
// message,
// participants);
// }
public UUID getId() {
return id;
}
@ -64,26 +46,12 @@ public class ChatState implements ContractState {
public String getMessage() {
return message;
}
// @NotNull
// @Override
public List<PublicKey> getParticipants() {
return participants;
}
public ChatState updateMessage(MemberX500Name name, String message) {
return new ChatState(id, chatName, name, message, participants);
}
//
// // todo: why is this overridden
// @Override
// public String toString() {
// return ChatState.class.getName() +
// "(id=" + id +
// ", chatName=" + chatName +
// ", messageFrom=" + messageFrom +
// ", message=" + message +
// ", participants=" + participants +
// ")";
// }
}