/
attributes.go
63 lines (54 loc) · 1.34 KB
/
attributes.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
package money
import (
"github.com/alphabill-org/alphabill/types"
)
const (
PayloadTypeTransfer = "trans"
PayloadTypeSplit = "split"
PayloadTypeTransDC = "transDC"
PayloadTypeSwapDC = "swapDC"
PayloadTypeLock = "lock"
PayloadTypeUnlock = "unlock"
)
type (
TransferAttributes struct {
_ struct{} `cbor:",toarray"`
NewBearer []byte
TargetValue uint64
Backlink []byte
}
TransferDCAttributes struct {
_ struct{} `cbor:",toarray"`
Value uint64
TargetUnitID []byte
TargetUnitBacklink []byte
Backlink []byte
}
SplitAttributes struct {
_ struct{} `cbor:",toarray"`
TargetUnits []*TargetUnit
RemainingValue uint64
Backlink []byte
}
TargetUnit struct {
_ struct{} `cbor:",toarray"`
Amount uint64
OwnerCondition []byte
}
SwapDCAttributes struct {
_ struct{} `cbor:",toarray"`
OwnerCondition []byte
DcTransfers []*types.TransactionRecord
DcTransferProofs []*types.TxProof
TargetValue uint64 // value added to target bill
}
LockAttributes struct {
_ struct{} `cbor:",toarray"`
LockStatus uint64 // status of the lock, non-zero value means locked
Backlink []byte
}
UnlockAttributes struct {
_ struct{} `cbor:",toarray"`
Backlink []byte
}
)