aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/block.go
diff options
context:
space:
mode:
authorTed Yin <[email protected]>2020-09-18 13:14:29 -0400
committerGitHub <[email protected]>2020-09-18 13:14:29 -0400
commitd048937c48753d9eaef771bf71820cf95d79df26 (patch)
tree1a7f65fcd72e77092525ab01625b8b9d365e3e40 /plugin/evm/block.go
parent7d1388c743b4ec8f4a86bea95bfada785dee83f7 (diff)
parent7d8c85cf8895b0f998d8eafb02f99d5b689fcd59 (diff)
Merge pull request #34 from ava-labs/devv0.3.0-rc.5
Dev
Diffstat (limited to 'plugin/evm/block.go')
-rw-r--r--plugin/evm/block.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugin/evm/block.go b/plugin/evm/block.go
index 134fa29..ff1f6ae 100644
--- a/plugin/evm/block.go
+++ b/plugin/evm/block.go
@@ -8,7 +8,8 @@ import (
"fmt"
"github.com/ava-labs/coreth/core/types"
- "github.com/ava-labs/go-ethereum/rlp"
+ "github.com/ethereum/go-ethereum/log"
+ "github.com/ethereum/go-ethereum/rlp"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow/choices"
@@ -30,7 +31,7 @@ func (b *Block) ID() ids.ID { return b.id }
func (b *Block) Accept() error {
vm := b.vm
- vm.ctx.Log.Verbo("Block %s is accepted", b.id)
+ log.Trace(fmt.Sprintf("Block %s is accepted", b.ID()))
vm.updateStatus(b.id, choices.Accepted)
if err := vm.acceptedDB.Put(b.ethBlock.Number().Bytes(), b.id.Bytes()); err != nil {
return err
@@ -50,7 +51,7 @@ func (b *Block) Accept() error {
// Reject implements the snowman.Block interface
func (b *Block) Reject() error {
- b.vm.ctx.Log.Verbo("Block %s is rejected", b.ID())
+ log.Trace(fmt.Sprintf("Block %s is rejected", b.ID()))
b.vm.updateStatus(b.ID(), choices.Rejected)
return nil
}
@@ -68,10 +69,8 @@ func (b *Block) Status() choices.Status {
func (b *Block) Parent() snowman.Block {
parentID := ids.NewID(b.ethBlock.ParentHash())
if block := b.vm.getBlock(parentID); block != nil {
- b.vm.ctx.Log.Verbo("Parent(%s) has status: %s", parentID, block.Status())
return block
}
- b.vm.ctx.Log.Verbo("Parent(%s) has status: %s", parentID, choices.Unknown)
return &missing.Block{BlkID: parentID}
}