ipld-eth-server/core/blockchain_logging_observer.go
Matt K c961e85099 Refactor block conversion (#38)
Move more of block conversion out of observer
2017-10-31 12:51:05 -05:00

17 lines
403 B
Go

package core
import (
"fmt"
"time"
)
type BlockchainLoggingObserver struct{}
func (blockchainObserver BlockchainLoggingObserver) NotifyBlockAdded(block Block) {
fmt.Printf("New block was added: %d\n"+
"\tTime: %v\n"+
"\tGas Limit: %d\n"+
"\tGas Used: %d\n"+
"\tNumber of Transactions %d\n", block.Number, time.Unix(block.Time, 0), block.GasLimit, block.GasUsed, len(block.Transactions))
}