io.provenance.scope.contract.spec.P8eContract.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of contract-base Show documentation
Show all versions of contract-base Show documentation
A collection of libraries that interact and run Provenance Java based contracts.
The newest version!
package io.provenance.scope.contract.spec
import java.time.OffsetDateTime
import java.util.UUID
import java.util.concurrent.atomic.AtomicReference
import io.provenance.scope.proto.Util
/**
* Provide basic functionality for agreement setup.
*/
abstract class P8eContract {
val uuid = Util.UUID.newBuilder().setValue(UUID.randomUUID().toString()).build()
val currentTime = AtomicReference()
protected fun getCurrentTime(): OffsetDateTime {
return currentTime.get()
?: throw IllegalStateException("Current time wasn't set prior to contract construction.")
}
}