Skip to content

Commit dac153d

Browse files
committed
Fixed the error for Blocks test
1 parent ea850be commit dac153d

7 files changed

Lines changed: 16 additions & 16 deletions

File tree

factomd/blocks_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ import (
88
"testing"
99
)
1010

11-
var dirBlockHeight uint32 = 241
11+
var dirBlockHeight uint32 = 0
1212

1313
func TestBlocks(t *testing.T) {
1414
fmt.Println("\nTest Blocks===========================================================================")
1515

16+
loadConfigurations()
17+
1618
initDB()
1719

1820
// directory block ------------------
@@ -34,16 +36,16 @@ func TestBlocks(t *testing.T) {
3436
for _, dbEntry := range dblk.DBEntries {
3537
switch dbEntry.ChainID.String() {
3638
case ecchainid.String():
37-
ecblk, _ := db.FetchECBlockByHash(dbEntry.MerkleRoot)
39+
ecblk, _ := db.FetchECBlockByHash(dbEntry.KeyMR)
3840
t.Logf("ecblk=%s\n", spew.Sdump(ecblk))
3941
case achainid.String():
40-
ablk, _ := db.FetchABlockByHash(dbEntry.MerkleRoot)
42+
ablk, _ := db.FetchABlockByHash(dbEntry.KeyMR)
4143
t.Logf("ablk=%s\n", spew.Sdump(ablk))
4244
case fchainid.String():
43-
fblk, _ := db.FetchFBlockByHash(dbEntry.MerkleRoot)
45+
fblk, _ := db.FetchFBlockByHash(dbEntry.KeyMR)
4446
t.Logf("fblk=%s\n", spew.Sdump(fblk))
4547
default:
46-
eBlk, _ := db.FetchEBlockByMR(dbEntry.MerkleRoot)
48+
eBlk, _ := db.FetchEBlockByMR(dbEntry.KeyMR)
4749
// validate every entry in EBlock
4850
for _, ebEntry := range eBlk.EBEntries {
4951
// continue if the entry arleady exists in db

factomd/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ var (
2020

2121
// setup subsystem loggers
2222
var (
23-
ftmdLog = factomlog.New(logfile, logLevel, "ftmd")
23+
ftmdLog = factomlog.New(logfile, logLevel, "FTMD")
2424
)

process/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ var (
2020

2121
// setup subsystem loggers
2222
var (
23-
procLog = factomlog.New(logfile, logLevel, "proc")
23+
procLog = factomlog.New(logfile, logLevel, "PROC")
2424
)

process/processor.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ var (
7676

7777
// Get the configurations
7878
func LoadConfigurations(cfg *util.FactomdConfig) {
79-
util.Trace("LoadConf")
8079

8180
//setting the variables by the valued form the config file
8281
logLevel = cfg.Log.LogLevel
@@ -88,10 +87,6 @@ func LoadConfigurations(cfg *util.FactomdConfig) {
8887

8988
FactomdUser = cfg.Btc.RpcUser
9089
FactomdPass = cfg.Btc.RpcPass
91-
92-
util.Trace(logLevel)
93-
util.Trace(ldbpath)
94-
util.Trace(FactomdUser)
9590
}
9691

9792
// Initialize the processor

process/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func copyCreditMap(
332332
func printCreditMap() {
333333
procLog.Debug("eCreditMap:")
334334
for key := range eCreditMap {
335-
procLog.Debugf("Key: %x Value %d\n", key, eCreditMap[key])
335+
procLog.Debugf("Entry credit Key: %x Value %d", key, eCreditMap[key])
336336
}
337337
}
338338

util/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ RpcClientPass = "notarychain"
8484
BtcTransFee = 0.0001
8585
CertHomePathBtcd = "btcd"
8686
RpcBtcdHost = "localhost:18334"
87+
RpcUser = ""
88+
RpcPass = ""
89+
8790
8891
[wsapi]
8992
ApplicationName = "Factom/wsapi"

wsapi/log.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var (
2020

2121
// setup subsystem loggers
2222
var (
23-
rpcLog = factomlog.New(logfile, logLevel, "rpc")
24-
serverLog = factomlog.New(logfile, logLevel, "serv")
25-
wsLog = factomlog.New(logfile, logLevel, "wsapi")
23+
rpcLog = factomlog.New(logfile, logLevel, "RPC")
24+
serverLog = factomlog.New(logfile, logLevel, "SERV")
25+
wsLog = factomlog.New(logfile, logLevel, "WSAPI")
2626
)

0 commit comments

Comments
 (0)