tidy up comments
This commit is contained in:
		
							parent
							
								
									448ed1a86f
								
							
						
					
					
						commit
						2768f369bb
					
				@ -26,15 +26,9 @@ public class ChatContract implements Contract {
 | 
				
			|||||||
    public static class Create implements Command { }
 | 
					    public static class Create implements Command { }
 | 
				
			||||||
    public static class Update 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
 | 
					    @Override
 | 
				
			||||||
    public void verify(UtxoLedgerTransaction transaction) {
 | 
					    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.");
 | 
					        requireThat( transaction.getCommands().size() == 1, "Require a single command.");
 | 
				
			||||||
        Command command = transaction.getCommands().get(0);
 | 
					        Command command = transaction.getCommands().get(0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -11,9 +11,6 @@ import org.jetbrains.annotations.NotNull;
 | 
				
			|||||||
import java.security.PublicKey;
 | 
					import java.security.PublicKey;
 | 
				
			||||||
import java.util.*;
 | 
					import java.util.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// todo: Clear out commented code
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//@CordaSerializable
 | 
					 | 
				
			||||||
@BelongsToContract(ChatContract.class)
 | 
					@BelongsToContract(ChatContract.class)
 | 
				
			||||||
public class ChatState implements ContractState {
 | 
					public class ChatState implements ContractState {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -23,9 +20,6 @@ public class ChatState implements ContractState {
 | 
				
			|||||||
    private String message;
 | 
					    private String message;
 | 
				
			||||||
    public List<PublicKey> participants;
 | 
					    public List<PublicKey> participants;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//    public ChatState() {        // todo why do we need this?
 | 
					 | 
				
			||||||
//    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Allows serialisation and to use a specified UUID.
 | 
					    // Allows serialisation and to use a specified UUID.
 | 
				
			||||||
    @ConstructorForDeserialization
 | 
					    @ConstructorForDeserialization
 | 
				
			||||||
    public ChatState(UUID id,
 | 
					    public ChatState(UUID id,
 | 
				
			||||||
@ -40,18 +34,6 @@ public class ChatState implements ContractState {
 | 
				
			|||||||
        this.participants = participants;
 | 
					        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() {
 | 
					    public UUID getId() {
 | 
				
			||||||
        return id;
 | 
					        return id;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -64,26 +46,12 @@ public class ChatState implements ContractState {
 | 
				
			|||||||
    public String getMessage() {
 | 
					    public String getMessage() {
 | 
				
			||||||
        return message;
 | 
					        return message;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
//    @NotNull
 | 
					
 | 
				
			||||||
//    @Override
 | 
					 | 
				
			||||||
    public List<PublicKey> getParticipants() {
 | 
					    public List<PublicKey> getParticipants() {
 | 
				
			||||||
        return participants;
 | 
					        return participants;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public ChatState updateMessage(MemberX500Name name, String message) {
 | 
					    public ChatState updateMessage(MemberX500Name name, String message) {
 | 
				
			||||||
        return new ChatState(id, chatName, name, message, participants);
 | 
					        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 +
 | 
					 | 
				
			||||||
//                ")";
 | 
					 | 
				
			||||||
//    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user