Merged in rg_codeadmin_wip (pull request )

Minor: Moved JavaCommercialPaper.java from src/main... to contracts/src/main
This commit is contained in:
Richard Green 2016-02-23 15:58:34 +00:00
commit 9b28521389

View File

@ -9,16 +9,20 @@
package contracts; package contracts;
import core.*; import core.*;
import core.TransactionForVerification.*; import core.TransactionForVerification.InOutGroup;
import core.crypto.*; import core.crypto.NullPublicKey;
import org.jetbrains.annotations.*; import core.crypto.SecureHash;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.security.PublicKey;
import java.time.Instant;
import java.util.List;
import static core.ContractsDSLKt.requireSingleCommand;
import static kotlin.collections.CollectionsKt.single;
import java.security.*;
import java.time.*;
import java.util.*;
import static core.ContractsDSLKt.*;
import static kotlin.collections.CollectionsKt.*;
/** /**
@ -226,7 +230,7 @@ public class JavaCommercialPaper implements Contract {
return new TransactionBuilder().withItems(state, new Command( new Commands.Issue(), issuance.getParty().getOwningKey())); return new TransactionBuilder().withItems(state, new Command( new Commands.Issue(), issuance.getParty().getOwningKey()));
} }
public void generateRedeem(TransactionBuilder tx, StateAndRef<State> paper, List<StateAndRef<Cash.State>> wallet) throws InsufficientBalanceException { public void generateRedeem(TransactionBuilder tx, StateAndRef<State> paper, List<StateAndRef<Cash.State>> wallet) throws InsufficientBalanceException {
new Cash().generateSpend(tx, paper.getState().getFaceValue(), paper.getState().getOwner(), wallet, null); new Cash().generateSpend(tx, paper.getState().getFaceValue(), paper.getState().getOwner(), wallet, null);
tx.addInputState(paper.getRef()); tx.addInputState(paper.getRef());
tx.addCommand(new Command( new Commands.Redeem(), paper.getState().getOwner())); tx.addCommand(new Command( new Commands.Redeem(), paper.getState().getOwner()));