-
Notifications
You must be signed in to change notification settings - Fork 95
/
chain.go
30 lines (25 loc) · 1.06 KB
/
chain.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package iotago
// ChainOutput is a type of Output which represents a chain of state transitions.
type ChainOutput interface {
Output
// ChainID returns the ChainID to which this Output belongs to.
ChainID() ChainID
}
// ChainOutputImmutable is a type of Output which represents a chain of state transitions with immutable features.
type ChainOutputImmutable interface {
ChainOutput
// ImmutableFeatureSet returns the immutable FeatureSet this output contains.
ImmutableFeatureSet() FeatureSet
}
// ChainTransitionType defines the type of transition a ChainOutput is doing.
type ChainTransitionType byte
const (
// ChainTransitionTypeGenesis indicates that the chain is in its genesis, aka it is new.
ChainTransitionTypeGenesis ChainTransitionType = iota
// ChainTransitionTypeStateChange indicates that the chain is state transitioning.
ChainTransitionTypeStateChange
// ChainTransitionTypeDestroy indicates that the chain is being destroyed.
ChainTransitionTypeDestroy
)
// ChainOutputSet is a map of ChainID to ChainOutput.
type ChainOutputSet map[ChainID]ChainOutput