From fe4a0d6cbc77d2265c5deb7a50e16b01ab926166 Mon Sep 17 00:00:00 2001 From: chadlagore Date: Sat, 26 Aug 2017 14:30:33 -0700 Subject: [PATCH] Replace ObjectsAreEqual and fix debug noise (for real) --- app/app.go | 2 +- app/app_test.go | 6 +++--- pool/pool_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/app.go b/app/app.go index de1a6b5..b72e0aa 100644 --- a/app/app.go +++ b/app/app.go @@ -351,7 +351,7 @@ func (a *App) RunMiner() { miningResult := miner.Mine(a.Chain, blockToMine) if miningResult.Complete { - // log.Debug("Successfully mined a block!") + log.Info("Successfully mined a block!") push := msg.Push{ ResourceType: msg.ResourceBlock, Resource: blockToMine, diff --git a/app/app_test.go b/app/app_test.go index 8ede1f8..d4071e6 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -16,7 +16,7 @@ import ( ) func init() { - log.SetLevel(log.DebugLevel) + log.SetLevel(log.ErrorLevel) } func TestPushHandlerNewBlock(t *testing.T) { @@ -47,7 +47,7 @@ func TestPushHandlerNewTestTransaction(t *testing.T) { select { case tr, ok := <-a.transactionQueue: assert.True(t, ok) - assert.ObjectsAreEqual(tr, txn) + assert.Equal(t, tr, txn) } } @@ -138,7 +138,7 @@ func TestHandleValidBlock(t *testing.T) { bc, blk := blockchain.NewValidTestChainAndBlock() a.Chain = bc a.HandleBlock(blk) - assert.ObjectsAreEqual(blk, a.Chain.Blocks[2]) + assert.Equal(t, blk, a.Chain.Blocks[3]) // TODO: Assert miner restarted. // TODO: Assert pool appropriately emptied. diff --git a/pool/pool_test.go b/pool/pool_test.go index 91c3b78..b59ea5e 100644 --- a/pool/pool_test.go +++ b/pool/pool_test.go @@ -16,7 +16,7 @@ func TestGetAndSetTransaction(t *testing.T) { tr := b.Transactions[1] assert.Equal(t, p.Push(tr, bc), consensus.ValidTransaction) assert.Equal(t, p.Size(), 1) - assert.ObjectsAreEqual(tr, p.Get(blockchain.HashSum(tr))) + assert.Equal(t, tr, p.Get(blockchain.HashSum(tr))) p.Delete(tr) assert.Equal(t, p.Size(), 0)