aboutsummaryrefslogblamecommitdiff
path: root/consensus/dummy/consensus.go
blob: 42e224d51ec5b9f17e4e9a21480eed9a7bfaf772 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


             






                                  




                                               
                                               

                                                
                                              

 
                                                                                                                                                                   
                                                                                                             
                                                                     
                                                                                    
 
                                
                                                      
                                                 


                                                               
                                                    

 
                         
                              


                                                          
                                   


     
                                                                                                                                           


     






                                                                           


                             
                                                                                                                                     
                                                                              

                                                                                                                 






                                                                                        

                                         
































                                                                                                                       

 
                                                                                                                                        












                                                                                             


                                                                               
                                   

 
                                                                                                                 










                                                                    

 
                                                                                                                                                  

















































                                                                                                     


                                                                                              













































                                                                                                                

 
                                                                                                    
                  

 
                                                                                                 

                                         

 
                                  
                                                                






                                                                                    

 
                                                                                                                                                     
                                                                                  
                           
                                                 
                                                                     
                              


                                       


                                                                                    
 
                                                                  
                                                                                          

 
                                                                                                                                                     




                                           


                                
              


                                                                            



                                          


















                                           

 
                                                                                                                        
                            

 
                                                                                  




                                           


                                        
                  
 






                                                                                             
package dummy

import (
	"errors"
	"fmt"
	"golang.org/x/crypto/sha3"
	"math/big"
	"runtime"
	"time"

	"github.com/ava-labs/coreth/consensus"
	"github.com/ava-labs/coreth/core/state"
	"github.com/ava-labs/coreth/core/types"
	"github.com/ava-labs/coreth/params"
	"github.com/ava-labs/coreth/rpc"
	mapset "github.com/deckarep/golang-set"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/rlp"
	"github.com/ethereum/go-ethereum/trie"
)

type OnFinalizeCallbackType = func(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header)
type OnFinalizeAndAssembleCallbackType = func(state *state.StateDB, txs []*types.Transaction) ([]byte, error)
type OnAPIsCallbackType = func(consensus.ChainHeaderReader) []rpc.API
type OnExtraStateChangeType = func(block *types.Block, statedb *state.StateDB) error

type ConsensusCallbacks struct {
	OnSeal                func(*types.Block) error
	OnSealHash            func(*types.Header)