mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +00:00
Merge branch 'setup-docs-changes' of bitbucket.org:R3-CEV/r3prototyping into docs-setup
This commit is contained in:
commit
6896af25b2
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,6 +12,7 @@ tags
|
||||
|
||||
.gradle
|
||||
/build/
|
||||
/node/build/
|
||||
/contracts/build
|
||||
/contracts/isolated/build
|
||||
/core/build
|
||||
|
3
.idea/modules.xml
generated
3
.idea/modules.xml
generated
@ -11,6 +11,9 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/contracts/isolated/isolated.iml" filepath="$PROJECT_DIR$/.idea/modules/contracts/isolated/isolated.iml" group="contracts/isolated" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/contracts/isolated/isolated_main.iml" filepath="$PROJECT_DIR$/.idea/modules/contracts/isolated/isolated_main.iml" group="contracts/isolated" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/contracts/isolated/isolated_test.iml" filepath="$PROJECT_DIR$/.idea/modules/contracts/isolated/isolated_test.iml" group="contracts/isolated" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/node/node.iml" filepath="$PROJECT_DIR$/.idea/modules/node/node.iml" group="node" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/node/node_main.iml" filepath="$PROJECT_DIR$/.idea/modules/node/node_main.iml" group="node" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/node/node_test.iml" filepath="$PROJECT_DIR$/.idea/modules/node/node_test.iml" group="node" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_main.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_main.iml" group="r3prototyping" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/r3prototyping_test.iml" filepath="$PROJECT_DIR$/.idea/modules/r3prototyping_test.iml" group="r3prototyping" />
|
||||
|
2
.idea/runConfigurations/Node__seller.xml
generated
2
.idea/runConfigurations/Node__seller.xml
generated
@ -3,7 +3,7 @@
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<option name="MAIN_CLASS_NAME" value="demos.TraderDemoKt" />
|
||||
<option name="VM_PARAMETERS" value="-ea -javaagent:lib/quasar.jar -Dco.paralleluniverse.fibers.verifyInstrumentation" />
|
||||
<option name="PROGRAM_PARAMETERS" value="--dir=seller --fake-trade-with=localhost --network-address=localhost:31327 --timestamper-identity-file=buyer/identity-public --timestamper-address=localhost" />
|
||||
<option name="PROGRAM_PARAMETERS" value="--dir=seller --fake-trade-with=localhost --network-address=localhost:31340 --network-map-identity-file=buyer/identity-public --network-map-address=localhost" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
|
87
build.gradle
87
build.gradle
@ -18,6 +18,7 @@ buildscript {
|
||||
ext.artemis_version = '1.2.0'
|
||||
ext.jetty_version = '9.1.1.v20140108'
|
||||
ext.jersey_version = '2.22.2'
|
||||
ext.jolokia_version = '2.0.0-M1'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -50,73 +51,16 @@ configurations {
|
||||
// build/reports/project/dependencies/index.html for green highlighted parts of the tree.
|
||||
|
||||
dependencies {
|
||||
compile project(':contracts')
|
||||
|
||||
compile "com.google.code.findbugs:jsr305:3.0.1"
|
||||
compile "org.slf4j:slf4j-jdk14:1.7.13"
|
||||
compile project(':node')
|
||||
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||||
compile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
|
||||
compile "org.jetbrains.kotlinx:kotlinx-support-jdk8:0.1"
|
||||
|
||||
compile "com.google.guava:guava:19.0"
|
||||
|
||||
// JOpt: for command line flags.
|
||||
compile "net.sf.jopt-simple:jopt-simple:4.9"
|
||||
|
||||
// Quasar: for the bytecode rewriting for state machines.
|
||||
quasar "co.paralleluniverse:quasar-core:${quasar_version}:jdk8@jar"
|
||||
|
||||
// Artemis: for reliable p2p message queues.
|
||||
compile "org.apache.activemq:artemis-server:${artemis_version}"
|
||||
compile "org.apache.activemq:artemis-core-client:${artemis_version}"
|
||||
|
||||
// JAnsi: for drawing things to the terminal in nicely coloured ways.
|
||||
compile "org.fusesource.jansi:jansi:1.11"
|
||||
|
||||
// GraphStream: For visualisation
|
||||
compile "org.graphstream:gs-core:1.3"
|
||||
compile "org.graphstream:gs-ui:1.3"
|
||||
compile("com.intellij:forms_rt:7.0.3") {
|
||||
exclude group: "asm"
|
||||
}
|
||||
|
||||
// Force commons logging to version 1.2 to override Artemis, which pulls in 1.1.3 (ARTEMIS-424)
|
||||
compile "commons-logging:commons-logging:1.2"
|
||||
|
||||
// Web stuff: for HTTP[S] servlets
|
||||
compile "org.eclipse.jetty:jetty-servlet:${jetty_version}"
|
||||
compile "org.eclipse.jetty:jetty-webapp:${jetty_version}"
|
||||
compile "javax.servlet:javax.servlet-api:3.1.0"
|
||||
compile "org.jolokia:jolokia-agent-war:2.0.0-M1"
|
||||
compile "commons-fileupload:commons-fileupload:1.3.1"
|
||||
|
||||
// Jersey for JAX-RS implementation for use in Jetty
|
||||
compile "org.glassfish.jersey.core:jersey-server:${jersey_version}"
|
||||
compile "org.glassfish.jersey.containers:jersey-container-servlet-core:${jersey_version}"
|
||||
compile "org.glassfish.jersey.containers:jersey-container-jetty-http:${jersey_version}"
|
||||
// NOTE there is a Jackson version clash between jersey-media-json-jackson (v2.5.4) and jackson-module-kotlin (v.2.5.5)
|
||||
// Have not found an Issue in the issue tracker for Jersey for this issue
|
||||
compile ("org.glassfish.jersey.media:jersey-media-json-jackson:${jersey_version}") {
|
||||
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
|
||||
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
|
||||
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
|
||||
}
|
||||
compile ("com.fasterxml.jackson.module:jackson-module-kotlin:2.5.5-2") {
|
||||
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
|
||||
}
|
||||
compile "com.fasterxml.jackson.core:jackson-annotations:2.5.5"
|
||||
|
||||
// Coda Hale's Metrics: for monitoring of key statistics
|
||||
compile "io.dropwizard.metrics:metrics-core:3.1.2"
|
||||
|
||||
// JimFS: in memory java.nio filesystem. Used for test and simulation utilities.
|
||||
compile "com.google.jimfs:jimfs:1.1"
|
||||
|
||||
// TypeSafe Config: for simple and human friendly config files.
|
||||
compile "com.typesafe:config:1.3.0"
|
||||
|
||||
// Unit testing helpers.
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile 'org.assertj:assertj-core:3.4.1'
|
||||
@ -140,7 +84,7 @@ tasks.withType(JavaExec) {
|
||||
jvmArgs "-Dco.paralleluniverse.fibers.verifyInstrumentation"
|
||||
}
|
||||
|
||||
// Package up the other demo programs.
|
||||
// Package up the demo programs.
|
||||
task getRateFixDemo(type: CreateStartScripts) {
|
||||
mainClassName = "demos.RateFixDemoKt"
|
||||
applicationName = "get-rate-fix"
|
||||
@ -157,6 +101,26 @@ task getIRSDemo(type: CreateStartScripts) {
|
||||
classpath = jar.outputs.files + project.configurations.runtime
|
||||
}
|
||||
|
||||
task getTraderDemo(type: CreateStartScripts) {
|
||||
mainClassName = "demos.TraderDemoKt"
|
||||
applicationName = "trader-demo"
|
||||
defaultJvmOpts = ["-javaagent:${configurations.quasar.singleFile}"]
|
||||
outputDir = new File(project.buildDir, 'scripts')
|
||||
classpath = jar.outputs.files + project.configurations.runtime
|
||||
}
|
||||
|
||||
// Force windows script classpath to wildcard path to avoid the 'Command Line Is Too Long' issues
|
||||
// with generated scripts. Include Jolokia .war explicitly as this isn't picked up by wildcard
|
||||
tasks.withType(CreateStartScripts)
|
||||
{
|
||||
doLast {
|
||||
windowsScript.text = windowsScript
|
||||
.readLines()
|
||||
.collect { line -> line.replaceAll(~/^set CLASSPATH=.*$/, 'set CLASSPATH=%APP_HOME%/lib/*;%APP_HOME%/lib/jolokia-agent-war-'+project.ext.jolokia_version+'.war') }
|
||||
.join('\r\n')
|
||||
}
|
||||
}
|
||||
|
||||
// These lines tell gradle to run the Quasar suspendables scanner to look for unannotated super methods
|
||||
// that have @Suspendable sub implementations. These tend to cause NPEs and are not caught by the verifier
|
||||
// NOTE: need to make sure the output isn't on the classpath or every other run it generates empty results, so
|
||||
@ -165,7 +129,7 @@ task getIRSDemo(type: CreateStartScripts) {
|
||||
// TODO: Make this task incremental, as it can be quite slow.
|
||||
|
||||
//noinspection GroovyAssignabilityCheck
|
||||
task quasarScan(dependsOn: ['classes', 'core:classes', 'contracts:classes']) << {
|
||||
task quasarScan(dependsOn: ['classes', 'core:classes', 'contracts:classes', 'node:classes']) << {
|
||||
ant.taskdef(name:'scanSuspendables', classname:'co.paralleluniverse.fibers.instrument.SuspendablesScanner',
|
||||
classpath: "${sourceSets.main.output.classesDir}:${sourceSets.main.output.resourcesDir}:${configurations.runtime.asPath}")
|
||||
delete "$sourceSets.main.output.resourcesDir/META-INF/suspendables", "$sourceSets.main.output.resourcesDir/META-INF/suspendable-supers"
|
||||
@ -182,5 +146,6 @@ jar.dependsOn quasarScan
|
||||
applicationDistribution.into("bin") {
|
||||
from(getRateFixDemo)
|
||||
from(getIRSDemo)
|
||||
from(getTraderDemo)
|
||||
fileMode = 0755
|
||||
}
|
||||
}
|
||||
|
@ -9,9 +9,8 @@
|
||||
package contracts.isolated
|
||||
|
||||
import core.*
|
||||
import core.Contract
|
||||
import core.ContractState
|
||||
import core.TransactionForVerification
|
||||
import core.contracts.*
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
|
||||
// The dummy contract doesn't do anything useful. It exists for testing purposes.
|
||||
@ -19,7 +18,7 @@ import core.crypto.SecureHash
|
||||
val ANOTHER_DUMMY_PROGRAM_ID = AnotherDummyContract()
|
||||
|
||||
class AnotherDummyContract : Contract, core.node.DummyContractBackdoor {
|
||||
class State(val magicNumber: Int = 0) : ContractState {
|
||||
class State(val magicNumber: Int = 0, override val notary: Party) : ContractState {
|
||||
override val contract = ANOTHER_DUMMY_PROGRAM_ID
|
||||
}
|
||||
|
||||
@ -34,11 +33,11 @@ class AnotherDummyContract : Contract, core.node.DummyContractBackdoor {
|
||||
// The "empty contract"
|
||||
override val legalContractReference: SecureHash = SecureHash.sha256("https://anotherdummy.org")
|
||||
|
||||
override fun generateInitial(owner: PartyAndReference, magicNumber: Int) : TransactionBuilder {
|
||||
val state = State(magicNumber)
|
||||
return TransactionBuilder().withItems( state, Command(Commands.Create(), owner.party.owningKey) )
|
||||
override fun generateInitial(owner: PartyAndReference, magicNumber: Int, notary: Party): TransactionBuilder {
|
||||
val state = State(magicNumber, notary)
|
||||
return TransactionBuilder().withItems(state, Command(Commands.Create(), owner.party.owningKey))
|
||||
}
|
||||
|
||||
override fun inspectState(state: core.ContractState) : Int = (state as State).magicNumber
|
||||
override fun inspectState(state: ContractState): Int = (state as State).magicNumber
|
||||
|
||||
}
|
@ -1,7 +1,12 @@
|
||||
package core.node
|
||||
|
||||
interface DummyContractBackdoor {
|
||||
fun generateInitial(owner: core.PartyAndReference, magicNumber: Int) : core.TransactionBuilder
|
||||
import core.contracts.ContractState
|
||||
import core.crypto.Party
|
||||
import core.contracts.PartyAndReference
|
||||
import core.contracts.TransactionBuilder
|
||||
|
||||
fun inspectState(state: core.ContractState) : Int
|
||||
interface DummyContractBackdoor {
|
||||
fun generateInitial(owner: PartyAndReference, magicNumber: Int, notary: Party): TransactionBuilder
|
||||
|
||||
fun inspectState(state: ContractState): Int
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package contracts;
|
||||
|
||||
import core.*;
|
||||
import core.contracts.Amount;
|
||||
import core.contracts.ContractState;
|
||||
import core.contracts.PartyAndReference;
|
||||
|
||||
import java.security.*;
|
||||
import java.time.*;
|
||||
|
@ -1,17 +1,19 @@
|
||||
package contracts;
|
||||
|
||||
import core.*;
|
||||
import core.TransactionForVerification.*;
|
||||
import core.crypto.*;
|
||||
import core.node.services.*;
|
||||
import org.jetbrains.annotations.*;
|
||||
import core.contracts.TransactionForVerification.InOutGroup;
|
||||
import core.contracts.*;
|
||||
import core.crypto.NullPublicKey;
|
||||
import core.crypto.Party;
|
||||
import core.crypto.SecureHash;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.security.*;
|
||||
import java.time.*;
|
||||
import java.util.*;
|
||||
import java.security.PublicKey;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
import static core.ContractsDSLKt.*;
|
||||
import static kotlin.collections.CollectionsKt.*;
|
||||
import static core.contracts.ContractsDSLKt.requireSingleCommand;
|
||||
import static kotlin.collections.CollectionsKt.single;
|
||||
|
||||
|
||||
/**
|
||||
@ -27,35 +29,37 @@ public class JavaCommercialPaper implements Contract {
|
||||
private PublicKey owner;
|
||||
private Amount faceValue;
|
||||
private Instant maturityDate;
|
||||
private Party notary;
|
||||
|
||||
public State() {
|
||||
} // For serialization
|
||||
|
||||
public State(PartyAndReference issuance, PublicKey owner, Amount faceValue, Instant maturityDate) {
|
||||
public State(PartyAndReference issuance, PublicKey owner, Amount faceValue, Instant maturityDate, Party notary) {
|
||||
this.issuance = issuance;
|
||||
this.owner = owner;
|
||||
this.faceValue = faceValue;
|
||||
this.maturityDate = maturityDate;
|
||||
this.notary = notary;
|
||||
}
|
||||
|
||||
public State copy() {
|
||||
return new State(this.issuance, this.owner, this.faceValue, this.maturityDate);
|
||||
return new State(this.issuance, this.owner, this.faceValue, this.maturityDate, this.notary);
|
||||
}
|
||||
|
||||
public ICommercialPaperState withOwner(PublicKey newOwner) {
|
||||
return new State(this.issuance, newOwner, this.faceValue, this.maturityDate);
|
||||
return new State(this.issuance, newOwner, this.faceValue, this.maturityDate, this.notary);
|
||||
}
|
||||
|
||||
public ICommercialPaperState withIssuance(PartyAndReference newIssuance) {
|
||||
return new State(newIssuance, this.owner, this.faceValue, this.maturityDate);
|
||||
return new State(newIssuance, this.owner, this.faceValue, this.maturityDate, this.notary);
|
||||
}
|
||||
|
||||
public ICommercialPaperState withFaceValue(Amount newFaceValue) {
|
||||
return new State(this.issuance, this.owner, newFaceValue, this.maturityDate);
|
||||
return new State(this.issuance, this.owner, newFaceValue, this.maturityDate, this.notary);
|
||||
}
|
||||
|
||||
public ICommercialPaperState withMaturityDate(Instant newMaturityDate) {
|
||||
return new State(this.issuance, this.owner, this.faceValue, newMaturityDate);
|
||||
return new State(this.issuance, this.owner, this.faceValue, newMaturityDate, this.notary);
|
||||
}
|
||||
|
||||
public PartyAndReference getIssuance() {
|
||||
@ -74,6 +78,12 @@ public class JavaCommercialPaper implements Contract {
|
||||
return maturityDate;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Party getNotary() {
|
||||
return notary;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Contract getContract() {
|
||||
@ -91,8 +101,8 @@ public class JavaCommercialPaper implements Contract {
|
||||
if (issuance != null ? !issuance.equals(state.issuance) : state.issuance != null) return false;
|
||||
if (owner != null ? !owner.equals(state.owner) : state.owner != null) return false;
|
||||
if (faceValue != null ? !faceValue.equals(state.faceValue) : state.faceValue != null) return false;
|
||||
if (notary != null ? !notary.equals(state.notary) : state.notary != null) return false;
|
||||
return !(maturityDate != null ? !maturityDate.equals(state.maturityDate) : state.maturityDate != null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -101,15 +111,16 @@ public class JavaCommercialPaper implements Contract {
|
||||
result = 31 * result + (owner != null ? owner.hashCode() : 0);
|
||||
result = 31 * result + (faceValue != null ? faceValue.hashCode() : 0);
|
||||
result = 31 * result + (maturityDate != null ? maturityDate.hashCode() : 0);
|
||||
result = 31 * result + (notary != null ? notary.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public State withoutOwner() {
|
||||
return new State(issuance, NullPublicKey.INSTANCE, faceValue, maturityDate);
|
||||
return new State(issuance, NullPublicKey.INSTANCE, faceValue, maturityDate, notary);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Commands implements core.CommandData {
|
||||
public static class Commands implements CommandData {
|
||||
public static class Move extends Commands {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
@ -158,7 +169,7 @@ public class JavaCommercialPaper implements Contract {
|
||||
throw new IllegalStateException("Failed Requirement: the face value is not zero");
|
||||
}
|
||||
|
||||
TimestampCommand timestampCommand = tx.getTimestampBy(DummyTimestampingAuthority.INSTANCE.getIdentity());
|
||||
TimestampCommand timestampCommand = tx.getTimestampByName("Notary Service");
|
||||
if (timestampCommand == null)
|
||||
throw new IllegalArgumentException("Failed Requirement: must be timestamped");
|
||||
|
||||
@ -188,7 +199,7 @@ public class JavaCommercialPaper implements Contract {
|
||||
!output.getMaturityDate().equals(input.getMaturityDate()))
|
||||
throw new IllegalStateException("Failed requirement: the output state is the same as the input state except for owner");
|
||||
} else if (cmd.getValue() instanceof JavaCommercialPaper.Commands.Redeem) {
|
||||
TimestampCommand timestampCommand = tx.getTimestampBy(DummyTimestampingAuthority.INSTANCE.getIdentity());
|
||||
TimestampCommand timestampCommand = tx.getTimestampByName("Notary Service");
|
||||
if (timestampCommand == null)
|
||||
throw new IllegalArgumentException("Failed Requirement: must be timestamped");
|
||||
Instant time = timestampCommand.getBefore();
|
||||
@ -215,8 +226,8 @@ public class JavaCommercialPaper implements Contract {
|
||||
return SecureHash.sha256("https://en.wikipedia.org/wiki/Commercial_paper");
|
||||
}
|
||||
|
||||
public TransactionBuilder generateIssue(@NotNull PartyAndReference issuance, @NotNull Amount faceValue, @Nullable Instant maturityDate) {
|
||||
State state = new State(issuance, issuance.getParty().getOwningKey(), faceValue, maturityDate);
|
||||
public TransactionBuilder generateIssue(@NotNull PartyAndReference issuance, @NotNull Amount faceValue, @Nullable Instant maturityDate, @NotNull Party notary) {
|
||||
State state = new State(issuance, issuance.getParty().getOwningKey(), faceValue, maturityDate, notary);
|
||||
return new TransactionBuilder().withItems(state, new Command(new Commands.Issue(), issuance.getParty().getOwningKey()));
|
||||
}
|
||||
|
||||
@ -228,7 +239,7 @@ public class JavaCommercialPaper implements Contract {
|
||||
|
||||
public void generateMove(TransactionBuilder tx, StateAndRef<State> paper, PublicKey newOwner) {
|
||||
tx.addInputState(paper.getRef());
|
||||
tx.addOutputState(new State(paper.getState().getIssuance(), newOwner, paper.getState().getFaceValue(), paper.getState().getMaturityDate()));
|
||||
tx.addOutputState(new State(paper.getState().getIssuance(), newOwner, paper.getState().getFaceValue(), paper.getState().getMaturityDate(), paper.getState().getNotary()));
|
||||
tx.addCommand(new Command(new Commands.Move(), paper.getState().getOwner()));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,10 @@
|
||||
package contracts
|
||||
|
||||
import contracts.cash.CashIssuanceDefinition
|
||||
import contracts.cash.CommonCashState
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import core.crypto.toStringShort
|
||||
import core.utilities.Emoji
|
||||
@ -45,17 +49,29 @@ class Cash : Contract {
|
||||
*/
|
||||
override val legalContractReference: SecureHash = SecureHash.sha256("https://www.big-book-of-banking-law.gov/cash-claims.html")
|
||||
|
||||
data class IssuanceDefinition(
|
||||
/** Where the underlying currency backing this ledger entry can be found (propagated) */
|
||||
override val deposit: PartyAndReference,
|
||||
|
||||
override val currency: Currency
|
||||
) : CashIssuanceDefinition
|
||||
|
||||
/** A state representing a cash claim against some party */
|
||||
data class State(
|
||||
/** Where the underlying currency backing this ledger entry can be found (propagated) */
|
||||
val deposit: PartyAndReference,
|
||||
override val deposit: PartyAndReference,
|
||||
|
||||
val amount: Amount,
|
||||
override val amount: Amount,
|
||||
|
||||
/** There must be a MoveCommand signed by this key to claim the amount */
|
||||
override val owner: PublicKey
|
||||
) : OwnableState {
|
||||
override val owner: PublicKey,
|
||||
|
||||
override val notary: Party
|
||||
) : CommonCashState<Cash.IssuanceDefinition> {
|
||||
override val issuanceDef: Cash.IssuanceDefinition
|
||||
get() = Cash.IssuanceDefinition(deposit, amount.currency)
|
||||
override val contract = CASH_PROGRAM_ID
|
||||
|
||||
override fun toString() = "${Emoji.bagOfCash}Cash($amount at $deposit owned by ${owner.toStringShort()})"
|
||||
|
||||
override fun withNewOwner(newOwner: PublicKey) = Pair(Commands.Move(), copy(owner = newOwner))
|
||||
@ -82,11 +98,12 @@ class Cash : Contract {
|
||||
override fun verify(tx: TransactionForVerification) {
|
||||
// Each group is a set of input/output states with distinct (deposit, currency) attributes. These types
|
||||
// of cash are not fungible and must be kept separated for bookkeeping purposes.
|
||||
val groups = tx.groupStates() { it: Cash.State -> Pair(it.deposit, it.amount.currency) }
|
||||
val groups = tx.groupStates() { it: Cash.State -> it.issuanceDef }
|
||||
|
||||
for ((inputs, outputs, key) in groups) {
|
||||
// Either inputs or outputs could be empty.
|
||||
val (deposit, currency) = key
|
||||
val deposit = key.deposit
|
||||
val currency = key.currency
|
||||
val issuer = deposit.party
|
||||
|
||||
requireThat {
|
||||
@ -144,13 +161,19 @@ class Cash : Contract {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts together an issuance transaction from the given template, that starts out being owned by the given pubkey.
|
||||
*/
|
||||
fun generateIssue(tx: TransactionBuilder, issuanceDef: CashIssuanceDefinition, pennies: Long, owner: PublicKey, notary: Party)
|
||||
= generateIssue(tx, Amount(pennies, issuanceDef.currency), issuanceDef.deposit, owner, notary)
|
||||
|
||||
/**
|
||||
* Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.
|
||||
*/
|
||||
fun generateIssue(tx: TransactionBuilder, amount: Amount, at: PartyAndReference, owner: PublicKey) {
|
||||
fun generateIssue(tx: TransactionBuilder, amount: Amount, at: PartyAndReference, owner: PublicKey, notary: Party) {
|
||||
check(tx.inputStates().isEmpty())
|
||||
check(tx.outputStates().sumCashOrNull() == null)
|
||||
tx.addOutputState(Cash.State(at, amount, owner))
|
||||
tx.addOutputState(Cash.State(at, amount, owner, notary))
|
||||
tx.addCommand(Cash.Commands.Issue(), at.party.owningKey)
|
||||
}
|
||||
|
||||
@ -164,7 +187,7 @@ class Cash : Contract {
|
||||
*/
|
||||
@Throws(InsufficientBalanceException::class)
|
||||
fun generateSpend(tx: TransactionBuilder, amount: Amount, to: PublicKey,
|
||||
cashStates: List<StateAndRef<Cash.State>>, onlyFromParties: Set<Party>? = null): List<PublicKey> {
|
||||
cashStates: List<StateAndRef<State>>, onlyFromParties: Set<Party>? = null): List<PublicKey> {
|
||||
// Discussion
|
||||
//
|
||||
// This code is analogous to the Wallet.send() set of methods in bitcoinj, and has the same general outline.
|
||||
@ -194,7 +217,7 @@ class Cash : Contract {
|
||||
ofCurrency
|
||||
}
|
||||
|
||||
val gathered = arrayListOf<StateAndRef<Cash.State>>()
|
||||
val gathered = arrayListOf<StateAndRef<State>>()
|
||||
var gatheredAmount = Amount(0, currency)
|
||||
for (c in acceptableCoins) {
|
||||
if (gatheredAmount >= amount) break
|
||||
@ -211,7 +234,7 @@ class Cash : Contract {
|
||||
val states = gathered.groupBy { it.state.deposit }.map {
|
||||
val (deposit, coins) = it
|
||||
val totalAmount = coins.map { it.state.amount }.sumOrThrow()
|
||||
State(deposit, totalAmount, to)
|
||||
State(deposit, totalAmount, to, coins.first().state.notary)
|
||||
}
|
||||
|
||||
val outputs = if (change.pennies > 0) {
|
||||
@ -222,7 +245,7 @@ class Cash : Contract {
|
||||
// Add a change output and adjust the last output downwards.
|
||||
states.subList(0, states.lastIndex) +
|
||||
states.last().let { it.copy(amount = it.amount - change) } +
|
||||
State(gathered.last().state.deposit, change, changeKey)
|
||||
State(gathered.last().state.deposit, change, changeKey, gathered.last().state.notary)
|
||||
} else states
|
||||
|
||||
for (state in gathered) tx.addInputState(state.ref)
|
||||
|
@ -1,7 +1,9 @@
|
||||
package contracts
|
||||
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.NullPublicKey
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import core.crypto.toStringShort
|
||||
import core.utilities.Emoji
|
||||
@ -41,7 +43,8 @@ class CommercialPaper : Contract {
|
||||
val issuance: PartyAndReference,
|
||||
override val owner: PublicKey,
|
||||
val faceValue: Amount,
|
||||
val maturityDate: Instant
|
||||
val maturityDate: Instant,
|
||||
override val notary: Party
|
||||
) : OwnableState, ICommercialPaperState {
|
||||
override val contract = CP_PROGRAM_ID
|
||||
|
||||
@ -76,7 +79,7 @@ class CommercialPaper : Contract {
|
||||
// Here, we match acceptable timestamp authorities by name. The list of acceptable TSAs (oracles) must be
|
||||
// hard coded into the contract because otherwise we could fail to gain consensus, if nodes disagree about
|
||||
// who or what is a trusted authority.
|
||||
val timestamp: TimestampCommand? = tx.commands.getTimestampByName("Mock Company 0", "Timestamping Service", "Bank A")
|
||||
val timestamp: TimestampCommand? = tx.commands.getTimestampByName("Mock Company 0", "Notary Service", "Bank A")
|
||||
|
||||
for ((inputs, outputs, key) in groups) {
|
||||
when (command.value) {
|
||||
@ -129,8 +132,8 @@ class CommercialPaper : Contract {
|
||||
* an existing transaction because you aren't able to issue multiple pieces of CP in a single transaction
|
||||
* at the moment: this restriction is not fundamental and may be lifted later.
|
||||
*/
|
||||
fun generateIssue(issuance: PartyAndReference, faceValue: Amount, maturityDate: Instant): TransactionBuilder {
|
||||
val state = State(issuance, issuance.party.owningKey, faceValue, maturityDate)
|
||||
fun generateIssue(issuance: PartyAndReference, faceValue: Amount, maturityDate: Instant, notary: Party): TransactionBuilder {
|
||||
val state = State(issuance, issuance.party.owningKey, faceValue, maturityDate, notary)
|
||||
return TransactionBuilder().withItems(state, Command(Commands.Issue(), issuance.party.owningKey))
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
package contracts
|
||||
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import core.node.services.DummyTimestampingAuthority
|
||||
import java.security.PublicKey
|
||||
import java.time.Instant
|
||||
import java.util.*
|
||||
@ -46,6 +47,7 @@ class CrowdFund : Contract {
|
||||
|
||||
data class State(
|
||||
val campaign: Campaign,
|
||||
override val notary: Party,
|
||||
val closed: Boolean = false,
|
||||
val pledges: List<Pledge> = ArrayList()
|
||||
) : ContractState {
|
||||
@ -74,13 +76,13 @@ class CrowdFund : Contract {
|
||||
val outputCrowdFund: CrowdFund.State = tx.outStates.filterIsInstance<CrowdFund.State>().single()
|
||||
val outputCash: List<Cash.State> = tx.outStates.filterIsInstance<Cash.State>()
|
||||
|
||||
val time = tx.getTimestampBy(DummyTimestampingAuthority.identity)?.midpoint
|
||||
val time = tx.commands.getTimestampByName("Notary Service")?.midpoint
|
||||
if (time == null) throw IllegalArgumentException("must be timestamped")
|
||||
|
||||
when (command.value) {
|
||||
is Commands.Register -> {
|
||||
requireThat {
|
||||
"there is no input state" by tx.inStates.filterIsInstance<CrowdFund.State>().isEmpty()
|
||||
"there is no input state" by tx.inStates.filterIsInstance<State>().isEmpty()
|
||||
"the transaction is signed by the owner of the crowdsourcing" by (command.signers.contains(outputCrowdFund.campaign.owner))
|
||||
"the output registration is empty of pledges" by (outputCrowdFund.pledges.isEmpty())
|
||||
"the output registration has a non-zero target" by (outputCrowdFund.campaign.target.pennies > 0)
|
||||
@ -136,9 +138,9 @@ class CrowdFund : Contract {
|
||||
* Returns a transaction that registers a crowd-funding campaing, owned by the issuing institution's key. Does not update
|
||||
* an existing transaction because it's not possible to register multiple campaigns in a single transaction
|
||||
*/
|
||||
fun generateRegister(owner: PartyAndReference, fundingTarget: Amount, fundingName: String, closingTime: Instant): TransactionBuilder {
|
||||
fun generateRegister(owner: PartyAndReference, fundingTarget: Amount, fundingName: String, closingTime: Instant, notary: Party): TransactionBuilder {
|
||||
val campaign = Campaign(owner = owner.party.owningKey, name = fundingName, target = fundingTarget, closingTime = closingTime)
|
||||
val state = State(campaign)
|
||||
val state = State(campaign, notary)
|
||||
return TransactionBuilder().withItems(state, Command(Commands.Register(), owner.party.owningKey))
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package contracts
|
||||
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
|
||||
// The dummy contract doesn't do anything useful. It exists for testing purposes.
|
||||
@ -8,7 +10,8 @@ import core.crypto.SecureHash
|
||||
val DUMMY_PROGRAM_ID = DummyContract()
|
||||
|
||||
class DummyContract : Contract {
|
||||
class State(val magicNumber: Int = 0) : ContractState {
|
||||
class State(val magicNumber: Int = 0,
|
||||
override val notary: Party) : ContractState {
|
||||
override val contract = DUMMY_PROGRAM_ID
|
||||
}
|
||||
|
||||
@ -23,8 +26,8 @@ class DummyContract : Contract {
|
||||
// The "empty contract"
|
||||
override val legalContractReference: SecureHash = SecureHash.sha256("")
|
||||
|
||||
fun generateInitial(owner: PartyAndReference, magicNumber: Int) : TransactionBuilder {
|
||||
val state = State(magicNumber)
|
||||
return TransactionBuilder().withItems( state, Command(Commands.Create(), owner.party.owningKey) )
|
||||
fun generateInitial(owner: PartyAndReference, magicNumber: Int, notary: Party): TransactionBuilder {
|
||||
val state = State(magicNumber, notary)
|
||||
return TransactionBuilder().withItems(state, Command(Commands.Create(), owner.party.owningKey))
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package contracts
|
||||
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import org.apache.commons.jexl3.JexlBuilder
|
||||
import org.apache.commons.jexl3.MapContext
|
||||
@ -492,7 +494,7 @@ class InterestRateSwap() : Contract {
|
||||
val groups = tx.groupStates() { state: InterestRateSwap.State -> state.common.tradeID }
|
||||
|
||||
val command = tx.commands.requireSingleCommand<InterestRateSwap.Commands>()
|
||||
val time = tx.commands.getTimestampByName("Mock Company 0", "Timestamping Service", "Bank A")?.midpoint
|
||||
val time = tx.commands.getTimestampByName("Mock Company 0", "Notary Service", "Bank A")?.midpoint
|
||||
if (time == null) throw IllegalArgumentException("must be timestamped")
|
||||
|
||||
for ((inputs, outputs, key) in groups) {
|
||||
@ -503,8 +505,8 @@ class InterestRateSwap() : Contract {
|
||||
"There are no in states for an agreement" by inputs.isEmpty()
|
||||
"There are events in the fix schedule" by (irs.calculation.fixedLegPaymentSchedule.size > 0)
|
||||
"There are events in the float schedule" by (irs.calculation.floatingLegPaymentSchedule.size > 0)
|
||||
"All notionals must be non zero" by ( irs.fixedLeg.notional.pennies > 0 && irs.floatingLeg.notional.pennies > 0)
|
||||
"The fixed leg rate must be positive" by ( irs.fixedLeg.fixedRate.isPositive() )
|
||||
"All notionals must be non zero" by (irs.fixedLeg.notional.pennies > 0 && irs.floatingLeg.notional.pennies > 0)
|
||||
"The fixed leg rate must be positive" by (irs.fixedLeg.fixedRate.isPositive())
|
||||
"The currency of the notionals must be the same" by (irs.fixedLeg.notional.currency == irs.floatingLeg.notional.currency)
|
||||
"All leg notionals must be the same" by (irs.fixedLeg.notional == irs.floatingLeg.notional)
|
||||
|
||||
@ -539,7 +541,7 @@ class InterestRateSwap() : Contract {
|
||||
val fixValue = fixCommand.value
|
||||
// Need to check that everything is the same apart from the new fixed rate entry.
|
||||
requireThat {
|
||||
"The fixed leg parties are constant" by ( irs.fixedLeg.fixedRatePayer == prevIrs.fixedLeg.fixedRatePayer) // Although superseded by the below test, this is included for a regression issue
|
||||
"The fixed leg parties are constant" by (irs.fixedLeg.fixedRatePayer == prevIrs.fixedLeg.fixedRatePayer) // Although superseded by the below test, this is included for a regression issue
|
||||
"The fixed leg is constant" by (irs.fixedLeg == prevIrs.fixedLeg)
|
||||
"The floating leg is constant" by (irs.floatingLeg == prevIrs.floatingLeg)
|
||||
"The common values are constant" by (irs.common == prevIrs.common)
|
||||
@ -548,7 +550,7 @@ class InterestRateSwap() : Contract {
|
||||
"There is only one changed payment in the floating leg" by (paymentDifferences.size == 1)
|
||||
"There changed payment is a floating payment" by (oldFloatingRatePaymentEvent.rate is ReferenceRate)
|
||||
"The new payment is a fixed payment" by (newFixedRatePaymentEvent.rate is FixedRate)
|
||||
"The changed payments dates are aligned" by ( oldFloatingRatePaymentEvent.date == newFixedRatePaymentEvent.date)
|
||||
"The changed payments dates are aligned" by (oldFloatingRatePaymentEvent.date == newFixedRatePaymentEvent.date)
|
||||
"The new payment has the correct rate" by (newFixedRatePaymentEvent.rate.ratioUnit!!.value == fixValue.value)
|
||||
"The fixing is for the next required date" by (prevIrs.calculation.nextFixingDate() == fixValue.of.forDay)
|
||||
"The fix payment has the same currency as the notional" by (newFixedRatePaymentEvent.flow.currency == irs.floatingLeg.notional.currency)
|
||||
@ -586,7 +588,8 @@ class InterestRateSwap() : Contract {
|
||||
val fixedLeg: FixedLeg,
|
||||
val floatingLeg: FloatingLeg,
|
||||
val calculation: Calculation,
|
||||
val common: Common
|
||||
val common: Common,
|
||||
override val notary: Party
|
||||
) : FixableDealState {
|
||||
|
||||
override val contract = IRS_PROGRAM_ID
|
||||
@ -616,7 +619,7 @@ class InterestRateSwap() : Contract {
|
||||
}
|
||||
}
|
||||
|
||||
override fun generateAgreement(): TransactionBuilder = InterestRateSwap().generateAgreement(floatingLeg, fixedLeg, calculation, common)
|
||||
override fun generateAgreement(): TransactionBuilder = InterestRateSwap().generateAgreement(floatingLeg, fixedLeg, calculation, common, notary)
|
||||
|
||||
override fun generateFix(ptx: TransactionBuilder, oldStateRef: StateRef, fix: Fix) {
|
||||
InterestRateSwap().generateFix(ptx, StateAndRef(this, oldStateRef), Pair(fix.of.forDay, Rate(RatioUnit(fix.value))))
|
||||
@ -660,7 +663,8 @@ class InterestRateSwap() : Contract {
|
||||
* This generates the agreement state and also the schedules from the initial data.
|
||||
* Note: The day count, interest rate calculation etc are not finished yet, but they are demonstrable.
|
||||
*/
|
||||
fun generateAgreement(floatingLeg: FloatingLeg, fixedLeg: FixedLeg, calculation: Calculation, common: Common): TransactionBuilder {
|
||||
fun generateAgreement(floatingLeg: FloatingLeg, fixedLeg: FixedLeg, calculation: Calculation,
|
||||
common: Common, notary: Party): TransactionBuilder {
|
||||
|
||||
val fixedLegPaymentSchedule = HashMap<LocalDate, FixedRatePaymentEvent>()
|
||||
var dates = BusinessCalendar.createGenericSchedule(fixedLeg.effectiveDate, fixedLeg.paymentFrequency, fixedLeg.paymentCalendar, fixedLeg.rollConvention, endDate = fixedLeg.terminationDate)
|
||||
@ -709,7 +713,7 @@ class InterestRateSwap() : Contract {
|
||||
val newCalculation = Calculation(calculation.expression, floatingLegPaymentSchedule, fixedLegPaymentSchedule)
|
||||
|
||||
// Put all the above into a new State object.
|
||||
val state = State(fixedLeg, floatingLeg, newCalculation, common)
|
||||
val state = State(fixedLeg, floatingLeg, newCalculation, common, notary)
|
||||
return TransactionBuilder().withItems(state, Command(Commands.Agree(), listOf(state.floatingLeg.floatingRatePayer.owningKey, state.fixedLeg.fixedRatePayer.owningKey)))
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package contracts
|
||||
|
||||
import core.*
|
||||
import core.contracts.Amount
|
||||
import core.contracts.Tenor
|
||||
import java.math.BigDecimal
|
||||
import java.security.PublicKey
|
||||
|
||||
|
||||
// Things in here will move to the general utils class when we've hammered out various discussions regarding amounts, dates, oracle etc.
|
||||
@ -41,53 +41,6 @@ open class PercentageRatioUnit(percentageAsString: String) : RatioUnit(BigDecima
|
||||
*/
|
||||
val String.percent: PercentageRatioUnit get() = PercentageRatioUnit(this)
|
||||
|
||||
/**
|
||||
* Interface representing an agreement that exposes various attributes that are common. Implementing it simplifies
|
||||
* implementation of general protocols that manipulate many agreement types.
|
||||
*/
|
||||
interface DealState : LinearState {
|
||||
|
||||
/** Human readable well known reference (e.g. trade reference) */
|
||||
val ref: String
|
||||
|
||||
/** Exposes the Parties involved in a generic way */
|
||||
val parties: Array<Party>
|
||||
|
||||
// TODO: This works by editing the keys used by a Party which is invalid.
|
||||
fun withPublicKey(before: Party, after: PublicKey): DealState
|
||||
|
||||
/**
|
||||
* Generate a partial transaction representing an agreement (command) to this deal, allowing a general
|
||||
* deal/agreement protocol to generate the necessary transaction for potential implementations
|
||||
*
|
||||
* TODO: Currently this is the "inception" transaction but in future an offer of some description might be an input state ref
|
||||
*
|
||||
* TODO: This should more likely be a method on the Contract (on a common interface) and the changes to reference a
|
||||
* Contract instance from a ContractState are imminent, at which point we can move this out of here
|
||||
*/
|
||||
fun generateAgreement(): TransactionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface adding fixing specific methods
|
||||
*/
|
||||
interface FixableDealState : DealState {
|
||||
/**
|
||||
* When is the next fixing and what is the fixing for?
|
||||
*
|
||||
* TODO: In future we would use this to register for an event to trigger a/the fixing protocol
|
||||
*/
|
||||
fun nextFixingOf(): FixOf?
|
||||
|
||||
/**
|
||||
* Generate a fixing command for this deal and fix
|
||||
*
|
||||
* TODO: This would also likely move to methods on the Contract once the changes to reference
|
||||
* the Contract from the ContractState are in
|
||||
*/
|
||||
fun generateFix(ptx: TransactionBuilder, oldStateRef: StateRef, fix: Fix)
|
||||
}
|
||||
|
||||
/**
|
||||
* Parent of the Rate family. Used to denote fixed rates, floating rates, reference rates etc
|
||||
*/
|
||||
|
@ -0,0 +1,15 @@
|
||||
package contracts.cash
|
||||
|
||||
import core.contracts.IssuanceDefinition
|
||||
import core.contracts.PartyAndReference
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Subset of cash-like contract state, containing the issuance definition. If these definitions match for two
|
||||
* contracts' states, those states can be aggregated.
|
||||
*/
|
||||
interface CashIssuanceDefinition : IssuanceDefinition {
|
||||
/** Where the underlying currency backing this ledger entry can be found (propagated) */
|
||||
val deposit: PartyAndReference
|
||||
val currency: Currency
|
||||
}
|
15
contracts/src/main/kotlin/contracts/cash/CommonCashState.kt
Normal file
15
contracts/src/main/kotlin/contracts/cash/CommonCashState.kt
Normal file
@ -0,0 +1,15 @@
|
||||
package contracts.cash
|
||||
|
||||
import core.contracts.Amount
|
||||
import core.contracts.OwnableState
|
||||
import core.contracts.PartyAndReference
|
||||
|
||||
/**
|
||||
* Common elements of cash contract states.
|
||||
*/
|
||||
interface CommonCashState<I : CashIssuanceDefinition> : OwnableState {
|
||||
val issuanceDef: I
|
||||
/** Where the underlying currency backing this ledger entry can be found (propagated) */
|
||||
val deposit: PartyAndReference
|
||||
val amount: Amount
|
||||
}
|
@ -31,6 +31,9 @@ dependencies {
|
||||
// Thread safety annotations
|
||||
compile "com.google.code.findbugs:jsr305:3.0.1"
|
||||
|
||||
// AssertJ: for fluent assertions for testing
|
||||
testCompile "org.assertj:assertj-core:3.4.1"
|
||||
|
||||
// SLF4J: Logging framework.
|
||||
compile "org.slf4j:slf4j-jdk14:1.7.13"
|
||||
|
||||
|
@ -83,6 +83,33 @@ fun <T> List<T>.indexOfOrThrow(item: T): Int {
|
||||
return i
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the single element matching the given [predicate], or `null` if element was not found,
|
||||
* or throws if more than one element was found.
|
||||
*/
|
||||
fun <T> Iterable<T>.noneOrSingle(predicate: (T) -> Boolean): T? {
|
||||
var single: T? = null
|
||||
for (element in this) {
|
||||
if (predicate(element)) {
|
||||
if (single == null) {
|
||||
single = element
|
||||
} else throw IllegalArgumentException("Collection contains more than one matching element.")
|
||||
}
|
||||
}
|
||||
return single
|
||||
}
|
||||
|
||||
/** Returns single element, or `null` if element was not found, or throws if more than one element was found. */
|
||||
fun <T> Iterable<T>.noneOrSingle(): T? {
|
||||
var single: T? = null
|
||||
for (element in this) {
|
||||
if (single == null) {
|
||||
single = element
|
||||
} else throw IllegalArgumentException("Collection contains more than one matching element.")
|
||||
}
|
||||
return single
|
||||
}
|
||||
|
||||
// An alias that can sometimes make code clearer to read.
|
||||
val RunOnCallerThread = MoreExecutors.directExecutor()
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package core
|
||||
package core.contracts
|
||||
|
||||
import core.*
|
||||
import core.crypto.Party
|
||||
import java.security.PublicKey
|
||||
import java.util.*
|
||||
|
@ -1,4 +1,4 @@
|
||||
package core
|
||||
package core.contracts
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator
|
||||
import com.fasterxml.jackson.core.JsonParser
|
||||
@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.JsonSerializer
|
||||
import com.fasterxml.jackson.databind.SerializerProvider
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize
|
||||
import core.contracts.CommandData
|
||||
import java.math.BigDecimal
|
||||
import java.time.DayOfWeek
|
||||
import java.time.LocalDate
|
||||
@ -304,7 +305,7 @@ open class BusinessCalendar private constructor(val calendars: Array<out String>
|
||||
/** Calculates an event schedule that moves events around to ensure they fall on working days. */
|
||||
fun createGenericSchedule(startDate: LocalDate,
|
||||
period: Frequency,
|
||||
calendar: BusinessCalendar = BusinessCalendar.getInstance(),
|
||||
calendar: BusinessCalendar = getInstance(),
|
||||
dateRollConvention: DateRollConvention = DateRollConvention.Following,
|
||||
noOfAdditionalPeriods: Int = Integer.MAX_VALUE,
|
||||
endDate: LocalDate? = null,
|
@ -1,5 +1,10 @@
|
||||
package core
|
||||
package core.contracts
|
||||
|
||||
import core.contracts.TransactionBuilder
|
||||
import core.contracts.TransactionForVerification
|
||||
import core.contracts.Fix
|
||||
import core.contracts.FixOf
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import core.crypto.toStringShort
|
||||
import core.serialization.OpaqueBytes
|
||||
@ -23,12 +28,22 @@ interface NamedByHash {
|
||||
* updated, instead, any changes must generate a new successor state.
|
||||
*/
|
||||
interface ContractState {
|
||||
/**
|
||||
* Contract by which the state belongs
|
||||
*/
|
||||
/** Contract by which the state belongs */
|
||||
val contract: Contract
|
||||
|
||||
/** Identity of the notary that ensures this state is not used as an input to a transaction more than once */
|
||||
val notary: Party
|
||||
}
|
||||
|
||||
/**
|
||||
* Marker interface for data classes that represent the issuance state for a contract. These are intended as templates
|
||||
* from which the state object is initialised.
|
||||
*/
|
||||
interface IssuanceDefinition
|
||||
|
||||
/**
|
||||
* A contract state that can have a single owner.
|
||||
*/
|
||||
interface OwnableState : ContractState {
|
||||
/** There must be a MoveCommand signed by this key to claim the amount */
|
||||
val owner: PublicKey
|
||||
@ -50,6 +65,53 @@ interface LinearState : ContractState {
|
||||
fun isRelevant(ourKeys: Set<PublicKey>): Boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface representing an agreement that exposes various attributes that are common. Implementing it simplifies
|
||||
* implementation of general protocols that manipulate many agreement types.
|
||||
*/
|
||||
interface DealState : LinearState {
|
||||
|
||||
/** Human readable well known reference (e.g. trade reference) */
|
||||
val ref: String
|
||||
|
||||
/** Exposes the Parties involved in a generic way */
|
||||
val parties: Array<Party>
|
||||
|
||||
// TODO: This works by editing the keys used by a Party which is invalid.
|
||||
fun withPublicKey(before: Party, after: PublicKey): DealState
|
||||
|
||||
/**
|
||||
* Generate a partial transaction representing an agreement (command) to this deal, allowing a general
|
||||
* deal/agreement protocol to generate the necessary transaction for potential implementations
|
||||
*
|
||||
* TODO: Currently this is the "inception" transaction but in future an offer of some description might be an input state ref
|
||||
*
|
||||
* TODO: This should more likely be a method on the Contract (on a common interface) and the changes to reference a
|
||||
* Contract instance from a ContractState are imminent, at which point we can move this out of here
|
||||
*/
|
||||
fun generateAgreement(): TransactionBuilder
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface adding fixing specific methods
|
||||
*/
|
||||
interface FixableDealState : DealState {
|
||||
/**
|
||||
* When is the next fixing and what is the fixing for?
|
||||
*
|
||||
* TODO: In future we would use this to register for an event to trigger a/the fixing protocol
|
||||
*/
|
||||
fun nextFixingOf(): FixOf?
|
||||
|
||||
/**
|
||||
* Generate a fixing command for this deal and fix
|
||||
*
|
||||
* TODO: This would also likely move to methods on the Contract once the changes to reference
|
||||
* the Contract from the ContractState are in
|
||||
*/
|
||||
fun generateFix(ptx: TransactionBuilder, oldStateRef: StateRef, fix: Fix)
|
||||
}
|
||||
|
||||
/** Returns the SHA-256 hash of the serialised contents of this state (not cached!) */
|
||||
fun ContractState.hash(): SecureHash = SecureHash.sha256(serialize().bits)
|
||||
|
||||
@ -69,14 +131,6 @@ inline fun <reified T : ContractState> List<StateAndRef<ContractState>>.filterSt
|
||||
return mapNotNull { if (it.state is T) StateAndRef(it.state, it.ref) else null }
|
||||
}
|
||||
|
||||
/** A [Party] is well known (name, pubkey) pair. In a real system this would probably be an X.509 certificate. */
|
||||
data class Party(val name: String, val owningKey: PublicKey) {
|
||||
override fun toString() = name
|
||||
|
||||
fun ref(bytes: OpaqueBytes) = PartyAndReference(this, bytes)
|
||||
fun ref(vararg bytes: Byte) = ref(OpaqueBytes.of(*bytes))
|
||||
}
|
||||
|
||||
/**
|
||||
* Reference to something being stored or issued by a party e.g. in a vault or (more likely) on their normal
|
||||
* ledger. The reference is intended to be encrypted so it's meaningless to anyone other than the party.
|
||||
@ -189,4 +243,4 @@ interface Attachment : NamedByHash {
|
||||
}
|
||||
throw FileNotFoundException()
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
package core
|
||||
package core.contracts
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import core.contracts.SignedTransaction
|
||||
import core.contracts.WireTransaction
|
||||
import core.contracts.*
|
||||
import core.crypto.DigitalSignature
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import core.crypto.signWithECDSA
|
||||
import core.node.services.TimestamperService
|
||||
import core.node.services.TimestampingError
|
||||
import core.serialization.serialize
|
||||
import java.security.KeyPair
|
||||
import java.security.PublicKey
|
||||
import java.time.Clock
|
||||
import java.time.Duration
|
||||
import java.time.Instant
|
||||
import java.util.*
|
||||
@ -29,8 +29,8 @@ class TransactionBuilder(private val inputs: MutableList<StateRef> = arrayListOf
|
||||
|
||||
/**
|
||||
* Places a [TimestampCommand] in this transaction, removing any existing command if there is one.
|
||||
* To get the right signature from the timestamping service, use the [timestamp] method after building is
|
||||
* finished, or run use the [TimestampingProtocol] yourself.
|
||||
* The command requires a signature from the Notary service, which acts as a Timestamp Authority.
|
||||
* The signature can be obtained using [NotaryProtocol].
|
||||
*
|
||||
* The window of time in which the final timestamp may lie is defined as [time] +/- [timeTolerance].
|
||||
* If you want a non-symmetrical time window you must add the command via [addCommand] yourself. The tolerance
|
||||
@ -39,19 +39,19 @@ class TransactionBuilder(private val inputs: MutableList<StateRef> = arrayListOf
|
||||
* collaborating parties may therefore require a higher time tolerance than a transaction being built by a single
|
||||
* node.
|
||||
*/
|
||||
fun setTime(time: Instant, authenticatedBy: Party, timeTolerance: Duration) {
|
||||
fun setTime(time: Instant, authority: Party, timeTolerance: Duration) {
|
||||
check(currentSigs.isEmpty()) { "Cannot change timestamp after signing" }
|
||||
commands.removeAll { it.value is TimestampCommand }
|
||||
addCommand(TimestampCommand(time, timeTolerance), authenticatedBy.owningKey)
|
||||
addCommand(TimestampCommand(time, timeTolerance), authority.owningKey)
|
||||
}
|
||||
|
||||
/** A more convenient way to add items to this transaction that calls the add* methods for you based on type */
|
||||
fun withItems(vararg items: Any): TransactionBuilder {
|
||||
for (t in items) {
|
||||
when (t) {
|
||||
is StateRef -> inputs.add(t)
|
||||
is ContractState -> outputs.add(t)
|
||||
is Command -> commands.add(t)
|
||||
is StateRef -> addInputState(t)
|
||||
is ContractState -> addOutputState(t)
|
||||
is Command -> addCommand(t)
|
||||
else -> throw IllegalArgumentException("Wrong argument type: ${t.javaClass}")
|
||||
}
|
||||
}
|
||||
@ -63,7 +63,6 @@ class TransactionBuilder(private val inputs: MutableList<StateRef> = arrayListOf
|
||||
|
||||
fun signWith(key: KeyPair) {
|
||||
check(currentSigs.none { it.by == key.public }) { "This partial transaction was already signed by ${key.public}" }
|
||||
check(commands.count { it.signers.contains(key.public) } > 0) { "Trying to sign with a key that isn't in any command" }
|
||||
val data = toWireTransaction().serialize()
|
||||
addSignatureUnchecked(key.signWithECDSA(data.bits))
|
||||
}
|
||||
@ -87,7 +86,7 @@ class TransactionBuilder(private val inputs: MutableList<StateRef> = arrayListOf
|
||||
* @throws IllegalArgumentException if the signature key doesn't appear in any command.
|
||||
*/
|
||||
fun checkSignature(sig: DigitalSignature.WithKey) {
|
||||
require(commands.count { it.signers.contains(sig.by) } > 0) { "Signature key doesn't match any command" }
|
||||
require(commands.any { it.signers.contains(sig.by) }) { "Signature key doesn't match any command" }
|
||||
sig.verifyWithECDSA(toWireTransaction().serialized)
|
||||
}
|
||||
|
||||
@ -96,32 +95,6 @@ class TransactionBuilder(private val inputs: MutableList<StateRef> = arrayListOf
|
||||
currentSigs.add(sig)
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses the given timestamper service to request a signature over the WireTransaction be added. There must always be
|
||||
* at least one such signature, but others may be added as well. You may want to have multiple redundant timestamps
|
||||
* in the following cases:
|
||||
*
|
||||
* - Cross border contracts where local law says that only local timestamping authorities are acceptable.
|
||||
* - Backup in case a TSA's signing key is compromised.
|
||||
*
|
||||
* The signature of the trusted timestamper merely asserts that the time field of this transaction is valid.
|
||||
*/
|
||||
@Suspendable
|
||||
fun timestamp(timestamper: TimestamperService, clock: Clock = Clock.systemUTC()) {
|
||||
val t = time ?: throw IllegalStateException("Timestamping requested but no time was inserted into the transaction")
|
||||
|
||||
// Obviously this is just a hard-coded dummy value for now.
|
||||
val maxExpectedLatency = 5.seconds
|
||||
if (Duration.between(clock.instant(), t.before) > maxExpectedLatency)
|
||||
throw TimestampingError.NotOnTimeException()
|
||||
|
||||
// The timestamper may also throw NotOnTimeException if our clocks are desynchronised or if we are right on the
|
||||
// boundary of t.notAfter and network latency pushes us over the edge. By "synchronised" here we mean relative
|
||||
// to GPS time i.e. the United States Naval Observatory.
|
||||
val sig = timestamper.timestamp(toWireTransaction().serialize())
|
||||
addSignatureUnchecked(sig)
|
||||
}
|
||||
|
||||
fun toWireTransaction() = WireTransaction(ArrayList(inputs), ArrayList(attachments),
|
||||
ArrayList(outputs), ArrayList(commands))
|
||||
|
||||
@ -153,7 +126,6 @@ class TransactionBuilder(private val inputs: MutableList<StateRef> = arrayListOf
|
||||
|
||||
fun addCommand(arg: Command) {
|
||||
check(currentSigs.isEmpty())
|
||||
|
||||
// We should probably merge the lists of pubkeys for identical commands here.
|
||||
commands.add(arg)
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
package core
|
||||
package core.contracts
|
||||
|
||||
import core.contracts.SignedTransaction
|
||||
import core.contracts.WireTransaction
|
||||
import core.contracts.CommandData
|
||||
import core.crypto.SecureHash
|
||||
import java.util.*
|
||||
import java.util.concurrent.Callable
|
@ -1,5 +1,9 @@
|
||||
package core
|
||||
package core.contracts
|
||||
|
||||
import core.contracts.AuthenticatedObject
|
||||
import core.contracts.LedgerTransaction
|
||||
import core.contracts.SignedTransaction
|
||||
import core.contracts.WireTransaction
|
||||
import core.node.services.AttachmentStorage
|
||||
import core.node.services.IdentityService
|
||||
import java.io.FileNotFoundException
|
@ -1,11 +1,10 @@
|
||||
package core
|
||||
package core.contracts
|
||||
|
||||
import core.contracts.*
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import java.util.*
|
||||
|
||||
class TransactionResolutionException(val hash: SecureHash) : Exception()
|
||||
class TransactionConflictException(val conflictRef: StateRef, val tx1: LedgerTransaction, val tx2: LedgerTransaction) : Exception()
|
||||
|
||||
// TODO: Consider moving this out of the core module and providing a different way for unit tests to test contracts.
|
||||
|
||||
/**
|
||||
@ -63,27 +62,37 @@ data class TransactionForVerification(val inStates: List<ContractState>,
|
||||
override fun equals(other: Any?) = other is TransactionForVerification && other.origHash == origHash
|
||||
|
||||
/**
|
||||
* Runs the contracts for this transaction.
|
||||
* Verifies that the transaction is valid:
|
||||
* - Checks that the input states and the timestamp point to the same Notary
|
||||
* - Runs the contracts for this transaction. If any contract fails to verify, the whole transaction
|
||||
* is considered to be invalid
|
||||
*
|
||||
* TODO: Move this out of the core data structure definitions, once unit tests are more cleanly separated.
|
||||
*
|
||||
* @throws TransactionVerificationException if a contract throws an exception, the original is in the cause field
|
||||
* @throws IllegalStateException if a state refers to an unknown contract.
|
||||
* @throws TransactionVerificationException if a contract throws an exception (the original is in the cause field)
|
||||
* or the transaction has references to more than one Notary
|
||||
*/
|
||||
@Throws(TransactionVerificationException::class, IllegalStateException::class)
|
||||
@Throws(TransactionVerificationException::class)
|
||||
fun verify() {
|
||||
// For each input and output state, locate the program to run. Then execute the verification function. If any
|
||||
// throws an exception, the entire transaction is invalid.
|
||||
val programs = (inStates.map { it.contract } + outStates.map { it.contract }).toSet()
|
||||
for (program in programs) {
|
||||
verifySingleNotary()
|
||||
val contracts = (inStates.map { it.contract } + outStates.map { it.contract }).toSet()
|
||||
for (contract in contracts) {
|
||||
try {
|
||||
program.verify(this)
|
||||
contract.verify(this)
|
||||
} catch(e: Throwable) {
|
||||
throw TransactionVerificationException(this, program, e)
|
||||
throw TransactionVerificationException.ContractRejection(this, contract, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun verifySingleNotary() {
|
||||
if (inStates.isEmpty()) return
|
||||
val notary = inStates.first().notary
|
||||
if (inStates.any { it.notary != notary }) throw TransactionVerificationException.MoreThanOneNotary(this)
|
||||
val timestampCmd = commands.singleOrNull { it.value is TimestampCommand } ?: return
|
||||
if (!timestampCmd.signers.contains(notary.owningKey)) throw TransactionVerificationException.MoreThanOneNotary(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* Utilities for contract writers to incorporate into their logic.
|
||||
*/
|
||||
@ -99,6 +108,8 @@ data class TransactionForVerification(val inStates: List<ContractState>,
|
||||
|
||||
/** Simply calls [commands.getTimestampBy] as a shortcut to make code completion more intuitive. */
|
||||
fun getTimestampBy(timestampingAuthority: Party): TimestampCommand? = commands.getTimestampBy(timestampingAuthority)
|
||||
/** Simply calls [commands.getTimestampByName] as a shortcut to make code completion more intuitive. */
|
||||
fun getTimestampByName(vararg authorityName: String): TimestampCommand? = commands.getTimestampByName(*authorityName)
|
||||
|
||||
/**
|
||||
* Given a type and a function that returns a grouping key, associates inputs and outputs together so that they
|
||||
@ -152,5 +163,10 @@ data class TransactionForVerification(val inStates: List<ContractState>,
|
||||
}
|
||||
}
|
||||
|
||||
/** Thrown if a verification fails due to a contract rejection. */
|
||||
class TransactionVerificationException(val tx: TransactionForVerification, val contract: Contract, cause: Throwable?) : Exception(cause)
|
||||
class TransactionResolutionException(val hash: SecureHash) : Exception()
|
||||
class TransactionConflictException(val conflictRef: StateRef, val tx1: LedgerTransaction, val tx2: LedgerTransaction) : Exception()
|
||||
|
||||
sealed class TransactionVerificationException(val tx: TransactionForVerification, cause: Throwable?) : Exception(cause) {
|
||||
class ContractRejection(tx: TransactionForVerification, val contract: Contract, cause: Throwable?) : TransactionVerificationException(tx, cause)
|
||||
class MoreThanOneNotary(tx: TransactionForVerification) : TransactionVerificationException(tx, null)
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
package core
|
||||
package core.contracts
|
||||
|
||||
import com.esotericsoftware.kryo.Kryo
|
||||
import core.contracts.*
|
||||
import core.crypto.DigitalSignature
|
||||
import core.crypto.SecureHash
|
||||
import core.crypto.toStringShort
|
||||
import core.indexOfOrThrow
|
||||
import core.serialization.SerializedBytes
|
||||
import core.serialization.THREAD_LOCAL_KRYO
|
||||
import core.serialization.deserialize
|
||||
@ -107,7 +109,7 @@ data class SignedTransaction(val txBits: SerializedBytes<WireTransaction>,
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify the signatures, deserialise the wire transaction and then check that the set of signatures found matches
|
||||
* Verify the signatures, deserialise the wire transaction and then check that the set of signatures found contains
|
||||
* the set of pubkeys in the commands. If any signatures are missing, either throws an exception (by default) or
|
||||
* returns the list of keys that have missing signatures, depending on the parameter.
|
||||
*
|
||||
@ -115,25 +117,34 @@ data class SignedTransaction(val txBits: SerializedBytes<WireTransaction>,
|
||||
*/
|
||||
fun verify(throwIfSignaturesAreMissing: Boolean = true): Set<PublicKey> {
|
||||
verifySignatures()
|
||||
// Verify that every command key was in the set that we just verified: there should be no commands that were
|
||||
// unverified.
|
||||
val cmdKeys = tx.commands.flatMap { it.signers }.toSet()
|
||||
val sigKeys = sigs.map { it.by }.toSet()
|
||||
if (sigKeys == cmdKeys)
|
||||
return emptySet()
|
||||
|
||||
val missing = cmdKeys - sigKeys
|
||||
if (throwIfSignaturesAreMissing)
|
||||
val missing = getMissingSignatures()
|
||||
if (missing.isNotEmpty() && throwIfSignaturesAreMissing)
|
||||
throw SignatureException("Missing signatures on transaction ${id.prefixChars()} for: ${missing.map { it.toStringShort() }}")
|
||||
else
|
||||
return missing
|
||||
|
||||
return missing
|
||||
}
|
||||
|
||||
/** Returns the same transaction but with an additional (unchecked) signature */
|
||||
fun withAdditionalSignature(sig: DigitalSignature.WithKey) = copy(sigs = sigs + sig)
|
||||
fun withAdditionalSignature(sig: DigitalSignature.WithKey): SignedTransaction {
|
||||
// TODO: need to make sure the Notary signs last
|
||||
return copy(sigs = sigs + sig)
|
||||
}
|
||||
|
||||
/** Alias for [withAdditionalSignature] to let you use Kotlin operator overloading. */
|
||||
operator fun plus(sig: DigitalSignature.WithKey) = withAdditionalSignature(sig)
|
||||
|
||||
/**
|
||||
* Returns the set of missing signatures - a signature must be present for every command pub key
|
||||
* and the Notary (if it is specified)
|
||||
*/
|
||||
fun getMissingSignatures(): Set<PublicKey> {
|
||||
val requiredKeys = tx.commands.flatMap { it.signers }.toSet()
|
||||
val sigKeys = sigs.map { it.by }.toSet()
|
||||
|
||||
if (sigKeys.containsAll(requiredKeys)) return emptySet()
|
||||
return requiredKeys - sigKeys
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
@ -1,7 +1,7 @@
|
||||
package core.crypto
|
||||
|
||||
import com.google.common.io.BaseEncoding
|
||||
import core.Party
|
||||
import core.crypto.Party
|
||||
import core.serialization.OpaqueBytes
|
||||
import core.serialization.SerializedBytes
|
||||
import core.serialization.deserialize
|
||||
|
16
core/src/main/kotlin/core/crypto/Party.kt
Normal file
16
core/src/main/kotlin/core/crypto/Party.kt
Normal file
@ -0,0 +1,16 @@
|
||||
package core.crypto
|
||||
|
||||
import core.contracts.PartyAndReference
|
||||
import core.serialization.OpaqueBytes
|
||||
import java.security.PublicKey
|
||||
|
||||
/**
|
||||
* Created by matth on 14/05/2016.
|
||||
*/
|
||||
/** A [Party] is well known (name, pubkey) pair. In a real system this would probably be an X.509 certificate. */
|
||||
data class Party(val name: String, val owningKey: PublicKey) {
|
||||
override fun toString() = name
|
||||
|
||||
fun ref(bytes: OpaqueBytes) = PartyAndReference(this, bytes)
|
||||
fun ref(vararg bytes: Byte) = ref(OpaqueBytes.of(*bytes))
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package core.node
|
||||
|
||||
import core.Attachment
|
||||
import core.contracts.Attachment
|
||||
import core.crypto.SecureHash
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
|
@ -1,13 +1,6 @@
|
||||
/*
|
||||
* Copyright 2015 Distributed Ledger Group LLC. Distributed as Licensed Company IP to DLG Group Members
|
||||
* pursuant to the August 7, 2015 Advisory Services Agreement and subject to the Company IP License terms
|
||||
* set forth therein.
|
||||
*
|
||||
* All other rights reserved.
|
||||
*/
|
||||
package core.node
|
||||
|
||||
import core.Party
|
||||
import core.crypto.Party
|
||||
import core.messaging.SingleMessageRecipient
|
||||
import core.node.services.ServiceType
|
||||
|
||||
|
@ -1,11 +1,3 @@
|
||||
/*
|
||||
* Copyright 2015 Distributed Ledger Group LLC. Distributed as Licensed Company IP to DLG Group Members
|
||||
* pursuant to the August 7, 2015 Advisory Services Agreement and subject to the Company IP License terms
|
||||
* set forth therein.
|
||||
*
|
||||
* All other rights reserved.
|
||||
*/
|
||||
|
||||
package core.node
|
||||
|
||||
import java.util.*
|
||||
|
@ -1,6 +1,6 @@
|
||||
package core.node
|
||||
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.SecureHash
|
||||
import core.messaging.MessagingService
|
||||
import core.node.services.IdentityService
|
||||
@ -13,6 +13,8 @@ import java.time.Clock
|
||||
* mocked out. This class is useful to pass to chunks of pluggable code that might have need of many different kinds of
|
||||
* functionality and you don't want to hard-code which types in the interface.
|
||||
*
|
||||
* All services exposed to protocols (public view) need to implement [SerializeAsToken] or similar to avoid being serialized in checkpoints.
|
||||
*
|
||||
* TODO: Split into a public (to contracts etc) and private (to node) view
|
||||
*/
|
||||
interface ServiceHub {
|
||||
@ -57,4 +59,14 @@ interface ServiceHub {
|
||||
txStorage.putAll(txns)
|
||||
walletService.notifyAll(txs.map { it.tx })
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a [StateRef] loads the referenced transaction and looks up the specified output [ContractState]
|
||||
*
|
||||
* @throws TransactionResolutionException if the [StateRef] points to a non-existent transaction
|
||||
*/
|
||||
fun loadState(stateRef: StateRef): ContractState {
|
||||
val definingTx = storageService.validatedTransactions[stateRef.txhash] ?: throw TransactionResolutionException(stateRef.txhash)
|
||||
return definingTx.tx.outputs[stateRef.index]
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package core.node.services
|
||||
|
||||
import core.Attachment
|
||||
import core.contracts.Attachment
|
||||
import core.crypto.SecureHash
|
||||
import java.io.InputStream
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package core.node.services
|
||||
|
||||
import core.Party
|
||||
import core.crypto.Party
|
||||
import java.security.PublicKey
|
||||
|
||||
/**
|
||||
|
@ -1,45 +0,0 @@
|
||||
package core.node.services
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import core.Party
|
||||
import core.WireTransaction
|
||||
import core.crypto.DigitalSignature
|
||||
import core.crypto.generateKeyPair
|
||||
import core.serialization.SerializedBytes
|
||||
|
||||
/**
|
||||
* Simple interface (for testing) to an abstract timestamping service. Note that this is not "timestamping" in the
|
||||
* blockchain sense of a total ordering of transactions, but rather, a signature from a well known/trusted timestamping
|
||||
* service over a transaction that indicates the timestamp in it is accurate. Such a signature may not always be
|
||||
* necessary: if there are multiple parties involved in a transaction then they can cross-check the timestamp
|
||||
* themselves.
|
||||
*/
|
||||
interface TimestamperService {
|
||||
object Type : ServiceType("corda.timestamper")
|
||||
@Suspendable
|
||||
fun timestamp(wtxBytes: SerializedBytes<WireTransaction>): DigitalSignature.LegallyIdentifiable
|
||||
|
||||
/** The name+pubkey that this timestamper will sign with. */
|
||||
val identity: Party
|
||||
}
|
||||
|
||||
// Smart contracts may wish to specify explicitly which timestamping authorities are trusted to assert the time.
|
||||
// We define a dummy authority here to allow to us to develop prototype contracts in the absence of a real authority.
|
||||
// The timestamper itself is implemented in the unit test part of the code (in TestUtils.kt).
|
||||
object DummyTimestampingAuthority {
|
||||
val key = generateKeyPair()
|
||||
val identity = Party("Mock Company 0", key.public)
|
||||
}
|
||||
|
||||
sealed class TimestampingError : Exception() {
|
||||
class RequiresExactlyOneCommand : TimestampingError()
|
||||
/**
|
||||
* Thrown if an attempt is made to timestamp a transaction using a trusted timestamper, but the time on the
|
||||
* transaction is too far in the past or future relative to the local clock and thus the timestamper would reject
|
||||
* it.
|
||||
*/
|
||||
class NotOnTimeException : TimestampingError()
|
||||
|
||||
/** Thrown if the command in the transaction doesn't list this timestamping authorities public key as a signer */
|
||||
class NotForMe : TimestampingError()
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package core.node.services
|
||||
|
||||
import core.crypto.Party
|
||||
import core.contracts.StateRef
|
||||
import core.contracts.WireTransaction
|
||||
import core.crypto.SecureHash
|
||||
|
||||
/**
|
||||
* A service that records input states of the given transaction and provides conflict information
|
||||
* if any of the inputs have already been used in another transaction
|
||||
*/
|
||||
interface UniquenessProvider {
|
||||
/** Commits all input states of the given transaction */
|
||||
fun commit(tx: WireTransaction, callerIdentity: Party)
|
||||
|
||||
/** Specifies the consuming transaction for every conflicting state */
|
||||
data class Conflict(val stateHistory: Map<StateRef, ConsumingTx>)
|
||||
|
||||
/**
|
||||
* Specifies the transaction id, the position of the consumed state in the inputs, and
|
||||
* the caller identity requesting the commit
|
||||
*
|
||||
* TODO: need to do more design work to prevent privacy problems: knowing the id of a
|
||||
* transaction, by the rules of our system the party can obtain it and see its contents.
|
||||
* This allows a party to just submit invalid transactions with outputs it was aware of and
|
||||
* find out where exactly they were spent.
|
||||
*/
|
||||
data class ConsumingTx(val id: SecureHash, val inputIndex: Int, val requestingParty: Party)
|
||||
}
|
||||
|
||||
class UniquenessException(val error: UniquenessProvider.Conflict) : Exception()
|
@ -1,12 +1,19 @@
|
||||
package core.node.subsystems
|
||||
|
||||
import com.google.common.util.concurrent.ListenableFuture
|
||||
import core.Contract
|
||||
import core.Party
|
||||
import core.contracts.Contract
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import core.messaging.MessagingService
|
||||
import core.node.NodeInfo
|
||||
import core.node.services.ServiceType
|
||||
import core.node.services.*
|
||||
import core.serialization.deserialize
|
||||
import core.serialization.serialize
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.security.PublicKey
|
||||
import java.security.SignatureException
|
||||
import java.util.*
|
||||
import javax.annotation.concurrent.ThreadSafe
|
||||
|
||||
/**
|
||||
* A network map contains lists of nodes on the network along with information about their identity keys, services
|
||||
@ -21,23 +28,19 @@ interface NetworkMapCache {
|
||||
|
||||
/** A list of nodes that advertise a network map service */
|
||||
val networkMapNodes: List<NodeInfo>
|
||||
/** A list of nodes that advertise a timestamping service */
|
||||
val timestampingNodes: List<NodeInfo>
|
||||
/** A list of nodes that advertise a notary service */
|
||||
val notaryNodes: List<NodeInfo>
|
||||
/** A list of nodes that advertise a rates oracle service */
|
||||
val ratesOracleNodes: List<NodeInfo>
|
||||
/** A list of all nodes the cache is aware of */
|
||||
val partyNodes: List<NodeInfo>
|
||||
/** A list of nodes that advertise a regulatory service. Identifying the correct regulator for a trade is outwith
|
||||
/**
|
||||
* A list of nodes that advertise a regulatory service. Identifying the correct regulator for a trade is outside
|
||||
* the scope of the network map service, and this is intended solely as a sanity check on configuration stored
|
||||
* elsewhere.
|
||||
*/
|
||||
val regulators: List<NodeInfo>
|
||||
|
||||
/**
|
||||
* Look up the node info for a party.
|
||||
*/
|
||||
fun nodeForPartyName(name: String): NodeInfo? = partyNodes.singleOrNull { it.identity.name == name }
|
||||
|
||||
/**
|
||||
* Get a copy of all nodes in the map.
|
||||
*/
|
||||
@ -55,6 +58,16 @@ interface NetworkMapCache {
|
||||
*/
|
||||
fun getRecommended(type: ServiceType, contract: Contract, vararg party: Party): NodeInfo?
|
||||
|
||||
/**
|
||||
* Look up the node info for a legal name.
|
||||
*/
|
||||
fun getNodeByLegalName(name: String): NodeInfo?
|
||||
|
||||
/**
|
||||
* Look up the node info for a public key.
|
||||
*/
|
||||
fun getNodeByPublicKey(publicKey: PublicKey): NodeInfo?
|
||||
|
||||
/**
|
||||
* Add a network map service; fetches a copy of the latest map from the service and subscribes to any further
|
||||
* updates.
|
||||
|
@ -2,6 +2,8 @@ package core.node.subsystems
|
||||
|
||||
import com.codahale.metrics.MetricRegistry
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.Party
|
||||
import core.crypto.SecureHash
|
||||
import core.node.services.AttachmentStorage
|
||||
import core.node.storage.CheckpointStorage
|
||||
|
@ -9,6 +9,7 @@ import com.esotericsoftware.kryo.io.Input
|
||||
import com.esotericsoftware.kryo.io.Output
|
||||
import com.esotericsoftware.kryo.serializers.JavaSerializer
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.SecureHash
|
||||
import core.crypto.generateKeyPair
|
||||
import core.crypto.sha256
|
||||
|
@ -0,0 +1,98 @@
|
||||
package core.serialization
|
||||
|
||||
import com.esotericsoftware.kryo.DefaultSerializer
|
||||
import com.esotericsoftware.kryo.Kryo
|
||||
import com.esotericsoftware.kryo.KryoException
|
||||
import com.esotericsoftware.kryo.Serializer
|
||||
import com.esotericsoftware.kryo.io.Input
|
||||
import com.esotericsoftware.kryo.io.Output
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* The interfaces and classes in this file allow large, singleton style classes to
|
||||
* mark themselves as needing converting to some form of token representation in the serialised form
|
||||
* and converting back again when deserialising.
|
||||
*
|
||||
* Typically these classes would be used for node services and subsystems that might become reachable from
|
||||
* Fibers and thus sucked into serialization when they are checkpointed.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This interface should be implemented by classes that want to substitute a token representation of themselves if
|
||||
* they are serialized because they have a lot of internal state that does not serialize (well).
|
||||
*
|
||||
* This models a similar pattern to the readReplace/writeReplace methods in Java serialization.
|
||||
*
|
||||
* With Kryo serialisation, these classes should also annotate themselves with <code>@DefaultSerializer</code>. See below.
|
||||
*
|
||||
*/
|
||||
interface SerializeAsToken {
|
||||
val token: SerializationToken
|
||||
}
|
||||
|
||||
/**
|
||||
* This represents a token in the serialized stream for an instance of a type that implements [SerializeAsToken]
|
||||
*/
|
||||
interface SerializationToken {
|
||||
fun fromToken(): Any
|
||||
}
|
||||
|
||||
/**
|
||||
* A Kryo serializer for [SerializeAsToken] implementations.
|
||||
*
|
||||
* Annotate the [SerializeAsToken] with <code>@DefaultSerializer(SerializeAsTokenSerializer::class)</code>
|
||||
*/
|
||||
class SerializeAsTokenSerializer<T : SerializeAsToken> : Serializer<T>() {
|
||||
override fun write(kryo: Kryo, output: Output, obj: T) {
|
||||
kryo.writeClassAndObject(output, obj.token)
|
||||
}
|
||||
|
||||
override fun read(kryo: Kryo, input: Input, type: Class<T>): T {
|
||||
val token = (kryo.readClassAndObject(input) as? SerializationToken) ?: throw KryoException("Non-token read for tokenized type: ${type.name}")
|
||||
val fromToken = token.fromToken()
|
||||
if (type.isAssignableFrom(fromToken.javaClass)) {
|
||||
return type.cast(fromToken)
|
||||
} else {
|
||||
throw KryoException("Token read did not return tokenized type: ${type.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A class representing a [SerializationToken] for some object that is not serializable but can be re-created or looked up
|
||||
* (when deserialized) via a [String] key.
|
||||
*/
|
||||
private data class SerializationStringToken(private val key: String, private val className: String) : SerializationToken {
|
||||
|
||||
constructor(key: String, toBeProxied: SerializeAsStringToken) : this(key, toBeProxied.javaClass.name) {
|
||||
tokenized.put(this, WeakReference(toBeProxied))
|
||||
}
|
||||
|
||||
companion object {
|
||||
val tokenized = Collections.synchronizedMap(WeakHashMap<SerializationStringToken, WeakReference<SerializeAsStringToken>>())
|
||||
}
|
||||
|
||||
override fun fromToken(): Any = tokenized.get(this)?.get() ?:
|
||||
throw IllegalStateException("Unable to find tokenized instance of ${className} for key $key")
|
||||
}
|
||||
|
||||
/**
|
||||
* A base class for implementing large objects / components / services that need to serialize themselves to a string token
|
||||
* to indicate which instance the token is a serialized form of.
|
||||
*
|
||||
* This class will also double check that the class is annotated for Kryo serialization. Note it does this on every
|
||||
* instance constructed but given this is designed to represent heavyweight services or components, this should not be significant.
|
||||
*/
|
||||
abstract class SerializeAsStringToken(val key: String) : SerializeAsToken {
|
||||
|
||||
init {
|
||||
// Verify we have the annotation
|
||||
val annotation = javaClass.getAnnotation(DefaultSerializer::class.java)
|
||||
if (annotation == null || annotation.value.java.name != SerializeAsTokenSerializer::class.java.name) {
|
||||
throw IllegalStateException("${this.javaClass.name} is not annotated with @${DefaultSerializer::class.java.simpleName} set to ${SerializeAsTokenSerializer::class.java.simpleName}")
|
||||
}
|
||||
}
|
||||
|
||||
override val token: SerializationToken = SerializationStringToken(key, this)
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package protocols
|
||||
|
||||
import core.Attachment
|
||||
import core.contracts.Attachment
|
||||
import core.crypto.SecureHash
|
||||
import core.crypto.sha256
|
||||
import core.messaging.SingleMessageRecipient
|
@ -1,10 +1,9 @@
|
||||
package protocols
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import core.NamedByHash
|
||||
import core.contracts.NamedByHash
|
||||
import core.crypto.SecureHash
|
||||
import core.messaging.SingleMessageRecipient
|
||||
import core.node.subsystems.DataVendingService
|
||||
import core.protocols.ProtocolLogic
|
||||
import core.random63BitValue
|
||||
import core.utilities.UntrustworthyData
|
||||
@ -34,6 +33,7 @@ abstract class FetchDataProtocol<T : NamedByHash, W : Any>(
|
||||
class HashNotFound(val requested: SecureHash) : BadAnswer()
|
||||
class DownloadedVsRequestedDataMismatch(val requested: SecureHash, val got: SecureHash) : BadAnswer()
|
||||
|
||||
class Request(val hashes: List<SecureHash>, replyTo: SingleMessageRecipient, sessionID: Long) : AbstractRequestMessage(replyTo, sessionID)
|
||||
data class Result<T : NamedByHash>(val fromDisk: List<T>, val downloaded: List<T>)
|
||||
|
||||
protected abstract val queryTopic: String
|
||||
@ -49,7 +49,7 @@ abstract class FetchDataProtocol<T : NamedByHash, W : Any>(
|
||||
logger.trace("Requesting ${toFetch.size} dependency(s) for verification")
|
||||
|
||||
val sid = random63BitValue()
|
||||
val fetchReq = DataVendingService.Request(toFetch, serviceHub.networkService.myAddress, sid)
|
||||
val fetchReq = Request(toFetch, serviceHub.networkService.myAddress, sid)
|
||||
// TODO: Support "large message" response streaming so response sizes are not limited by RAM.
|
||||
val maybeItems = sendAndReceive<ArrayList<W?>>(queryTopic, otherSide, 0, sid, fetchReq)
|
||||
// Check for a buggy/malicious peer answering with something that we didn't ask for.
|
||||
@ -98,4 +98,5 @@ abstract class FetchDataProtocol<T : NamedByHash, W : Any>(
|
||||
|
||||
answers
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package protocols
|
||||
|
||||
import core.SignedTransaction
|
||||
import core.contracts.SignedTransaction
|
||||
import core.crypto.SecureHash
|
||||
import core.messaging.SingleMessageRecipient
|
||||
|
118
core/src/main/kotlin/protocols/NotaryProtocol.kt
Normal file
118
core/src/main/kotlin/protocols/NotaryProtocol.kt
Normal file
@ -0,0 +1,118 @@
|
||||
package protocols
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import core.crypto.Party
|
||||
import core.contracts.TimestampCommand
|
||||
import core.contracts.WireTransaction
|
||||
import core.crypto.DigitalSignature
|
||||
import core.crypto.SignedData
|
||||
import core.messaging.SingleMessageRecipient
|
||||
import core.node.NodeInfo
|
||||
import core.node.services.UniquenessProvider
|
||||
import core.protocols.ProtocolLogic
|
||||
import core.random63BitValue
|
||||
import core.serialization.SerializedBytes
|
||||
import core.utilities.ProgressTracker
|
||||
import core.utilities.UntrustworthyData
|
||||
import java.security.PublicKey
|
||||
|
||||
/**
|
||||
* A protocol to be used for obtaining a signature from a [NotaryService] ascertaining the transaction
|
||||
* timestamp is correct and none of its inputs have been used in another completed transaction
|
||||
*
|
||||
* @throws NotaryException in case the any of the inputs to the transaction have been consumed
|
||||
* by another transaction or the timestamp is invalid
|
||||
*/
|
||||
class NotaryProtocol(private val wtx: WireTransaction,
|
||||
override val progressTracker: ProgressTracker = NotaryProtocol.tracker()) : ProtocolLogic<DigitalSignature.LegallyIdentifiable>() {
|
||||
companion object {
|
||||
val TOPIC = "platform.notary.request"
|
||||
|
||||
object REQUESTING : ProgressTracker.Step("Requesting signature by Notary service")
|
||||
|
||||
object VALIDATING : ProgressTracker.Step("Validating response from Notary service")
|
||||
|
||||
fun tracker() = ProgressTracker(REQUESTING, VALIDATING)
|
||||
}
|
||||
|
||||
lateinit var notaryNode: NodeInfo
|
||||
|
||||
@Suspendable
|
||||
override fun call(): DigitalSignature.LegallyIdentifiable {
|
||||
progressTracker.currentStep = REQUESTING
|
||||
notaryNode = findNotaryNode()
|
||||
|
||||
val sessionID = random63BitValue()
|
||||
val request = SignRequest(wtx.serialized, serviceHub.storageService.myLegalIdentity, serviceHub.networkService.myAddress, sessionID)
|
||||
val response = sendAndReceive<Result>(TOPIC, notaryNode.address, 0, sessionID, request)
|
||||
|
||||
val notaryResult = validateResponse(response)
|
||||
return notaryResult.sig ?: throw NotaryException(notaryResult.error!!)
|
||||
}
|
||||
|
||||
private fun validateResponse(response: UntrustworthyData<Result>): Result {
|
||||
progressTracker.currentStep = VALIDATING
|
||||
|
||||
response.validate {
|
||||
if (it.sig != null) validateSignature(it.sig, wtx.serialized)
|
||||
else if (it.error is NotaryError.Conflict) it.error.conflict.verified()
|
||||
else if (it.error == null || it.error !is NotaryError)
|
||||
throw IllegalStateException("Received invalid result from Notary service '${notaryNode.identity}'")
|
||||
return it
|
||||
}
|
||||
}
|
||||
|
||||
private fun validateSignature(sig: DigitalSignature.LegallyIdentifiable, data: SerializedBytes<WireTransaction>) {
|
||||
check(sig.signer == notaryNode.identity) { "Notary result not signed by the correct service" }
|
||||
sig.verifyWithECDSA(data)
|
||||
}
|
||||
|
||||
private fun findNotaryNode(): NodeInfo {
|
||||
var maybeNotaryKey: PublicKey? = null
|
||||
|
||||
val timestampCommand = wtx.commands.singleOrNull { it.value is TimestampCommand }
|
||||
if (timestampCommand != null) maybeNotaryKey = timestampCommand.signers.first()
|
||||
|
||||
for (stateRef in wtx.inputs) {
|
||||
val inputNotaryKey = serviceHub.loadState(stateRef).notary.owningKey
|
||||
if (maybeNotaryKey != null)
|
||||
check(maybeNotaryKey == inputNotaryKey) { "Input states and timestamp must have the same Notary" }
|
||||
else maybeNotaryKey = inputNotaryKey
|
||||
}
|
||||
|
||||
val notaryKey = maybeNotaryKey ?: throw IllegalStateException("Transaction does not specify a Notary")
|
||||
val notaryNode = serviceHub.networkMapCache.getNodeByPublicKey(notaryKey)
|
||||
return notaryNode ?: throw IllegalStateException("No Notary node can be found with the specified public key")
|
||||
}
|
||||
|
||||
/** TODO: The caller must authenticate instead of just specifying its identity */
|
||||
class SignRequest(val txBits: SerializedBytes<WireTransaction>,
|
||||
val callerIdentity: Party,
|
||||
replyTo: SingleMessageRecipient,
|
||||
sessionID: Long) : AbstractRequestMessage(replyTo, sessionID)
|
||||
|
||||
data class Result private constructor(val sig: DigitalSignature.LegallyIdentifiable?, val error: NotaryError?) {
|
||||
companion object {
|
||||
fun withError(error: NotaryError) = Result(null, error)
|
||||
fun noError(sig: DigitalSignature.LegallyIdentifiable) = Result(sig, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class NotaryException(val error: NotaryError) : Exception() {
|
||||
override fun toString() = "${super.toString()}: Error response from Notary - ${error.toString()}"
|
||||
}
|
||||
|
||||
sealed class NotaryError {
|
||||
class Conflict(val tx: WireTransaction, val conflict: SignedData<UniquenessProvider.Conflict>) : NotaryError() {
|
||||
override fun toString() = "One or more input states for transaction ${tx.id} have been used in another transaction"
|
||||
}
|
||||
|
||||
class MoreThanOneTimestamp : NotaryError()
|
||||
|
||||
/** Thrown if the timestamp command in the transaction doesn't list this Notary as a signer */
|
||||
class NotForMe : NotaryError()
|
||||
|
||||
/** Thrown if the time specified in the timestamp command is outside the allowed tolerance */
|
||||
class TimestampInvalid : NotaryError()
|
||||
}
|
@ -2,6 +2,10 @@ package protocols
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import core.*
|
||||
import core.contracts.Fix
|
||||
import core.contracts.FixOf
|
||||
import core.contracts.TransactionBuilder
|
||||
import core.contracts.WireTransaction
|
||||
import core.crypto.DigitalSignature
|
||||
import core.messaging.SingleMessageRecipient
|
||||
import core.node.NodeInfo
|
@ -2,6 +2,7 @@ package protocols
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.SecureHash
|
||||
import core.messaging.SingleMessageRecipient
|
||||
import core.protocols.ProtocolLogic
|
@ -1,14 +1,15 @@
|
||||
package protocols
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import contracts.DealState
|
||||
import contracts.FixableDealState
|
||||
import core.*
|
||||
import core.contracts.*
|
||||
import core.crypto.DigitalSignature
|
||||
import core.crypto.Party
|
||||
import core.crypto.signWithECDSA
|
||||
import core.messaging.SingleMessageRecipient
|
||||
import core.node.NodeInfo
|
||||
import core.protocols.ProtocolLogic
|
||||
import core.random63BitValue
|
||||
import core.seconds
|
||||
import core.utilities.ProgressTracker
|
||||
import core.utilities.UntrustworthyData
|
||||
import core.utilities.trace
|
||||
@ -43,7 +44,7 @@ object TwoPartyDealProtocol {
|
||||
val sessionID: Long
|
||||
)
|
||||
|
||||
class SignaturesFromPrimary(val timestampAuthoritySig: DigitalSignature.WithKey, val sellerSig: DigitalSignature.WithKey)
|
||||
class SignaturesFromPrimary(val sellerSig: DigitalSignature.WithKey, val notarySig: DigitalSignature.LegallyIdentifiable)
|
||||
|
||||
/**
|
||||
* Abstracted bilateral deal protocol participant that initiates communication/handshake.
|
||||
@ -55,21 +56,19 @@ object TwoPartyDealProtocol {
|
||||
val otherSide: SingleMessageRecipient,
|
||||
val otherSessionID: Long,
|
||||
val myKeyPair: KeyPair,
|
||||
val timestampingAuthority: NodeInfo,
|
||||
val notaryNode: NodeInfo,
|
||||
override val progressTracker: ProgressTracker = Primary.tracker()) : ProtocolLogic<SignedTransaction>() {
|
||||
|
||||
companion object {
|
||||
object AWAITING_PROPOSAL : ProgressTracker.Step("Handshaking and awaiting transaction proposal")
|
||||
object VERIFYING : ProgressTracker.Step("Verifying proposed transaction")
|
||||
object SIGNING : ProgressTracker.Step("Signing transaction")
|
||||
object TIMESTAMPING : ProgressTracker.Step("Timestamping transaction")
|
||||
object NOTARY : ProgressTracker.Step("Getting notary signature")
|
||||
object SENDING_SIGS : ProgressTracker.Step("Sending transaction signatures to other party")
|
||||
object RECORDING : ProgressTracker.Step("Recording completed transaction")
|
||||
object COPYING_TO_REGULATOR : ProgressTracker.Step("Copying regulator")
|
||||
|
||||
fun tracker() = ProgressTracker(AWAITING_PROPOSAL, VERIFYING, SIGNING, TIMESTAMPING, SENDING_SIGS, RECORDING, COPYING_TO_REGULATOR).apply {
|
||||
childrenFor[TIMESTAMPING] = TimestampingProtocol.tracker()
|
||||
}
|
||||
fun tracker() = ProgressTracker(AWAITING_PROPOSAL, VERIFYING, SIGNING, NOTARY, SENDING_SIGS, RECORDING, COPYING_TO_REGULATOR)
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
@ -95,7 +94,7 @@ object TwoPartyDealProtocol {
|
||||
|
||||
// Check that the tx proposed by the buyer is valid.
|
||||
val missingSigs = it.verify(throwIfSignaturesAreMissing = false)
|
||||
if (missingSigs != setOf(myKeyPair.public, timestampingAuthority.identity.owningKey))
|
||||
if (missingSigs != setOf(myKeyPair.public, notaryNode.identity.owningKey))
|
||||
throw SignatureException("The set of missing signatures is not as expected: $missingSigs")
|
||||
|
||||
val wtx: WireTransaction = it.tx
|
||||
@ -130,13 +129,13 @@ object TwoPartyDealProtocol {
|
||||
|
||||
@Suspendable
|
||||
override fun call(): SignedTransaction {
|
||||
val partialTX: SignedTransaction = verifyPartialTransaction(getPartialTransaction())
|
||||
val stx: SignedTransaction = verifyPartialTransaction(getPartialTransaction())
|
||||
|
||||
// These two steps could be done in parallel, in theory. Our framework doesn't support that yet though.
|
||||
val ourSignature = signWithOurKey(partialTX)
|
||||
val tsaSig = timestamp(partialTX)
|
||||
val ourSignature = signWithOurKey(stx)
|
||||
val notarySignature = getNotarySignature(stx)
|
||||
|
||||
val fullySigned = sendSignatures(partialTX, ourSignature, tsaSig)
|
||||
val fullySigned = sendSignatures(stx, ourSignature, notarySignature)
|
||||
|
||||
progressTracker.currentStep = RECORDING
|
||||
|
||||
@ -157,12 +156,11 @@ object TwoPartyDealProtocol {
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
private fun timestamp(partialTX: SignedTransaction): DigitalSignature.LegallyIdentifiable {
|
||||
progressTracker.currentStep = TIMESTAMPING
|
||||
return subProtocol(TimestampingProtocol(timestampingAuthority, partialTX.txBits, progressTracker.childrenFor[TIMESTAMPING]!!))
|
||||
private fun getNotarySignature(stx: SignedTransaction): DigitalSignature.LegallyIdentifiable {
|
||||
progressTracker.currentStep = NOTARY
|
||||
return subProtocol(NotaryProtocol(stx.tx))
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
open fun signWithOurKey(partialTX: SignedTransaction): DigitalSignature.WithKey {
|
||||
progressTracker.currentStep = SIGNING
|
||||
return myKeyPair.signWithECDSA(partialTX.txBits)
|
||||
@ -170,13 +168,13 @@ object TwoPartyDealProtocol {
|
||||
|
||||
@Suspendable
|
||||
private fun sendSignatures(partialTX: SignedTransaction, ourSignature: DigitalSignature.WithKey,
|
||||
tsaSig: DigitalSignature.LegallyIdentifiable): SignedTransaction {
|
||||
notarySignature: DigitalSignature.LegallyIdentifiable): SignedTransaction {
|
||||
progressTracker.currentStep = SENDING_SIGS
|
||||
val fullySigned = partialTX + tsaSig + ourSignature
|
||||
val fullySigned = partialTX + ourSignature + notarySignature
|
||||
|
||||
logger.trace { "Built finished transaction, sending back to other party!" }
|
||||
|
||||
send(DEAL_TOPIC, otherSide, otherSessionID, SignaturesFromPrimary(tsaSig, ourSignature))
|
||||
send(DEAL_TOPIC, otherSide, otherSessionID, SignaturesFromPrimary(ourSignature, notarySignature))
|
||||
return fullySigned
|
||||
}
|
||||
}
|
||||
@ -189,7 +187,7 @@ object TwoPartyDealProtocol {
|
||||
* and helper methods etc.
|
||||
*/
|
||||
abstract class Secondary<U>(val otherSide: SingleMessageRecipient,
|
||||
val timestampingAuthority: Party,
|
||||
val notary: Party,
|
||||
val sessionID: Long,
|
||||
override val progressTracker: ProgressTracker = Secondary.tracker()) : ProtocolLogic<SignedTransaction>() {
|
||||
|
||||
@ -214,7 +212,9 @@ object TwoPartyDealProtocol {
|
||||
val signatures = swapSignaturesWithPrimary(stx, handshake.sessionID)
|
||||
|
||||
logger.trace { "Got signatures from other party, verifying ... " }
|
||||
val fullySigned = stx + signatures.timestampAuthoritySig + signatures.sellerSig
|
||||
|
||||
verifyCorrectNotary(stx.tx, signatures.notarySig)
|
||||
val fullySigned = stx + signatures.sellerSig + signatures.notarySig
|
||||
fullySigned.verify()
|
||||
|
||||
logger.trace { "Signatures received are valid. Deal transaction complete! :-)" }
|
||||
@ -258,6 +258,12 @@ object TwoPartyDealProtocol {
|
||||
return ptx.toSignedTransaction(checkSufficientSignatures = false)
|
||||
}
|
||||
|
||||
private fun verifyCorrectNotary(wtx: WireTransaction, sig: DigitalSignature.LegallyIdentifiable) {
|
||||
if (wtx.inputs.isEmpty()) return // Can choose any Notary if there are no inputs
|
||||
val notary = serviceHub.loadState(wtx.inputs.first()).notary
|
||||
check(sig.signer == notary) { "Transaction not signed by the required Notary" }
|
||||
}
|
||||
|
||||
@Suspendable protected abstract fun validateHandshake(handshake: Handshake<U>): Handshake<U>
|
||||
@Suspendable protected abstract fun assembleSharedTX(handshake: Handshake<U>): Pair<TransactionBuilder, List<PublicKey>>
|
||||
}
|
||||
@ -266,22 +272,20 @@ object TwoPartyDealProtocol {
|
||||
* One side of the protocol for inserting a pre-agreed deal.
|
||||
*/
|
||||
open class Instigator<T : DealState>(otherSide: SingleMessageRecipient,
|
||||
timestampingAuthority: NodeInfo,
|
||||
notaryNode: NodeInfo,
|
||||
dealBeingOffered: T,
|
||||
myKeyPair: KeyPair,
|
||||
buyerSessionID: Long,
|
||||
override val progressTracker: ProgressTracker = Primary.tracker()) : Primary<T>(dealBeingOffered, otherSide, buyerSessionID, myKeyPair, timestampingAuthority)
|
||||
override val progressTracker: ProgressTracker = Primary.tracker()) : Primary<T>(dealBeingOffered, otherSide, buyerSessionID, myKeyPair, notaryNode)
|
||||
|
||||
/**
|
||||
* One side of the protocol for inserting a pre-agreed deal.
|
||||
*/
|
||||
open class Acceptor<T : DealState>(otherSide: SingleMessageRecipient,
|
||||
timestampingAuthority: Party,
|
||||
notary: Party,
|
||||
val dealToBuy: T,
|
||||
sessionID: Long,
|
||||
override val progressTracker: ProgressTracker = Secondary.tracker()) : Secondary<T>(otherSide, timestampingAuthority, sessionID) {
|
||||
|
||||
@Suspendable
|
||||
override val progressTracker: ProgressTracker = Secondary.tracker()) : Secondary<T>(otherSide, notary, sessionID) {
|
||||
override fun validateHandshake(handshake: Handshake<T>): Handshake<T> {
|
||||
with(handshake) {
|
||||
// What is the seller trying to sell us?
|
||||
@ -309,13 +313,12 @@ object TwoPartyDealProtocol {
|
||||
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
override fun assembleSharedTX(handshake: Handshake<T>): Pair<TransactionBuilder, List<PublicKey>> {
|
||||
val ptx = handshake.payload.generateAgreement()
|
||||
|
||||
// And add a request for timestamping: it may be that none of the contracts need this! But it can't hurt
|
||||
// to have one.
|
||||
ptx.setTime(serviceHub.clock.instant(), timestampingAuthority, 30.seconds)
|
||||
ptx.setTime(serviceHub.clock.instant(), notary, 30.seconds)
|
||||
return Pair(ptx, arrayListOf(handshake.payload.parties.single { it.name == serviceHub.storageService.myLegalIdentity.name }.owningKey))
|
||||
}
|
||||
|
||||
@ -329,10 +332,10 @@ object TwoPartyDealProtocol {
|
||||
* who does what in the protocol.
|
||||
*/
|
||||
open class Fixer<T : FixableDealState>(otherSide: SingleMessageRecipient,
|
||||
timestampingAuthority: Party,
|
||||
notary: Party,
|
||||
val dealToFix: StateAndRef<T>,
|
||||
sessionID: Long,
|
||||
val replacementProgressTracker: ProgressTracker? = null) : Secondary<StateRef>(otherSide, timestampingAuthority, sessionID) {
|
||||
val replacementProgressTracker: ProgressTracker? = null) : Secondary<StateRef>(otherSide, notary, sessionID) {
|
||||
private val ratesFixTracker = RatesFixProtocol.tracker(dealToFix.state.nextFixingOf()!!.name)
|
||||
|
||||
override val progressTracker: ProgressTracker = replacementProgressTracker ?: createTracker()
|
||||
@ -341,7 +344,6 @@ object TwoPartyDealProtocol {
|
||||
childrenFor[SIGNING] = ratesFixTracker
|
||||
}
|
||||
|
||||
@Suspendable
|
||||
override fun validateHandshake(handshake: Handshake<StateRef>): Handshake<StateRef> {
|
||||
with(handshake) {
|
||||
logger.trace { "Got fixing request for: ${dealToFix.state}" }
|
||||
@ -379,7 +381,7 @@ object TwoPartyDealProtocol {
|
||||
|
||||
// And add a request for timestamping: it may be that none of the contracts need this! But it can't hurt
|
||||
// to have one.
|
||||
ptx.setTime(serviceHub.clock.instant(), timestampingAuthority, 30.seconds)
|
||||
ptx.setTime(serviceHub.clock.instant(), notary, 30.seconds)
|
||||
}
|
||||
}
|
||||
subProtocol(addFixing)
|
||||
@ -397,9 +399,9 @@ object TwoPartyDealProtocol {
|
||||
*/
|
||||
open class Floater<T : FixableDealState>(otherSide: SingleMessageRecipient,
|
||||
otherSessionID: Long,
|
||||
timestampingAuthority: NodeInfo,
|
||||
notary: NodeInfo,
|
||||
dealToFix: StateAndRef<T>,
|
||||
myKeyPair: KeyPair,
|
||||
val sessionID: Long,
|
||||
override val progressTracker: ProgressTracker = Primary.tracker()) : Primary<StateRef>(dealToFix.ref, otherSide, otherSessionID, myKeyPair, timestampingAuthority)
|
||||
override val progressTracker: ProgressTracker = Primary.tracker()) : Primary<StateRef>(dealToFix.ref, otherSide, otherSessionID, myKeyPair, notary)
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package core
|
||||
|
||||
import core.contracts.*
|
||||
import org.junit.Test
|
||||
import java.time.LocalDate
|
||||
import java.util.*
|
||||
|
@ -0,0 +1,79 @@
|
||||
package core.serialization
|
||||
|
||||
import com.esotericsoftware.kryo.DefaultSerializer
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNotEquals
|
||||
|
||||
class SerializationTokenTest {
|
||||
|
||||
// Large tokenizable object so we can tell from the smaller number of serialized bytes it was actually tokenized
|
||||
@DefaultSerializer(SerializeAsTokenSerializer::class)
|
||||
private class LargeTokenizable(size: Int) : SerializeAsStringToken(size.toString()) {
|
||||
val bytes = OpaqueBytes(ByteArray(size))
|
||||
|
||||
override fun hashCode() = bytes.bits.size
|
||||
|
||||
override fun equals(other: Any?) = other is LargeTokenizable && other.bytes.bits.size == this.bytes.bits.size
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `write token and read tokenizable`() {
|
||||
val numBytes = 1024
|
||||
val tokenizableBefore = LargeTokenizable(numBytes)
|
||||
val serializedBytes = tokenizableBefore.serialize()
|
||||
assertThat(serializedBytes.size).isLessThan(numBytes)
|
||||
val tokenizableAfter = serializedBytes.deserialize()
|
||||
assertEquals(tokenizableBefore, tokenizableAfter)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check same sized tokenizable equal`() {
|
||||
val tokenizableBefore = LargeTokenizable(1024)
|
||||
val tokenizableAfter = LargeTokenizable(1024)
|
||||
assertEquals(tokenizableBefore, tokenizableAfter)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `check different sized tokenizable not equal`() {
|
||||
val tokenizableBefore = LargeTokenizable(1024)
|
||||
val tokenizableAfter = LargeTokenizable(1025)
|
||||
assertNotEquals(tokenizableBefore, tokenizableAfter)
|
||||
}
|
||||
|
||||
@DefaultSerializer(SerializeAsTokenSerializer::class)
|
||||
private class IntegerSerializeAsKeyedToken(val value: Int) : SerializeAsStringToken(value.toString())
|
||||
|
||||
@Test
|
||||
fun `write and read keyed`() {
|
||||
val tokenizableBefore1 = IntegerSerializeAsKeyedToken(123)
|
||||
val tokenizableBefore2 = IntegerSerializeAsKeyedToken(456)
|
||||
|
||||
val serializedBytes1 = tokenizableBefore1.serialize()
|
||||
val tokenizableAfter1 = serializedBytes1.deserialize()
|
||||
val serializedBytes2 = tokenizableBefore2.serialize()
|
||||
val tokenizableAfter2 = serializedBytes2.deserialize()
|
||||
|
||||
assertThat(tokenizableAfter1).isSameAs(tokenizableBefore1)
|
||||
assertThat(tokenizableAfter2).isSameAs(tokenizableBefore2)
|
||||
}
|
||||
|
||||
@DefaultSerializer(SerializeAsTokenSerializer::class)
|
||||
private class UnitSerializeAsSingletonToken : SerializeAsStringToken("Unit0")
|
||||
|
||||
@Test
|
||||
fun `write and read singleton`() {
|
||||
val tokenizableBefore = UnitSerializeAsSingletonToken()
|
||||
val serializedBytes = tokenizableBefore.serialize()
|
||||
val tokenizableAfter = serializedBytes.deserialize()
|
||||
assertThat(tokenizableAfter).isSameAs(tokenizableBefore)
|
||||
}
|
||||
|
||||
private class UnannotatedSerializeAsSingletonToken : SerializeAsStringToken("Unannotated0")
|
||||
|
||||
@Test(expected = IllegalStateException::class)
|
||||
fun `unannotated throws`() {
|
||||
val tokenizableBefore = UnannotatedSerializeAsSingletonToken()
|
||||
}
|
||||
}
|
@ -200,7 +200,7 @@ Let's define a few commands now:
|
||||
|
||||
.. sourcecode:: java
|
||||
|
||||
public static class Commands implements core.Command {
|
||||
public static class Commands implements core.contract.Command {
|
||||
public static class Move extends Commands {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
84
docs/build/html/api/alltypes/index.html
vendored
84
docs/build/html/api/alltypes/index.html
vendored
@ -61,7 +61,7 @@ fields such as replyTo and replyToTopic.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-accrual-adjustment/index.html">core.AccrualAdjustment</a></td>
|
||||
<a href="../core/-accrual-adjustment/index.html">core.contracts.AccrualAdjustment</a></td>
|
||||
<td>
|
||||
<p>Simple enum for returning accurals adjusted or unadjusted.
|
||||
We dont actually do anything with this yet though, so its ignored for now.</p>
|
||||
@ -91,7 +91,7 @@ for ensuring code runs on the right thread, and also for unit testing.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-amount/index.html">core.Amount</a></td>
|
||||
<a href="../core/-amount/index.html">core.contracts.Amount</a></td>
|
||||
<td>
|
||||
<p>Amount represents a positive quantity of currency, measured in pennies, which are the smallest representable units.</p>
|
||||
</td>
|
||||
@ -108,7 +108,7 @@ as well.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-attachment/index.html">core.Attachment</a></td>
|
||||
<a href="../core/-attachment/index.html">core.contracts.Attachment</a></td>
|
||||
<td>
|
||||
<p>An attachment is a ZIP (or an optionally signed JAR) that contains one or more files. Attachments are meant to
|
||||
contain public static data which can be referenced from transactions and utilised from contracts. Good examples
|
||||
@ -142,7 +142,7 @@ file paths.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-authenticated-object/index.html">core.AuthenticatedObject</a></td>
|
||||
<a href="../core/-authenticated-object/index.html">core.contracts.AuthenticatedObject</a></td>
|
||||
<td>
|
||||
<p>Wraps an object that was signed by a public key, which may be a well known/recognised institutional key.</p>
|
||||
</td>
|
||||
@ -164,7 +164,7 @@ API call from a single party without bi-directional access to the database of of
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-business-calendar/index.html">core.BusinessCalendar</a></td>
|
||||
<a href="../core/-business-calendar/index.html">core.contracts.BusinessCalendar</a></td>
|
||||
<td>
|
||||
<p>A business calendar performs date calculations that take into account national holidays and weekends. This is a
|
||||
typical feature of financial contracts, in which a business may not want a payment event to fall on a day when
|
||||
@ -215,14 +215,14 @@ the same transaction.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-command/index.html">core.Command</a></td>
|
||||
<a href="../core/-command/index.html">core.contracts.Command</a></td>
|
||||
<td>
|
||||
<p>Command data/content plus pubkey pair: the signature is stored at the end of the serialized bytes</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-command-data.html">core.CommandData</a></td>
|
||||
<a href="../core/-command-data.html">core.contracts.CommandData</a></td>
|
||||
<td>
|
||||
<p>Marker interface for classes that represent commands</p>
|
||||
</td>
|
||||
@ -249,7 +249,7 @@ and to organise serializers / deserializers for java.time.* classes as necessary
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-contract/index.html">core.Contract</a></td>
|
||||
<a href="../core/-contract/index.html">core.contracts.Contract</a></td>
|
||||
<td>
|
||||
<p>Implemented by a program that implements business logic on the shared ledger. All participants run this code for
|
||||
every <a href="../core/-ledger-transaction/index.html">LedgerTransaction</a> they see on the network, for every input and output state. All contracts must accept the
|
||||
@ -278,7 +278,7 @@ timestamp attached to the transaction itself i.e. it is NOT necessarily the curr
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-contract-state/index.html">core.ContractState</a></td>
|
||||
<a href="../core/-contract-state/index.html">core.contracts.ContractState</a></td>
|
||||
<td>
|
||||
<p>A contract state (or just "state") contains opaque data used by a contract program. It can be thought of as a disk
|
||||
file that the program can use to persist data across transactions. States are immutable: once created they are never
|
||||
@ -318,7 +318,7 @@ glue that sits between the network layer and the database layer.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-date-offset/index.html">core.DateOffset</a></td>
|
||||
<a href="../core/-date-offset/index.html">core.contracts.DateOffset</a></td>
|
||||
<td>
|
||||
<p>Date offset that the fixing is done prior to the accrual start date.
|
||||
Currently not used in the calculation.</p>
|
||||
@ -326,7 +326,7 @@ Currently not used in the calculation.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-date-roll-convention/index.html">core.DateRollConvention</a></td>
|
||||
<a href="../core/-date-roll-convention/index.html">core.contracts.DateRollConvention</a></td>
|
||||
<td>
|
||||
<p>This reflects what happens if a date on which a business event is supposed to happen actually falls upon a non-working day
|
||||
Depending on the accounting requirement, we can move forward until we get to a business day, or backwards
|
||||
@ -335,7 +335,7 @@ There are some additional rules which are explained in the individual cases belo
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-date-roll-direction/index.html">core.DateRollDirection</a></td>
|
||||
<a href="../core/-date-roll-direction/index.html">core.contracts.DateRollDirection</a></td>
|
||||
<td>
|
||||
<p>This is utilised in the <a href="../core/-date-roll-convention/index.html">DateRollConvention</a> class to determine which way we should initially step when
|
||||
finding a business day</p>
|
||||
@ -343,7 +343,7 @@ finding a business day</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-day-count-basis-day/index.html">core.DayCountBasisDay</a></td>
|
||||
<a href="../core/-day-count-basis-day/index.html">core.contracts.DayCountBasisDay</a></td>
|
||||
<td>
|
||||
<p>This forms the day part of the "Day Count Basis" used for interest calculation.
|
||||
Note that the first character cannot be a number (enum naming constraints), so we drop that
|
||||
@ -352,7 +352,7 @@ in the toString lest some people get confused.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-day-count-basis-year/index.html">core.DayCountBasisYear</a></td>
|
||||
<a href="../core/-day-count-basis-year/index.html">core.contracts.DayCountBasisYear</a></td>
|
||||
<td>
|
||||
<p>This forms the year part of the "Day Count Basis" used for interest calculation.</p>
|
||||
</td>
|
||||
@ -434,20 +434,20 @@ building partially signed transactions.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-expression/index.html">core.Expression</a></td>
|
||||
<a href="../core/-expression/index.html">core.contracts.Expression</a></td>
|
||||
<td>
|
||||
<p>Represents a textual expression of e.g. a formula</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-expression-deserializer/index.html">core.ExpressionDeserializer</a></td>
|
||||
<a href="../core/-expression-deserializer/index.html">core.contracts.ExpressionDeserializer</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-expression-serializer/index.html">core.ExpressionSerializer</a></td>
|
||||
<a href="../core/-expression-serializer/index.html">core.contracts.ExpressionSerializer</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
@ -475,14 +475,14 @@ attachments are saved to local storage automatically.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-fix/index.html">core.Fix</a></td>
|
||||
<a href="../core/-fix/index.html">core.contracts.Fix</a></td>
|
||||
<td>
|
||||
<p>A <a href="../core/-fix/index.html">Fix</a> represents a named interest rate, on a given day, for a given duration. It can be embedded in a tx.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-fix-of/index.html">core.FixOf</a></td>
|
||||
<a href="../core/-fix-of/index.html">core.contracts.FixOf</a></td>
|
||||
<td>
|
||||
<p>A <a href="../core/-fix-of/index.html">FixOf</a> identifies the question side of a fix: what day, tenor and type of fix ("LIBOR", "EURIBOR" etc)</p>
|
||||
</td>
|
||||
@ -526,7 +526,7 @@ If the rate is null returns a zero payment. // TODO: Is this the desired behavio
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-frequency/index.html">core.Frequency</a></td>
|
||||
<a href="../core/-frequency/index.html">core.contracts.Frequency</a></td>
|
||||
<td>
|
||||
<p>Frequency at which an event occurs - the enumerator also casts to an integer specifying the number of times per year
|
||||
that would divide into (eg annually = 1, semiannual = 2, monthly = 12 etc).</p>
|
||||
@ -671,7 +671,7 @@ call out to a hardware security module that enforces various auditing and freque
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-ledger-transaction/index.html">core.LedgerTransaction</a></td>
|
||||
<a href="../core/-ledger-transaction/index.html">core.contracts.LedgerTransaction</a></td>
|
||||
<td>
|
||||
<p>A LedgerTransaction wraps the data needed to calculate one or more successor states from a set of input states.
|
||||
It is the first step after extraction from a WireTransaction. The signatures at this point have been lined up
|
||||
@ -687,7 +687,7 @@ with the commands from the wire, and verified/looked up.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-linear-state/index.html">core.LinearState</a></td>
|
||||
<a href="../core/-linear-state/index.html">core.contracts.LinearState</a></td>
|
||||
<td>
|
||||
<p>A state that evolves by superseding itself, all of which share the common "thread"</p>
|
||||
</td>
|
||||
@ -798,7 +798,7 @@ This is not an interface because it is too lightweight to bother mocking out.</p
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-named-by-hash/index.html">core.NamedByHash</a></td>
|
||||
<a href="../core/-named-by-hash/index.html">core.contracts.NamedByHash</a></td>
|
||||
<td>
|
||||
<p>Implemented by anything that can be named by a secure hash value (e.g. transactions, attachments).</p>
|
||||
</td>
|
||||
@ -918,20 +918,20 @@ functionality to Java, but it wont arrive for a few years yet</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-ownable-state/index.html">core.OwnableState</a></td>
|
||||
<a href="../core/-ownable-state/index.html">core.contracts.OwnableState</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-party/index.html">core.Party</a></td>
|
||||
<a href="../core/-party/index.html">core.crypto.Party</a></td>
|
||||
<td>
|
||||
<p>A <a href="../core/-party/index.html">Party</a> is well known (name, pubkey) pair. In a real system this would probably be an X.509 certificate.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-party-and-reference/index.html">core.PartyAndReference</a></td>
|
||||
<a href="../core/-party-and-reference/index.html">core.contracts.PartyAndReference</a></td>
|
||||
<td>
|
||||
<p>Reference to something being stored or issued by a party e.g. in a vault or (more likely) on their normal
|
||||
ledger. The reference is intended to be encrypted so its meaningless to anyone other than the party.</p>
|
||||
@ -952,7 +952,7 @@ ledger. The reference is intended to be encrypted so its meaningless to anyone o
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-payment-rule/index.html">core.PaymentRule</a></td>
|
||||
<a href="../core/-payment-rule/index.html">core.contracts.PaymentRule</a></td>
|
||||
<td>
|
||||
<p>Whether the payment should be made before the due date, or after it.</p>
|
||||
</td>
|
||||
@ -1110,7 +1110,7 @@ e.g. LIBOR 6M as of 17 March 2016. Hence it requires a source (name) and a value
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-requirements/index.html">core.Requirements</a></td>
|
||||
<a href="../core/-requirements/index.html">core.contracts.Requirements</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1180,7 +1180,7 @@ contained within.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-signed-transaction/index.html">core.SignedTransaction</a></td>
|
||||
<a href="../core/-signed-transaction/index.html">core.contracts.SignedTransaction</a></td>
|
||||
<td>
|
||||
<p>Container for a <a href="../core/-wire-transaction/index.html">WireTransaction</a> and attached signatures.</p>
|
||||
</td>
|
||||
@ -1215,7 +1215,7 @@ Points at which polynomial pieces connect are known as <emph>knots</emph>.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-state-and-ref/index.html">core.StateAndRef</a></td>
|
||||
<a href="../core/-state-and-ref/index.html">core.contracts.StateAndRef</a></td>
|
||||
<td>
|
||||
<p>A StateAndRef is simply a (state, ref) pair. For instance, a wallet (which holds available assets) contains these.</p>
|
||||
</td>
|
||||
@ -1230,7 +1230,7 @@ Each such object represents an instantiation of a (two-party) protocol that has
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-state-ref/index.html">core.StateRef</a></td>
|
||||
<a href="../core/-state-ref/index.html">core.contracts.StateRef</a></td>
|
||||
<td>
|
||||
<p>A stateref is a pointer (reference) to a state, this is an equivalent of an "outpoint" in Bitcoin. It records which
|
||||
transaction defined the state and where in that transaction it was.</p>
|
||||
@ -1278,7 +1278,7 @@ anything like that, this interface is only big enough to support the prototyping
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-tenor/index.html">core.Tenor</a></td>
|
||||
<a href="../core/-tenor/index.html">core.contracts.Tenor</a></td>
|
||||
<td>
|
||||
<p>Placeholder class for the Tenor datatype - which is a standardised duration of time until maturity</p>
|
||||
</td>
|
||||
@ -1295,7 +1295,7 @@ way that ensures itll be released if theres an exception.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-timestamp-command/index.html">core.TimestampCommand</a></td>
|
||||
<a href="../core/-timestamp-command/index.html">core.contracts.TimestampCommand</a></td>
|
||||
<td>
|
||||
<p>If present in a transaction, contains a time that was verified by the timestamping authority/authorities whose
|
||||
public keys are identified in the containing <a href="../core/-command/index.html">Command</a> object. The true time must be between (after, before)</p>
|
||||
@ -1362,7 +1362,7 @@ then B and C trade with each other, then C and A etc).</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-transaction-builder/index.html">core.TransactionBuilder</a></td>
|
||||
<a href="../core/-transaction-builder/index.html">core.contracts.TransactionBuilder</a></td>
|
||||
<td>
|
||||
<p>A TransactionBuilder is a transaction class thats mutable (unlike the others which are all immutable). It is
|
||||
intended to be passed around contracts that may edit it by adding new states/commands or modifying the existing set.
|
||||
@ -1372,20 +1372,20 @@ multiple parties.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-transaction-conflict-exception/index.html">core.TransactionConflictException</a></td>
|
||||
<a href="../core/-transaction-conflict-exception/index.html">core.contracts.TransactionConflictException</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-transaction-for-verification/index.html">core.TransactionForVerification</a></td>
|
||||
<a href="../core/-transaction-for-verification/index.html">core.contracts.TransactionForVerification</a></td>
|
||||
<td>
|
||||
<p>A transaction in fully resolved and sig-checked form, ready for passing as input to a verification function.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-transaction-graph-search/index.html">core.TransactionGraphSearch</a></td>
|
||||
<a href="../core/-transaction-graph-search/index.html">core.contracts.TransactionGraphSearch</a></td>
|
||||
<td>
|
||||
<p>Given a map of transaction id to <a href="../core/-signed-transaction/index.html">SignedTransaction</a>, performs a breadth first search of the dependency graph from
|
||||
the starting point down in order to find transactions that match the given query criteria.</p>
|
||||
@ -1393,7 +1393,7 @@ the starting point down in order to find transactions that match the given query
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-transaction-group/index.html">core.TransactionGroup</a></td>
|
||||
<a href="../core/-transaction-group/index.html">core.contracts.TransactionGroup</a></td>
|
||||
<td>
|
||||
<p>A TransactionGroup defines a directed acyclic graph of transactions that can be resolved with each other and then
|
||||
verified. Successful verification does not imply the non-existence of other conflicting transactions: simply that
|
||||
@ -1402,13 +1402,13 @@ this subgraph does not contain conflicts and is accepted by the involved contrac
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-transaction-resolution-exception/index.html">core.TransactionResolutionException</a></td>
|
||||
<a href="../core/-transaction-resolution-exception/index.html">core.contracts.TransactionResolutionException</a></td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-transaction-verification-exception/index.html">core.TransactionVerificationException</a></td>
|
||||
<a href="../core/-transaction-verification-exception/index.html">core.contracts.TransactionVerificationException</a></td>
|
||||
<td>
|
||||
<p>Thrown if a verification fails due to a contract rejection.</p>
|
||||
</td>
|
||||
@ -1439,7 +1439,7 @@ and seller) and the following steps:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-type-only-command-data/index.html">core.TypeOnlyCommandData</a></td>
|
||||
<a href="../core/-type-only-command-data/index.html">core.contracts.TypeOnlyCommandData</a></td>
|
||||
<td>
|
||||
<p>Commands that inherit from this are intended to have no data items: its only their presence that matters.</p>
|
||||
</td>
|
||||
@ -1506,7 +1506,7 @@ consumed by someone else first</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="../core/-wire-transaction/index.html">core.WireTransaction</a></td>
|
||||
<a href="../core/-wire-transaction/index.html">core.contracts.WireTransaction</a></td>
|
||||
<td>
|
||||
<p>Transaction ready for serialisation, without any signatures attached.</p>
|
||||
</td>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">api</a> / <a href="index.html">APIServerImpl</a> / <a href=".">commitTransaction</a><br/>
|
||||
<br/>
|
||||
<h1>commitTransaction</h1>
|
||||
<a name="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">commitTransaction</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/signatures">signatures</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-secure-hash/index.html"><span class="identifier">SecureHash</span></a></code><br/>
|
||||
<a name="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">commitTransaction</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/signatures">signatures</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-secure-hash/index.html"><span class="identifier">SecureHash</span></a></code><br/>
|
||||
Overrides <a href="../-a-p-i-server/commit-transaction.html">APIServer.commitTransaction</a><br/>
|
||||
<p>Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be
|
||||
successful, otherwise exception is thrown.</p>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">api</a> / <a href="index.html">APIServerImpl</a> / <a href=".">fetchStates</a><br/>
|
||||
<br/>
|
||||
<h1>fetchStates</h1>
|
||||
<a name="api.APIServerImpl$fetchStates(kotlin.collections.List((core.StateRef)))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">fetchStates</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$fetchStates(kotlin.collections.List((core.StateRef)))/states">states</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Map</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">,</span> <a href="../../core/-contract-state/index.html"><span class="identifier">ContractState</span></a><span class="symbol">?</span><span class="symbol">></span></code><br/>
|
||||
<a name="api.APIServerImpl$fetchStates(kotlin.collections.List((core.contracts.StateRef)))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">fetchStates</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$fetchStates(kotlin.collections.List((core.contracts.StateRef)))/states">states</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Map</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">,</span> <a href="../../core/-contract-state/index.html"><span class="identifier">ContractState</span></a><span class="symbol">?</span><span class="symbol">></span></code><br/>
|
||||
Overrides <a href="../-a-p-i-server/fetch-states.html">APIServer.fetchStates</a><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">api</a> / <a href="index.html">APIServerImpl</a> / <a href=".">generateTransactionSignature</a><br/>
|
||||
<br/>
|
||||
<h1>generateTransactionSignature</h1>
|
||||
<a name="api.APIServerImpl$generateTransactionSignature(core.serialization.SerializedBytes((core.WireTransaction)))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateTransactionSignature</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$generateTransactionSignature(core.serialization.SerializedBytes((core.WireTransaction)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a></code><br/>
|
||||
<a name="api.APIServerImpl$generateTransactionSignature(core.serialization.SerializedBytes((core.contracts.WireTransaction)))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateTransactionSignature</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$generateTransactionSignature(core.serialization.SerializedBytes((core.contracts.WireTransaction)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a></code><br/>
|
||||
Overrides <a href="../-a-p-i-server/generate-transaction-signature.html">APIServer.generateTransactionSignature</a><br/>
|
||||
<p>Generate a signature for this transaction signed by us.</p>
|
||||
<br/>
|
||||
|
@ -48,7 +48,7 @@ which would automatically be passed as the first argument (wed need that to be a
|
||||
<td>
|
||||
<a href="commit-transaction.html">commitTransaction</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">commitTransaction</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/signatures">signatures</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-secure-hash/index.html"><span class="identifier">SecureHash</span></a></code><p>Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be
|
||||
<code><span class="keyword">fun </span><span class="identifier">commitTransaction</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="api.APIServerImpl$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/signatures">signatures</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-secure-hash/index.html"><span class="identifier">SecureHash</span></a></code><p>Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be
|
||||
successful, otherwise exception is thrown.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -63,7 +63,7 @@ successful, otherwise exception is thrown.</p>
|
||||
<td>
|
||||
<a href="fetch-states.html">fetchStates</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">fetchStates</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$fetchStates(kotlin.collections.List((core.StateRef)))/states">states</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Map</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">,</span> <a href="../../core/-contract-state/index.html"><span class="identifier">ContractState</span></a><span class="symbol">?</span><span class="symbol">></span></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">fetchStates</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$fetchStates(kotlin.collections.List((core.contracts.StateRef)))/states">states</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Map</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">,</span> <a href="../../core/-contract-state/index.html"><span class="identifier">ContractState</span></a><span class="symbol">?</span><span class="symbol">></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@ -76,7 +76,7 @@ successful, otherwise exception is thrown.</p>
|
||||
<td>
|
||||
<a href="generate-transaction-signature.html">generateTransactionSignature</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateTransactionSignature</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$generateTransactionSignature(core.serialization.SerializedBytes((core.WireTransaction)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a></code><p>Generate a signature for this transaction signed by us.</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateTransactionSignature</span><span class="symbol">(</span><span class="identifier" id="api.APIServerImpl$generateTransactionSignature(core.serialization.SerializedBytes((core.contracts.WireTransaction)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a></code><p>Generate a signature for this transaction signed by us.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">api</a> / <a href="index.html">APIServer</a> / <a href=".">commitTransaction</a><br/>
|
||||
<br/>
|
||||
<h1>commitTransaction</h1>
|
||||
<a name="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))"></a>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">commitTransaction</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/signatures">signatures</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-secure-hash/index.html"><span class="identifier">SecureHash</span></a></code><br/>
|
||||
<a name="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))"></a>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">commitTransaction</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/signatures">signatures</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-secure-hash/index.html"><span class="identifier">SecureHash</span></a></code><br/>
|
||||
<p>Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be
|
||||
successful, otherwise exception is thrown.</p>
|
||||
<br/>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">api</a> / <a href="index.html">APIServer</a> / <a href=".">fetchStates</a><br/>
|
||||
<br/>
|
||||
<h1>fetchStates</h1>
|
||||
<a name="api.APIServer$fetchStates(kotlin.collections.List((core.StateRef)))"></a>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">fetchStates</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$fetchStates(kotlin.collections.List((core.StateRef)))/states">states</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Map</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">,</span> <a href="../../core/-contract-state/index.html"><span class="identifier">ContractState</span></a><span class="symbol">?</span><span class="symbol">></span></code><br/>
|
||||
<a name="api.APIServer$fetchStates(kotlin.collections.List((core.contracts.StateRef)))"></a>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">fetchStates</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$fetchStates(kotlin.collections.List((core.contracts.StateRef)))/states">states</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Map</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">,</span> <a href="../../core/-contract-state/index.html"><span class="identifier">ContractState</span></a><span class="symbol">?</span><span class="symbol">></span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">api</a> / <a href="index.html">APIServer</a> / <a href=".">generateTransactionSignature</a><br/>
|
||||
<br/>
|
||||
<h1>generateTransactionSignature</h1>
|
||||
<a name="api.APIServer$generateTransactionSignature(core.serialization.SerializedBytes((core.WireTransaction)))"></a>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">generateTransactionSignature</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$generateTransactionSignature(core.serialization.SerializedBytes((core.WireTransaction)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a></code><br/>
|
||||
<a name="api.APIServer$generateTransactionSignature(core.serialization.SerializedBytes((core.contracts.WireTransaction)))"></a>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">generateTransactionSignature</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$generateTransactionSignature(core.serialization.SerializedBytes((core.contracts.WireTransaction)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a></code><br/>
|
||||
<p>Generate a signature for this transaction signed by us.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -31,7 +31,7 @@ which would automatically be passed as the first argument (wed need that to be a
|
||||
<td>
|
||||
<a href="commit-transaction.html">commitTransaction</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">commitTransaction</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/signatures">signatures</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-secure-hash/index.html"><span class="identifier">SecureHash</span></a></code><p>Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">commitTransaction</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="api.APIServer$commitTransaction(core.serialization.SerializedBytes((core.contracts.WireTransaction)), kotlin.collections.List((core.crypto.DigitalSignature.WithKey)))/signatures">signatures</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-secure-hash/index.html"><span class="identifier">SecureHash</span></a></code><p>Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be
|
||||
successful, otherwise exception is thrown.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -46,7 +46,7 @@ successful, otherwise exception is thrown.</p>
|
||||
<td>
|
||||
<a href="fetch-states.html">fetchStates</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">fetchStates</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$fetchStates(kotlin.collections.List((core.StateRef)))/states">states</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Map</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">,</span> <a href="../../core/-contract-state/index.html"><span class="identifier">ContractState</span></a><span class="symbol">?</span><span class="symbol">></span></code></td>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">fetchStates</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$fetchStates(kotlin.collections.List((core.contracts.StateRef)))/states">states</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Map</span><span class="symbol"><</span><a href="../../core/-state-ref/index.html"><span class="identifier">StateRef</span></a><span class="symbol">,</span> <a href="../../core/-contract-state/index.html"><span class="identifier">ContractState</span></a><span class="symbol">?</span><span class="symbol">></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@ -59,7 +59,7 @@ successful, otherwise exception is thrown.</p>
|
||||
<td>
|
||||
<a href="generate-transaction-signature.html">generateTransactionSignature</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">generateTransactionSignature</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$generateTransactionSignature(core.serialization.SerializedBytes((core.WireTransaction)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a></code><p>Generate a signature for this transaction signed by us.</p>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">generateTransactionSignature</span><span class="symbol">(</span><span class="identifier" id="api.APIServer$generateTransactionSignature(core.serialization.SerializedBytes((core.contracts.WireTransaction)))/tx">tx</span><span class="symbol">:</span> <a href="../../core.serialization/-serialized-bytes/index.html"><span class="identifier">SerializedBytes</span></a><span class="symbol"><</span><a href="../../core/-wire-transaction/index.html"><span class="identifier">WireTransaction</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core.crypto/-digital-signature/-with-key/index.html"><span class="identifier">WithKey</span></a></code><p>Generate a signature for this transaction signed by us.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<a href="../../../index.html">contracts</a> / <a href="../../index.html">Cash</a> / <a href="../index.html">Commands</a> / <a href="index.html">Exit</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">Exit</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash.Commands.Exit$<init>(core.Amount)/amount">amount</span><span class="symbol">:</span> <a href="../../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">Exit</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash.Commands.Exit$<init>(core.contracts.Amount)/amount">amount</span><span class="symbol">:</span> <a href="../../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span></code><br/>
|
||||
<p>A command stating that money has been withdrawn from the shared ledger and is now accounted for
|
||||
in some other way.</p>
|
||||
<br/>
|
||||
|
@ -19,7 +19,7 @@ in some other way.</p>
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">Exit</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash.Commands.Exit$<init>(core.Amount)/amount">amount</span><span class="symbol">:</span> <a href="../../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span></code><p>A command stating that money has been withdrawn from the shared ledger and is now accounted for
|
||||
<code><span class="identifier">Exit</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash.Commands.Exit$<init>(core.contracts.Amount)/amount">amount</span><span class="symbol">:</span> <a href="../../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span></code><p>A command stating that money has been withdrawn from the shared ledger and is now accounted for
|
||||
in some other way.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<a href="../../../../core/-type-only-command-data/equals.html">equals</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.contracts.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<a href="../../index.html">contracts</a> / <a href="../index.html">Cash</a> / <a href="index.html">State</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash.State$<init>(core.PartyAndReference, core.Amount, java.security.PublicKey)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash.State$<init>(core.PartyAndReference, core.Amount, java.security.PublicKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash.State$<init>(core.PartyAndReference, core.Amount, java.security.PublicKey)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash.State$<init>(core.contracts.PartyAndReference, core.contracts.Amount, java.security.PublicKey)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash.State$<init>(core.contracts.PartyAndReference, core.contracts.Amount, java.security.PublicKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash.State$<init>(core.contracts.PartyAndReference, core.contracts.Amount, java.security.PublicKey)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span></code><br/>
|
||||
<p>A state representing a cash claim against some party</p>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash.State$<init>(core.PartyAndReference, core.Amount, java.security.PublicKey)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash.State$<init>(core.PartyAndReference, core.Amount, java.security.PublicKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash.State$<init>(core.PartyAndReference, core.Amount, java.security.PublicKey)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span></code><p>A state representing a cash claim against some party</p>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash.State$<init>(core.contracts.PartyAndReference, core.contracts.Amount, java.security.PublicKey)/deposit">deposit</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash.State$<init>(core.contracts.PartyAndReference, core.contracts.Amount, java.security.PublicKey)/amount">amount</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash.State$<init>(core.contracts.PartyAndReference, core.contracts.Amount, java.security.PublicKey)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span></code><p>A state representing a cash claim against some party</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">Cash</a> / <a href=".">generateIssue</a><br/>
|
||||
<br/>
|
||||
<h1>generateIssue</h1>
|
||||
<a name="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)/amount">amount</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)/at">at</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)/amount">amount</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)/at">at</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<p>Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">Cash</a> / <a href=".">generateSpend</a><br/>
|
||||
<br/>
|
||||
<h1>generateSpend</h1>
|
||||
<a name="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateSpend</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/amount">amount</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/to">to</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/cashStates">cashStates</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/onlyFromParties">onlyFromParties</span><span class="symbol">:</span> <span class="identifier">Set</span><span class="symbol"><</span><a href="../../core/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">></span><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">)</span><span class="symbol">: </span><span class="identifier">List</span><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">></span></code><br/>
|
||||
<a name="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateSpend</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/amount">amount</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/to">to</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/cashStates">cashStates</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/onlyFromParties">onlyFromParties</span><span class="symbol">:</span> <span class="identifier">Set</span><span class="symbol"><</span><a href="../../core/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">></span><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">)</span><span class="symbol">: </span><span class="identifier">List</span><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">></span></code><br/>
|
||||
<p>Generate a transaction that consumes one or more of the given input states to move money to the given pubkey.
|
||||
Note that the wallet list is not updated: its up to you to do that.</p>
|
||||
<h3>Parameters</h3>
|
||||
|
@ -73,14 +73,14 @@ the same transaction.</p>
|
||||
<td>
|
||||
<a href="generate-issue.html">generateIssue</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)/amount">amount</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)/at">at</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.TransactionBuilder, core.Amount, core.PartyAndReference, java.security.PublicKey)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)/amount">amount</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)/at">at</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateIssue(core.contracts.TransactionBuilder, core.contracts.Amount, core.contracts.PartyAndReference, java.security.PublicKey)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="generate-spend.html">generateSpend</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateSpend</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/amount">amount</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/to">to</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/cashStates">cashStates</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.TransactionBuilder, core.Amount, java.security.PublicKey, kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.Party)))/onlyFromParties">onlyFromParties</span><span class="symbol">:</span> <span class="identifier">Set</span><span class="symbol"><</span><a href="../../core/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">></span><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">)</span><span class="symbol">: </span><span class="identifier">List</span><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">></span></code><p>Generate a transaction that consumes one or more of the given input states to move money to the given pubkey.
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateSpend</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/amount">amount</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/to">to</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/cashStates">cashStates</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.Cash$generateSpend(core.contracts.TransactionBuilder, core.contracts.Amount, java.security.PublicKey, kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))), kotlin.collections.Set((core.crypto.Party)))/onlyFromParties">onlyFromParties</span><span class="symbol">:</span> <span class="identifier">Set</span><span class="symbol"><</span><a href="../../core/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">></span><span class="symbol">?</span> <span class="symbol">=</span> null<span class="symbol">)</span><span class="symbol">: </span><span class="identifier">List</span><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">></span></code><p>Generate a transaction that consumes one or more of the given input states to move money to the given pubkey.
|
||||
Note that the wallet list is not updated: its up to you to do that.</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -88,7 +88,7 @@ Note that the wallet list is not updated: its up to you to do that.</p>
|
||||
<td>
|
||||
<a href="verify.html">verify</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$verify(core.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>This is the function EVERYONE runs</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$verify(core.contracts.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>This is the function EVERYONE runs</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">Cash</a> / <a href=".">verify</a><br/>
|
||||
<br/>
|
||||
<h1>verify</h1>
|
||||
<a name="contracts.Cash$verify(core.TransactionForVerification)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$verify(core.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="contracts.Cash$verify(core.contracts.TransactionForVerification)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.Cash$verify(core.contracts.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
Overrides <a href="../../core/-contract/verify.html">Contract.verify</a><br/>
|
||||
<p>This is the function EVERYONE runs</p>
|
||||
<br/>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<a href="../../../../core/-type-only-command-data/equals.html">equals</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.contracts.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<a href="../../../../core/-type-only-command-data/equals.html">equals</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.contracts.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<a href="../../../../core/-type-only-command-data/equals.html">equals</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.contracts.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<a href="../../index.html">contracts</a> / <a href="../index.html">CommercialPaper</a> / <a href="index.html">State</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.PartyAndReference, java.security.PublicKey, core.Amount, java.time.Instant)/issuance">issuance</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.PartyAndReference, java.security.PublicKey, core.Amount, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.PartyAndReference, java.security.PublicKey, core.Amount, java.time.Instant)/faceValue">faceValue</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.PartyAndReference, java.security.PublicKey, core.Amount, java.time.Instant)/maturityDate">maturityDate</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.contracts.PartyAndReference, java.security.PublicKey, core.contracts.Amount, java.time.Instant)/issuance">issuance</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.contracts.PartyAndReference, java.security.PublicKey, core.contracts.Amount, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.contracts.PartyAndReference, java.security.PublicKey, core.contracts.Amount, java.time.Instant)/faceValue">faceValue</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.contracts.PartyAndReference, java.security.PublicKey, core.contracts.Amount, java.time.Instant)/maturityDate">maturityDate</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.PartyAndReference, java.security.PublicKey, core.Amount, java.time.Instant)/issuance">issuance</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.PartyAndReference, java.security.PublicKey, core.Amount, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.PartyAndReference, java.security.PublicKey, core.Amount, java.time.Instant)/faceValue">faceValue</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.PartyAndReference, java.security.PublicKey, core.Amount, java.time.Instant)/maturityDate">maturityDate</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span></code></td>
|
||||
<code><span class="identifier">State</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.contracts.PartyAndReference, java.security.PublicKey, core.contracts.Amount, java.time.Instant)/issuance">issuance</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.contracts.PartyAndReference, java.security.PublicKey, core.contracts.Amount, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.contracts.PartyAndReference, java.security.PublicKey, core.contracts.Amount, java.time.Instant)/faceValue">faceValue</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper.State$<init>(core.contracts.PartyAndReference, java.security.PublicKey, core.contracts.Amount, java.time.Instant)/maturityDate">maturityDate</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -71,13 +71,13 @@
|
||||
<td>
|
||||
<a href="with-face-value.html">withFaceValue</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withFaceValue</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$withFaceValue(core.Amount)/newFaceValue">newFaceValue</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withFaceValue</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$withFaceValue(core.contracts.Amount)/newFaceValue">newFaceValue</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="with-issuance.html">withIssuance</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withIssuance</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$withIssuance(core.PartyAndReference)/newIssuance">newIssuance</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withIssuance</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$withIssuance(core.contracts.PartyAndReference)/newIssuance">newIssuance</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../../index.html">contracts</a> / <a href="../index.html">CommercialPaper</a> / <a href="index.html">State</a> / <a href=".">withFaceValue</a><br/>
|
||||
<br/>
|
||||
<h1>withFaceValue</h1>
|
||||
<a name="contracts.CommercialPaper.State$withFaceValue(core.Amount)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withFaceValue</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$withFaceValue(core.Amount)/newFaceValue">newFaceValue</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><br/>
|
||||
<a name="contracts.CommercialPaper.State$withFaceValue(core.contracts.Amount)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withFaceValue</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$withFaceValue(core.contracts.Amount)/newFaceValue">newFaceValue</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../../index.html">contracts</a> / <a href="../index.html">CommercialPaper</a> / <a href="index.html">State</a> / <a href=".">withIssuance</a><br/>
|
||||
<br/>
|
||||
<h1>withIssuance</h1>
|
||||
<a name="contracts.CommercialPaper.State$withIssuance(core.PartyAndReference)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withIssuance</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$withIssuance(core.PartyAndReference)/newIssuance">newIssuance</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><br/>
|
||||
<a name="contracts.CommercialPaper.State$withIssuance(core.contracts.PartyAndReference)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">withIssuance</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper.State$withIssuance(core.contracts.PartyAndReference)/newIssuance">newIssuance</span><span class="symbol">:</span> <a href="../../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier"><ERROR CLASS></span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">CommercialPaper</a> / <a href=".">generateIssue</a><br/>
|
||||
<br/>
|
||||
<h1>generateIssue</h1>
|
||||
<a name="contracts.CommercialPaper$generateIssue(core.PartyAndReference, core.Amount, java.time.Instant)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.PartyAndReference, core.Amount, java.time.Instant)/issuance">issuance</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.PartyAndReference, core.Amount, java.time.Instant)/faceValue">faceValue</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.PartyAndReference, core.Amount, java.time.Instant)/maturityDate">maturityDate</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><br/>
|
||||
<a name="contracts.CommercialPaper$generateIssue(core.contracts.PartyAndReference, core.contracts.Amount, java.time.Instant)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.contracts.PartyAndReference, core.contracts.Amount, java.time.Instant)/issuance">issuance</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.contracts.PartyAndReference, core.contracts.Amount, java.time.Instant)/faceValue">faceValue</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.contracts.PartyAndReference, core.contracts.Amount, java.time.Instant)/maturityDate">maturityDate</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><br/>
|
||||
<p>Returns a transaction that issues commercial paper, owned by the issuing parties key. Does not update
|
||||
an existing transaction because you arent able to issue multiple pieces of CP in a single transaction
|
||||
at the moment: this restriction is not fundamental and may be lifted later.</p>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">CommercialPaper</a> / <a href=".">generateMove</a><br/>
|
||||
<br/>
|
||||
<h1>generateMove</h1>
|
||||
<a name="contracts.CommercialPaper$generateMove(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateMove</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/paper">paper</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="contracts.CommercialPaper$generateMove(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateMove</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/paper">paper</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<p>Updates the given partial transaction with an input/output/command to reassign ownership of the paper.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">CommercialPaper</a> / <a href=".">generateRedeem</a><br/>
|
||||
<br/>
|
||||
<h1>generateRedeem</h1>
|
||||
<a name="contracts.CommercialPaper$generateRedeem(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateRedeem</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/paper">paper</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/wallet">wallet</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="../-cash/-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="contracts.CommercialPaper$generateRedeem(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateRedeem</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/paper">paper</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/wallet">wallet</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="../-cash/-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<p>Intended to be called by the issuer of some commercial paper, when an owner has notified us that they wish
|
||||
to redeem the paper. We must therefore send enough money to the key that owns the paper to satisfy the face
|
||||
value, and then ensure the paper is removed from the ledger.</p>
|
||||
|
@ -58,7 +58,7 @@ the contracts contents).</p>
|
||||
<td>
|
||||
<a href="generate-issue.html">generateIssue</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.PartyAndReference, core.Amount, java.time.Instant)/issuance">issuance</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.PartyAndReference, core.Amount, java.time.Instant)/faceValue">faceValue</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.PartyAndReference, core.Amount, java.time.Instant)/maturityDate">maturityDate</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><p>Returns a transaction that issues commercial paper, owned by the issuing parties key. Does not update
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateIssue</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.contracts.PartyAndReference, core.contracts.Amount, java.time.Instant)/issuance">issuance</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.contracts.PartyAndReference, core.contracts.Amount, java.time.Instant)/faceValue">faceValue</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateIssue(core.contracts.PartyAndReference, core.contracts.Amount, java.time.Instant)/maturityDate">maturityDate</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><p>Returns a transaction that issues commercial paper, owned by the issuing parties key. Does not update
|
||||
an existing transaction because you arent able to issue multiple pieces of CP in a single transaction
|
||||
at the moment: this restriction is not fundamental and may be lifted later.</p>
|
||||
</td>
|
||||
@ -67,14 +67,14 @@ at the moment: this restriction is not fundamental and may be lifted later.</p>
|
||||
<td>
|
||||
<a href="generate-move.html">generateMove</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateMove</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/paper">paper</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Updates the given partial transaction with an input/output/command to reassign ownership of the paper.</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateMove</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/paper">paper</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateMove(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), java.security.PublicKey)/newOwner">newOwner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Updates the given partial transaction with an input/output/command to reassign ownership of the paper.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="generate-redeem.html">generateRedeem</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateRedeem</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/paper">paper</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.TransactionBuilder, core.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/wallet">wallet</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="../-cash/-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Intended to be called by the issuer of some commercial paper, when an owner has notified us that they wish
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateRedeem</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/paper">paper</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CommercialPaper$generateRedeem(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CommercialPaper.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/wallet">wallet</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="../-cash/-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Intended to be called by the issuer of some commercial paper, when an owner has notified us that they wish
|
||||
to redeem the paper. We must therefore send enough money to the key that owns the paper to satisfy the face
|
||||
value, and then ensure the paper is removed from the ledger.</p>
|
||||
</td>
|
||||
@ -83,7 +83,7 @@ value, and then ensure the paper is removed from the ledger.</p>
|
||||
<td>
|
||||
<a href="verify.html">verify</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$verify(core.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense.
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$verify(core.contracts.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense.
|
||||
Must throw an exception if theres a problem that should prevent state transition. Takes a single object
|
||||
rather than an argument so that additional data can be added without breaking binary compatibility with
|
||||
existing contract code.</p>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">CommercialPaper</a> / <a href=".">verify</a><br/>
|
||||
<br/>
|
||||
<h1>verify</h1>
|
||||
<a name="contracts.CommercialPaper$verify(core.TransactionForVerification)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$verify(core.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="contracts.CommercialPaper$verify(core.contracts.TransactionForVerification)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.CommercialPaper$verify(core.contracts.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
Overrides <a href="../../core/-contract/verify.html">Contract.verify</a><br/>
|
||||
<p>Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense.
|
||||
Must throw an exception if theres a problem that should prevent state transition. Takes a single object
|
||||
|
@ -7,7 +7,7 @@
|
||||
<a href="../../index.html">contracts</a> / <a href="../index.html">CrowdFund</a> / <a href="index.html">Campaign</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">Campaign</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.Amount, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.Amount, java.time.Instant)/name">name</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.Amount, java.time.Instant)/target">target</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.Amount, java.time.Instant)/closingTime">closingTime</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">Campaign</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.contracts.Amount, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.contracts.Amount, java.time.Instant)/name">name</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.contracts.Amount, java.time.Instant)/target">target</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.contracts.Amount, java.time.Instant)/closingTime">closingTime</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">Campaign</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.Amount, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.Amount, java.time.Instant)/name">name</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.Amount, java.time.Instant)/target">target</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.Amount, java.time.Instant)/closingTime">closingTime</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span></code></td>
|
||||
<code><span class="identifier">Campaign</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.contracts.Amount, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.contracts.Amount, java.time.Instant)/name">name</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.contracts.Amount, java.time.Instant)/target">target</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Campaign$<init>(java.security.PublicKey, kotlin.String, core.contracts.Amount, java.time.Instant)/closingTime">closingTime</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<a href="../../../../core/-type-only-command-data/equals.html">equals</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.contracts.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<a href="../../../../core/-type-only-command-data/equals.html">equals</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.contracts.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<a href="../../../../core/-type-only-command-data/equals.html">equals</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.contracts.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<a href="../../index.html">contracts</a> / <a href="../index.html">CrowdFund</a> / <a href="index.html">Pledge</a> / <a href="."><init></a><br/>
|
||||
<br/>
|
||||
<h1><init></h1>
|
||||
<code><span class="identifier">Pledge</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund.Pledge$<init>(java.security.PublicKey, core.Amount)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Pledge$<init>(java.security.PublicKey, core.Amount)/amount">amount</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span></code><br/>
|
||||
<code><span class="identifier">Pledge</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund.Pledge$<init>(java.security.PublicKey, core.contracts.Amount)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Pledge$<init>(java.security.PublicKey, core.contracts.Amount)/amount">amount</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<td>
|
||||
<a href="-init-.html"><init></a></td>
|
||||
<td>
|
||||
<code><span class="identifier">Pledge</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund.Pledge$<init>(java.security.PublicKey, core.Amount)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Pledge$<init>(java.security.PublicKey, core.Amount)/amount">amount</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span></code></td>
|
||||
<code><span class="identifier">Pledge</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund.Pledge$<init>(java.security.PublicKey, core.contracts.Amount)/owner">owner</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund.Pledge$<init>(java.security.PublicKey, core.contracts.Amount)/amount">amount</span><span class="symbol">:</span> <a href="../../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">)</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">CrowdFund</a> / <a href=".">generateClose</a><br/>
|
||||
<br/>
|
||||
<h1>generateClose</h1>
|
||||
<a name="contracts.CrowdFund$generateClose(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateClose</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generateClose(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateClose(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/campaign">campaign</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateClose(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/wallet">wallet</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="../-cash/-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="contracts.CrowdFund$generateClose(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateClose</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generateClose(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateClose(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/campaign">campaign</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateClose(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/wallet">wallet</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="../-cash/-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">CrowdFund</a> / <a href=".">generatePledge</a><br/>
|
||||
<br/>
|
||||
<h1>generatePledge</h1>
|
||||
<a name="contracts.CrowdFund$generatePledge(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generatePledge</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/campaign">campaign</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/subscriber">subscriber</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="contracts.CrowdFund$generatePledge(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generatePledge</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/campaign">campaign</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/subscriber">subscriber</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<p>Updates the given partial transaction with an input/output/command to fund the opportunity.</p>
|
||||
<br/>
|
||||
<br/>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">CrowdFund</a> / <a href=".">generateRegister</a><br/>
|
||||
<br/>
|
||||
<h1>generateRegister</h1>
|
||||
<a name="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateRegister</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)/fundingTarget">fundingTarget</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)/fundingName">fundingName</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)/closingTime">closingTime</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><br/>
|
||||
<a name="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateRegister</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)/fundingTarget">fundingTarget</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)/fundingName">fundingName</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)/closingTime">closingTime</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><br/>
|
||||
<p>Returns a transaction that registers a crowd-funding campaing, owned by the issuing institutions key. Does not update
|
||||
an existing transaction because its not possible to register multiple campaigns in a single transaction</p>
|
||||
<br/>
|
||||
|
@ -91,20 +91,20 @@ the contracts contents).</p>
|
||||
<td>
|
||||
<a href="generate-close.html">generateClose</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateClose</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generateClose(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateClose(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/campaign">campaign</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateClose(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.StateAndRef((contracts.Cash.State)))))/wallet">wallet</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="../-cash/-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateClose</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generateClose(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateClose(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/campaign">campaign</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateClose(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), kotlin.collections.List((core.contracts.StateAndRef((contracts.Cash.State)))))/wallet">wallet</span><span class="symbol">:</span> <span class="identifier">List</span><span class="symbol"><</span><a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="../-cash/-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="generate-pledge.html">generatePledge</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generatePledge</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/campaign">campaign</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.TransactionBuilder, core.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/subscriber">subscriber</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Updates the given partial transaction with an input/output/command to fund the opportunity.</p>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generatePledge</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/campaign">campaign</span><span class="symbol">:</span> <a href="../../core/-state-and-ref/index.html"><span class="identifier">StateAndRef</span></a><span class="symbol"><</span><a href="-state/index.html"><span class="identifier">State</span></a><span class="symbol">></span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generatePledge(core.contracts.TransactionBuilder, core.contracts.StateAndRef((contracts.CrowdFund.State)), java.security.PublicKey)/subscriber">subscriber</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Updates the given partial transaction with an input/output/command to fund the opportunity.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="generate-register.html">generateRegister</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateRegister</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)/fundingTarget">fundingTarget</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)/fundingName">fundingName</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.PartyAndReference, core.Amount, kotlin.String, java.time.Instant)/closingTime">closingTime</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><p>Returns a transaction that registers a crowd-funding campaing, owned by the issuing institutions key. Does not update
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateRegister</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)/owner">owner</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)/fundingTarget">fundingTarget</span><span class="symbol">:</span> <a href="../../core/-amount/index.html"><span class="identifier">Amount</span></a><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)/fundingName">fundingName</span><span class="symbol">:</span> <span class="identifier">String</span><span class="symbol">, </span><span class="identifier" id="contracts.CrowdFund$generateRegister(core.contracts.PartyAndReference, core.contracts.Amount, kotlin.String, java.time.Instant)/closingTime">closingTime</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/time/Instant.html"><span class="identifier">Instant</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><p>Returns a transaction that registers a crowd-funding campaing, owned by the issuing institutions key. Does not update
|
||||
an existing transaction because its not possible to register multiple campaigns in a single transaction</p>
|
||||
</td>
|
||||
</tr>
|
||||
@ -112,7 +112,7 @@ an existing transaction because its not possible to register multiple campaigns
|
||||
<td>
|
||||
<a href="verify.html">verify</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$verify(core.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense.
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$verify(core.contracts.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense.
|
||||
Must throw an exception if theres a problem that should prevent state transition. Takes a single object
|
||||
rather than an argument so that additional data can be added without breaking binary compatibility with
|
||||
existing contract code.</p>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">CrowdFund</a> / <a href=".">verify</a><br/>
|
||||
<br/>
|
||||
<h1>verify</h1>
|
||||
<a name="contracts.CrowdFund$verify(core.TransactionForVerification)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$verify(core.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
<a name="contracts.CrowdFund$verify(core.contracts.TransactionForVerification)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.CrowdFund$verify(core.contracts.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
|
||||
Overrides <a href="../../core/-contract/verify.html">Contract.verify</a><br/>
|
||||
<p>Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense.
|
||||
Must throw an exception if theres a problem that should prevent state transition. Takes a single object
|
||||
|
@ -58,7 +58,7 @@ deal/agreement protocol to generate the necessary transaction for potential impl
|
||||
<td>
|
||||
<a href="with-public-key.html">withPublicKey</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">withPublicKey</span><span class="symbol">(</span><span class="identifier" id="contracts.DealState$withPublicKey(core.Party, java.security.PublicKey)/before">before</span><span class="symbol">:</span> <a href="../../core/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">, </span><span class="identifier" id="contracts.DealState$withPublicKey(core.Party, java.security.PublicKey)/after">after</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">DealState</span></code></td>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">withPublicKey</span><span class="symbol">(</span><span class="identifier" id="contracts.DealState$withPublicKey(core.crypto.Party, java.security.PublicKey)/before">before</span><span class="symbol">:</span> <a href="../../core/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">, </span><span class="identifier" id="contracts.DealState$withPublicKey(core.crypto.Party, java.security.PublicKey)/after">after</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">DealState</span></code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -69,7 +69,7 @@ deal/agreement protocol to generate the necessary transaction for potential impl
|
||||
<td>
|
||||
<a href="../../core/-linear-state/is-relevant.html">isRelevant</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">isRelevant</span><span class="symbol">(</span><span class="identifier" id="core.LinearState$isRelevant(kotlin.collections.Set((java.security.PublicKey)))/ourKeys">ourKeys</span><span class="symbol">:</span> <span class="identifier">Set</span><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code><p>true if this should be tracked by our wallet(s)</p>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">isRelevant</span><span class="symbol">(</span><span class="identifier" id="core.contracts.LinearState$isRelevant(kotlin.collections.Set((java.security.PublicKey)))/ourKeys">ourKeys</span><span class="symbol">:</span> <span class="identifier">Set</span><span class="symbol"><</span><a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">></span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code><p>true if this should be tracked by our wallet(s)</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">DealState</a> / <a href=".">withPublicKey</a><br/>
|
||||
<br/>
|
||||
<h1>withPublicKey</h1>
|
||||
<a name="contracts.DealState$withPublicKey(core.Party, java.security.PublicKey)"></a>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">withPublicKey</span><span class="symbol">(</span><span class="identifier" id="contracts.DealState$withPublicKey(core.Party, java.security.PublicKey)/before">before</span><span class="symbol">:</span> <a href="../../core/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">, </span><span class="identifier" id="contracts.DealState$withPublicKey(core.Party, java.security.PublicKey)/after">after</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="index.html"><span class="identifier">DealState</span></a></code><br/>
|
||||
<a name="contracts.DealState$withPublicKey(core.crypto.Party, java.security.PublicKey)"></a>
|
||||
<code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">withPublicKey</span><span class="symbol">(</span><span class="identifier" id="contracts.DealState$withPublicKey(core.crypto.Party, java.security.PublicKey)/before">before</span><span class="symbol">:</span> <a href="../../core/-party/index.html"><span class="identifier">Party</span></a><span class="symbol">, </span><span class="identifier" id="contracts.DealState$withPublicKey(core.crypto.Party, java.security.PublicKey)/after">after</span><span class="symbol">:</span> <a href="http://docs.oracle.com/javase/6/docs/api/java/security/PublicKey.html"><span class="identifier">PublicKey</span></a><span class="symbol">)</span><span class="symbol">: </span><a href="index.html"><span class="identifier">DealState</span></a></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<a href="../../../../core/-type-only-command-data/equals.html">equals</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
<code><span class="keyword">open</span> <span class="keyword">fun </span><span class="identifier">equals</span><span class="symbol">(</span><span class="identifier" id="core.contracts.TypeOnlyCommandData$equals(kotlin.Any)/other">other</span><span class="symbol">:</span> <span class="identifier">Any</span><span class="symbol">?</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Boolean</span></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -7,8 +7,8 @@
|
||||
<a href="../index.html">contracts</a> / <a href="index.html">DummyContract</a> / <a href=".">generateInitial</a><br/>
|
||||
<br/>
|
||||
<h1>generateInitial</h1>
|
||||
<a name="contracts.DummyContract$generateInitial(core.PartyAndReference, kotlin.Int)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateInitial</span><span class="symbol">(</span><span class="identifier" id="contracts.DummyContract$generateInitial(core.PartyAndReference, kotlin.Int)/owner">owner</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.DummyContract$generateInitial(core.PartyAndReference, kotlin.Int)/magicNumber">magicNumber</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><br/>
|
||||
<a name="contracts.DummyContract$generateInitial(core.contracts.PartyAndReference, kotlin.Int)"></a>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateInitial</span><span class="symbol">(</span><span class="identifier" id="contracts.DummyContract$generateInitial(core.contracts.PartyAndReference, kotlin.Int)/owner">owner</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.DummyContract$generateInitial(core.contracts.PartyAndReference, kotlin.Int)/magicNumber">magicNumber</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code><br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</BODY>
|
||||
|
@ -58,13 +58,13 @@ the contracts contents).</p>
|
||||
<td>
|
||||
<a href="generate-initial.html">generateInitial</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateInitial</span><span class="symbol">(</span><span class="identifier" id="contracts.DummyContract$generateInitial(core.PartyAndReference, kotlin.Int)/owner">owner</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.DummyContract$generateInitial(core.PartyAndReference, kotlin.Int)/magicNumber">magicNumber</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code></td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">generateInitial</span><span class="symbol">(</span><span class="identifier" id="contracts.DummyContract$generateInitial(core.contracts.PartyAndReference, kotlin.Int)/owner">owner</span><span class="symbol">:</span> <a href="../../core/-party-and-reference/index.html"><span class="identifier">PartyAndReference</span></a><span class="symbol">, </span><span class="identifier" id="contracts.DummyContract$generateInitial(core.contracts.PartyAndReference, kotlin.Int)/magicNumber">magicNumber</span><span class="symbol">:</span> <span class="identifier">Int</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../core/-transaction-builder/index.html"><span class="identifier">TransactionBuilder</span></a></code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="verify.html">verify</a></td>
|
||||
<td>
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.DummyContract$verify(core.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense.
|
||||
<code><span class="keyword">fun </span><span class="identifier">verify</span><span class="symbol">(</span><span class="identifier" id="contracts.DummyContract$verify(core.contracts.TransactionForVerification)/tx">tx</span><span class="symbol">:</span> <a href="../../core/-transaction-for-verification/index.html"><span class="identifier">TransactionForVerification</span></a><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><p>Takes an object that represents a state transition, and ensures the inputs/outputs/commands make sense.
|
||||
Must throw an exception if theres a problem that should prevent state transition. Takes a single object
|
||||
rather than an argument so that additional data can be added without breaking binary compatibility with
|
||||
existing contract code.</p>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user