-
Notifications
You must be signed in to change notification settings - Fork 12
/
transaction_metadata.go
67 lines (38 loc) · 1.15 KB
/
transaction_metadata.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package mempool
import (
"github.com/iotaledger/hive.go/ds"
"github.com/iotaledger/hive.go/ds/reactive"
iotago "github.com/iotaledger/iota.go/v4"
)
type TransactionMetadata interface {
ID() iotago.TransactionID
Transaction() Transaction
Inputs() ds.Set[StateMetadata]
Outputs() ds.Set[StateMetadata]
SpenderIDs() reactive.Set[iotago.TransactionID]
Commit()
IsSolid() bool
OnSolid(callback func())
IsExecuted() bool
OnExecuted(callback func())
IsInvalid() bool
OnInvalid(callback func(error))
IsBooked() bool
OnBooked(callback func())
ValidAttachments() []iotago.BlockID
EarliestIncludedAttachment() iotago.BlockID
OnEarliestIncludedAttachmentUpdated(callback func(prevID, newID iotago.BlockID))
OnEvicted(callback func())
inclusionFlags
}
type inclusionFlags interface {
IsPending() bool
IsAccepted() bool
OnAccepted(callback func())
CommittedSlot() (slot iotago.SlotIndex, isCommitted bool)
OnCommittedSlotUpdated(callback func(slot iotago.SlotIndex))
IsRejected() bool
OnRejected(callback func())
OrphanedSlot() (slot iotago.SlotIndex, isOrphaned bool)
OnOrphanedSlotUpdated(callback func(slot iotago.SlotIndex))
}