forked from FactomProject/factom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dblock.go
40 lines (35 loc) · 999 Bytes
/
dblock.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
// Copyright 2016 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package factom
import (
"fmt"
)
type DBlock struct {
DBHash string `json:"dbhash"`
Header struct {
PrevBlockKeyMR string `json:"prevblockkeymr"`
SequenceNumber int64 `json:"sequencenumber"`
Timestamp int64 `json:"timestamp"`
} `json:"header"`
EntryBlockList []struct {
ChainID string `json:"chainid"`
KeyMR string `json:"keymr"`
} `json:"entryblocklist"`
}
func (d *DBlock) String() string {
var s string
s += fmt.Sprintln("PrevBlockKeyMR:", d.Header.PrevBlockKeyMR)
s += fmt.Sprintln("Timestamp:", d.Header.Timestamp)
s += fmt.Sprintln("SequenceNumber:", d.Header.SequenceNumber)
for _, v := range d.EntryBlockList {
s += fmt.Sprintln("EntryBlock {")
s += fmt.Sprintln(" ChainID", v.ChainID)
s += fmt.Sprintln(" KeyMR", v.KeyMR)
s += fmt.Sprintln("}")
}
return s
}
type DBHead struct {
KeyMR string `json:"keymr"`
}