Skip to content

Commit d858a95

Browse files
committed
go fmt
1 parent 52064d3 commit d858a95

21 files changed

Lines changed: 112 additions & 114 deletions

common/adminBlock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ func (e *AdminBlock) Spew() string {
221221

222222
// Admin Block Header
223223
type ABlockHeader struct {
224-
AdminChainID *Hash
224+
AdminChainID *Hash
225225
PrevLedgerKeyMR *Hash
226-
DBHeight uint32
226+
DBHeight uint32
227227

228228
HeaderExpansionSize uint64
229229
HeaderExpansionArea []byte

common/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ var ADMIN_CHAINID = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7373
var FACTOID_CHAINID = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7474
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0f}
7575

76-
var ZERO_HASH = []byte{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}
76+
var ZERO_HASH = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

common/directoryBlock.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ type DBlockHeader struct {
132132
Version byte
133133
NetworkID uint32
134134

135-
BodyMR *Hash
136-
PrevKeyMR *Hash
135+
BodyMR *Hash
136+
PrevKeyMR *Hash
137137
PrevLedgerKeyMR *Hash
138138

139139
Timestamp uint32
@@ -188,7 +188,7 @@ func NewDBEntry(eb *EBlock) (*DBEntry, error) {
188188
e.ChainID = eb.Header.ChainID
189189
var err error
190190
e.KeyMR, err = eb.KeyMR()
191-
if err!=nil {
191+
if err != nil {
192192
return nil, err
193193
}
194194

@@ -201,7 +201,7 @@ func NewDBEntryFromECBlock(cb *ECBlock) (*DBEntry, error) {
201201
e.ChainID = cb.Header.ECChainID
202202
var err error
203203
e.KeyMR, err = cb.HeaderHash()
204-
if err!=nil {
204+
if err != nil {
205205
return nil, err
206206
}
207207

@@ -313,9 +313,9 @@ func (e *DBEntry) Spew() string {
313313

314314
func (b *DBlockHeader) EncodableFields() map[string]reflect.Value {
315315
fields := map[string]reflect.Value{
316-
`DBHeight`: reflect.ValueOf(b.DBHeight),
317-
`BlockCount`: reflect.ValueOf(b.BlockCount),
318-
`BodyMR`: reflect.ValueOf(b.BodyMR),
316+
`DBHeight`: reflect.ValueOf(b.DBHeight),
317+
`BlockCount`: reflect.ValueOf(b.BlockCount),
318+
`BodyMR`: reflect.ValueOf(b.BodyMR),
319319
`PrevLedgerKeyMR`: reflect.ValueOf(b.PrevLedgerKeyMR),
320320
}
321321
return fields
@@ -448,7 +448,7 @@ func CreateDBlock(chain *DChain, prev *DirectoryBlock, cap uint) (b *DirectoryBl
448448
func (c *DChain) AddEBlockToDBEntry(eb *EBlock) (err error) {
449449

450450
dbEntry, err := NewDBEntry(eb)
451-
if err!=nil {
451+
if err != nil {
452452
return err
453453
}
454454
c.BlockMutex.Lock()
@@ -462,7 +462,7 @@ func (c *DChain) AddEBlockToDBEntry(eb *EBlock) (err error) {
462462
func (c *DChain) AddECBlockToDBEntry(ecb *ECBlock) (err error) {
463463

464464
dbEntry, err := NewDBEntryFromECBlock(ecb)
465-
if err!=nil {
465+
if err != nil {
466466
return err
467467
}
468468

common/eblock.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ func MakeEBlock(echain *EChain, prev *EBlock) (*EBlock, error) {
3939
if prev != nil {
4040
var err error
4141
e.Header.PrevKeyMR, err = prev.KeyMR()
42-
if err!=nil {
42+
if err != nil {
4343
return nil, err
4444
}
4545
e.Header.PrevLedgerKeyMR, err = prev.Hash()
46-
if err!=nil {
46+
if err != nil {
4747
return nil, err
4848
}
4949
}
@@ -332,13 +332,13 @@ func (e *EBlockBody) Spew() string {
332332
// EBlockHeader holds relevent metadata about the Entry Block and the data
333333
// nessisary to verify the previous block in the Entry Block Chain.
334334
type EBlockHeader struct {
335-
ChainID *Hash
336-
BodyMR *Hash
337-
PrevKeyMR *Hash
335+
ChainID *Hash
336+
BodyMR *Hash
337+
PrevKeyMR *Hash
338338
PrevLedgerKeyMR *Hash
339-
EBSequence uint32
340-
DBHeight uint32
341-
EntryCount uint32
339+
EBSequence uint32
340+
DBHeight uint32
341+
EntryCount uint32
342342
}
343343

344344
var _ Printable = (*EBlockHeader)(nil)

common/ecblock.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ func NextECBlock(prev *ECBlock) (*ECBlock, error) {
4646
e := NewECBlock()
4747
var err error
4848
e.Header.PrevHeaderHash, err = prev.HeaderHash()
49-
if err!=nil {
49+
if err != nil {
5050
return nil, err
5151
}
5252
e.Header.PrevLedgerKeyMR, err = prev.Hash()
53-
if err!=nil {
53+
if err != nil {
5454
return nil, err
5555
}
5656
e.Header.DBHeight = prev.Header.DBHeight + 1
@@ -389,7 +389,7 @@ type ECBlockHeader struct {
389389
ECChainID *Hash
390390
BodyHash *Hash
391391
PrevHeaderHash *Hash
392-
PrevLedgerKeyMR *Hash
392+
PrevLedgerKeyMR *Hash
393393
DBHeight uint32
394394
HeaderExpansionArea []byte
395395
ObjectCount uint64

common/ecblock_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package common_test
22

33
import (
4-
"fmt"
54
"crypto/rand"
5+
"fmt"
66
"testing"
77

88
"github.com/FactomProject/FactomCode/common"
@@ -43,7 +43,7 @@ func TestECBlockMarshal(t *testing.T) {
4343

4444
// add the CommitChain to the ECBlock
4545
ecb1.AddEntry(cc)
46-
46+
4747
m1 := common.NewMinuteNumber()
4848
m1.Number = 0x01
4949
ecb1.AddEntry(m1)
@@ -52,7 +52,7 @@ func TestECBlockMarshal(t *testing.T) {
5252
si1 := common.NewServerIndexNumber()
5353
si1.Number = 3
5454
ecb1.AddEntry(si1)
55-
55+
5656
// create an IncreaseBalance for testing
5757
ib := common.NewIncreaseBalance()
5858
pub := new([32]byte)
@@ -62,7 +62,7 @@ func TestECBlockMarshal(t *testing.T) {
6262
ib.NumEC = uint64(13)
6363
// add the IncreaseBalance
6464
ecb1.AddEntry(ib)
65-
65+
6666
m2 := common.NewMinuteNumber()
6767
m2.Number = 0x02
6868
ecb1.AddEntry(m2)

common/ftcblock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
var _ = fmt.Println
1616

17-
var FactoidState state.IFactoidState
17+
var FactoidState state.IFactoidState
1818

1919
// factoid Chain
2020
type FctChain struct {

common/increasebalance.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type IncreaseBalance struct {
1818
}
1919

2020
var _ Printable = (*IncreaseBalance)(nil)
21+
2122
//var _ BinaryMarshallable = (*IncreaseBalance)(nil)
2223

2324
//func (c *IncreaseBalance) MarshalledSize() uint64 {

common/increasebalance_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
. "github.com/FactomProject/FactomCode/common"
88
)
99

10-
1110
func TestIncreaseBalanceMarshalUnmarshal(t *testing.T) {
1211
ib1 := NewIncreaseBalance()
1312
pub := new([32]byte)
@@ -21,7 +20,7 @@ func TestIncreaseBalanceMarshalUnmarshal(t *testing.T) {
2120
}
2221
ib2 := NewIncreaseBalance()
2322
ib2.UnmarshalBinary(p)
24-
23+
2524
q, err := ib2.MarshalBinary()
2625
if err != nil {
2726
t.Error(err)

common/serverindexnumber_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
package common_test
66

77
import (
8-
"testing"
98
"github.com/FactomProject/FactomCode/common"
9+
"testing"
1010
)
1111

1212
func TestServerIndexMarshalUnmarshal(t *testing.T) {
@@ -22,7 +22,7 @@ func TestServerIndexMarshalUnmarshal(t *testing.T) {
2222
if b[0] != 3 {
2323
t.Error("Invalid byte")
2424
}
25-
25+
2626
si2 := common.NewServerIndexNumber()
2727
err = si2.UnmarshalBinary(b)
2828
if err != nil {

0 commit comments

Comments
 (0)