All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.provenance.scope.contract.spec.P8eContract.kt Maven / Gradle / Ivy

Go to download

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.")
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy