Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSequenceUniqueConstraint = errors.Register("sequence_u256", 1, "sequence already initialized")
)
sequenceKey a fix key to read/ write data on the storage layer
Functions ¶
func DecodeSequence ¶
func EncodeSequence ¶
Types ¶
type U256 ¶
type U256 struct {
// contains filtered or unexported fields
}
SequenceU256 is a persistent unique key generator based on a counter.
func NewSequence256 ¶
func (U256) InitVal ¶
InitVal sets the start value for the sequence. It must be called only once on an empty DB. Otherwise an error is returned when the key exists. The given start value is stored as current value.
It is recommended to call this method only for a sequence start value other than `1` as the method consumes unnecessary gas otherwise. A scenario would be an import from genesis.
Click to show internal directories.
Click to hide internal directories.