Commit 14717978 authored by George Hotz's avatar George Hotz

makes it to consensus finalize

parent e10286b5
package ethash package ethash
import ( import (
"fmt"
"math/big" "math/big"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -9,10 +10,7 @@ import ( ...@@ -9,10 +10,7 @@ import (
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
) )
type Ethash struct { type Ethash struct{}
/*Author
Finalize*/
}
func (ethash *Ethash) Author(header *types.Header) (common.Address, error) { func (ethash *Ethash) Author(header *types.Header) (common.Address, error) {
return header.Coinbase, nil return header.Coinbase, nil
...@@ -27,6 +25,7 @@ func (ethash *Ethash) Close() error { ...@@ -27,6 +25,7 @@ func (ethash *Ethash) Close() error {
} }
func (ethash *Ethash) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header) { func (ethash *Ethash) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header) {
fmt.Println("consensus finalize")
} }
func (ethash *Ethash) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) { func (ethash *Ethash) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) {
......
...@@ -4,7 +4,6 @@ import ( ...@@ -4,7 +4,6 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
...@@ -13,20 +12,11 @@ import ( ...@@ -13,20 +12,11 @@ import (
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
) )
type DumbEngine struct {
/*Author
Finalize*/
}
func (ethash *DumbEngine) Author(header *types.Header) (common.Address, error) {
return header.Coinbase, nil
}
func main() { func main() {
bc := core.NewBlockChain() bc := core.NewBlockChain()
statedb := &state.StateDB{} statedb := &state.StateDB{}
vmconfig := vm.Config{} vmconfig := vm.Config{}
processor := core.NewStateProcessor(params.MainnetChainConfig, bc, nil) processor := core.NewStateProcessor(params.MainnetChainConfig, bc, bc.Engine())
fmt.Println("made state processor") fmt.Println("made state processor")
f, _ := os.Open("../data/block_13247502") f, _ := os.Open("../data/block_13247502")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment