-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from provenance-io/multiparty_contract_execution
Multiparty Contract Execution
- Loading branch information
Showing
50 changed files
with
680 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object RepositoryLocations { | ||
const val JitPack = "https://javadoc.jitpack.io" | ||
const val Sonatype = "https://s01.oss.sonatype.org/service/local/" | ||
const val SonatypeSnapshot = "https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
val ktlint: Configuration by configurations.creating | ||
|
||
plugins { | ||
Plugins.Detekt.addTo(this) | ||
`java-library` | ||
`maven-publish` | ||
} | ||
|
||
java.sourceCompatibility = JavaVersion.VERSION_11 | ||
|
||
dependencies { | ||
ktlint(Dependencies.Ktlint.toDependencyNotation()) | ||
|
||
listOf( | ||
Dependencies.Protobuf.JavaUtil, | ||
Dependencies.P8eScope.ContractProto, | ||
Dependencies.P8eScope.ContractBase, | ||
Dependencies.Provenance.AssetModel, | ||
Dependencies.Kotlin.CoroutinesReactor, | ||
).forEach { dep -> | ||
dep.implementation(this) | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
groupId = "io.provenance.p8e-cee-api" | ||
artifactId = project.name | ||
|
||
from(components["java"]) | ||
|
||
pom { | ||
name.set("Provenance p8e-cee-api data classes") | ||
description.set("Provenance p8e-cee-api data classes") | ||
url.set("https://provenance.io") | ||
|
||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("cworsnop-figure") | ||
name.set("Cody Worsnop") | ||
email.set("[email protected]") | ||
} | ||
} | ||
|
||
scm { | ||
connection.set("[email protected]:provenance-io/p8e-cee-api.git") | ||
developerConnection.set("[email protected]:provenance-io/p8e-cee-api.git") | ||
url.set("https://github.com/provenance-io/p8e-cee-api") | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign(publishing.publications["maven"]) | ||
} | ||
|
||
tasks.javadoc { | ||
if(JavaVersion.current().isJava9Compatible) { | ||
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true) | ||
} | ||
} | ||
} | ||
|
||
tasks.register<JavaExec>("ktlint") { | ||
group = "verification" | ||
description = "Check Kotlin code style." | ||
classpath = ktlint | ||
main = "com.pinterest.ktlint.Main" | ||
args("src/**/*.kt") | ||
} | ||
|
||
tasks.named("check") { | ||
dependsOn(tasks.named("ktlint")) | ||
} | ||
|
||
tasks.register<JavaExec>("ktlintFormat") { | ||
group = "formatting" | ||
description = "Fix Kotlin code style deviations." | ||
classpath = ktlint | ||
main = "com.pinterest.ktlint.Main" | ||
args("-F", "src/**/*.kt") | ||
} | ||
|
||
detekt { | ||
toolVersion = Versions.Detekt | ||
buildUponDefaultConfig = true | ||
config = files("${rootDir.path}/detekt.yml") | ||
input = files("src/main/kotlin", "src/test/kotlin") | ||
} |
2 changes: 1 addition & 1 deletion
2
...omain/usecase/common/model/AccountInfo.kt → ...venance/api/models/account/AccountInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
models/src/main/kotlin/io/provenance/api/models/cee/ApproveContractRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.provenance.api.models.cee | ||
|
||
import io.provenance.api.models.eos.ObjectStoreConfig | ||
import io.provenance.api.models.account.AccountInfo | ||
import io.provenance.api.models.p8e.ProvenanceConfig | ||
import java.time.OffsetDateTime | ||
|
||
data class ApproveContractRequest( | ||
val account: AccountInfo, | ||
val client: ObjectStoreConfig, | ||
val provenanceConfig: ProvenanceConfig, | ||
val envelope: ByteArray, | ||
val expiration: OffsetDateTime = OffsetDateTime.now().plusHours(1), | ||
) |
2 changes: 1 addition & 1 deletion
2
...omain/usecase/cee/model/ContractConfig.kt → ...ovenance/api/models/cee/ContractConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
models/src/main/kotlin/io/provenance/api/models/cee/ContractExecutionResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.provenance.api.models.cee | ||
|
||
import io.provenance.api.models.p8e.TxResponse | ||
|
||
data class ContractExecutionResponse( | ||
val multiparty: Boolean, | ||
val envelopeState: String? = null, | ||
val metadata: TxResponse? = null, | ||
) |
12 changes: 12 additions & 0 deletions
12
models/src/main/kotlin/io/provenance/api/models/cee/ExecuteContractConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.provenance.api.models.cee | ||
|
||
import io.provenance.api.models.eos.ObjectStoreConfig | ||
import io.provenance.api.models.account.AccountInfo | ||
import io.provenance.api.models.p8e.ProvenanceConfig | ||
|
||
data class ExecuteContractConfig( | ||
val contract: ContractConfig, | ||
val client: ObjectStoreConfig, | ||
val account: AccountInfo, | ||
val provenanceConfig: ProvenanceConfig, | ||
) |
9 changes: 9 additions & 0 deletions
9
models/src/main/kotlin/io/provenance/api/models/cee/ExecuteContractRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.provenance.api.models.cee | ||
|
||
import io.provenance.api.models.account.AccountInfo | ||
|
||
data class ExecuteContractRequest( | ||
val config: ExecuteContractConfig, | ||
val records: Map<String, Any>, | ||
val participants: List<AccountInfo> = emptyList() | ||
) |
10 changes: 10 additions & 0 deletions
10
models/src/main/kotlin/io/provenance/api/models/cee/RejectContractRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.provenance.api.models.cee | ||
|
||
import io.provenance.api.models.eos.ObjectStoreConfig | ||
import io.provenance.api.models.account.AccountInfo | ||
|
||
data class RejectContractRequest( | ||
val account: AccountInfo, | ||
val client: ObjectStoreConfig, | ||
val rejection: ByteArray, | ||
) |
11 changes: 11 additions & 0 deletions
11
models/src/main/kotlin/io/provenance/api/models/cee/SubmitContractExecutionResultRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.provenance.api.models.cee | ||
|
||
import io.provenance.api.models.account.AccountInfo | ||
import io.provenance.api.models.p8e.ProvenanceConfig | ||
|
||
data class SubmitContractExecutionResultRequest( | ||
val account: AccountInfo, | ||
val provenance: ProvenanceConfig, | ||
val envelope: ByteArray, | ||
val state: ByteArray, | ||
) |
5 changes: 5 additions & 0 deletions
5
models/src/main/kotlin/io/provenance/api/models/eos/ObjectStoreConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package io.provenance.api.models.eos | ||
|
||
data class ObjectStoreConfig( | ||
val objectStoreUrl: String, | ||
) |
2 changes: 1 addition & 1 deletion
2
.../usecase/common/model/ProvenanceConfig.kt → ...enance/api/models/p8e/ProvenanceConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...domain/usecase/common/model/TxResponse.kt → ...o/provenance/api/models/p8e/TxResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.