Commit 14717978 authored by George Hotz's avatar George Hotz

makes it to consensus finalize

parent e10286b5
package ethash
import (
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/common"
......@@ -9,10 +10,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
)
type Ethash struct {
/*Author
Finalize*/
}
type Ethash struct{}
func (ethash *Ethash) Author(header *types.Header) (common.Address, error) {
return header.Coinbase, nil
......@@ -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) {
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) {
......
......@@ -4,7 +4,6 @@ import (
"fmt"
"os"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
......@@ -13,20 +12,11 @@ import (
"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() {
bc := core.NewBlockChain()
statedb := &state.StateDB{}
vmconfig := vm.Config{}
processor := core.NewStateProcessor(params.MainnetChainConfig, bc, nil)
processor := core.NewStateProcessor(params.MainnetChainConfig, bc, bc.Engine())
fmt.Println("made state processor")
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