monotoniclib is the foundation for a Go library exploring monotonic changes
to entity state. Its current primitive checks that a proposed current value is
not less than the previous value.
This is a distinct protocol project. It does not depend on or define the rules of Stability Calculus.
The library currently provides a state value type and a comparison function. It is an early foundation, not a complete protocol implementation. In particular, the library does not yet validate entities, authorize transitions, persist state, or define the full protocol rules.
CheckUpgradeable compares the two numeric values only. It accepts equal
values and does not impose a range on values; entity acceptance and other
protocol validation are outside its current scope.
The module path is currently monotoniclib. Once published at its canonical
repository URL, use that URL as the import path in client projects.
package main
import (
"fmt"
monotonic "monotoniclib"
)
func main() {
state := monotonic.EntityStabilityStateValue{
Previous: 0.50,
Current: 0.70,
}
fmt.Println("Is upgradeable:", monotonic.CheckUpgradeable(state))
}Output:
Is upgradeable: true
EntityStabilityStateValuecontains exportedPreviousandCurrentvalues so callers can construct and inspect state comparisons.CheckUpgradeablereturns whetherCurrent >= Previous.
Run the test suite from the module directory:
go test ./...##More Further more see: https://github.com/letbecool/Sunya
All rights are reserved by Trustless Mandir Invention and Innovation Center. See LICENSE.