forked from FactomProject/factomd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
directoryblock.go
67 lines (59 loc) · 1.5 KB
/
directoryblock.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
// Copyright 2017 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package interfaces
type IDirectoryBlock interface {
Printable
DatabaseBlockWithEntries
GetHeader() IDirectoryBlockHeader
SetHeader(IDirectoryBlockHeader)
GetDBEntries() []IDBEntry
GetEBlockDBEntries() []IDBEntry
SetDBEntries([]IDBEntry) error
AddEntry(chainID IHash, keyMR IHash) error
BuildKeyMerkleRoot() (IHash, error)
BuildBodyMR() (IHash, error)
GetKeyMR() IHash
GetHash() IHash
GetFullHash() IHash
GetHeaderHash() (IHash, error)
GetTimestamp() Timestamp
BodyKeyMR() IHash
GetEntryHashesForBranch() []IHash
SetEntryHash(hash, chainID IHash, index int)
SetABlockHash(aBlock IAdminBlock) error
SetECBlockHash(ecBlock IEntryCreditBlock) error
SetFBlockHash(fBlock IFBlock) error
IsSameAs(IDirectoryBlock) bool
}
type IDirectoryBlockHeader interface {
Printable
BinaryMarshallable
GetVersion() byte
SetVersion(byte)
GetPrevFullHash() IHash
SetPrevFullHash(IHash)
GetBodyMR() IHash
SetBodyMR(IHash)
GetPrevKeyMR() IHash
SetPrevKeyMR(IHash)
GetHeaderHash() (IHash, error)
GetDBHeight() uint32
SetDBHeight(uint32)
GetBlockCount() uint32
SetBlockCount(uint32)
GetNetworkID() uint32
SetNetworkID(uint32)
GetTimestamp() Timestamp
SetTimestamp(Timestamp)
IsSameAs(IDirectoryBlockHeader) bool
}
type IDBEntry interface {
Printable
BinaryMarshallable
GetChainID() IHash
SetChainID(IHash)
GetKeyMR() IHash
SetKeyMR(IHash)
IsSameAs(IDBEntry) bool
}