resolved conflicts

This commit is contained in:
Dustin Brickwood 2018-07-11 12:16:07 -04:00
parent 34b2b9b7b9
commit 79f6484d3a
4 changed files with 472 additions and 5 deletions

View file

@ -172,11 +172,14 @@ func SwriteTransactions(sqldb *sql.DB, tx *types.Transaction, blockHash common.H
Data: tx.Data(), Data: tx.Data(),
} }
//hash := txData.TxHash hash := txData.TxHash
txHash := txData.TxHash.Hex() txHash := txData.TxHash.Hex()
//prayer, _ := IShyftTracer.GetTracerToRun(hash) prayer, _ := IShyftTracer.GetTracerToRun(hash)
//fmt.Printf("%+v\n", prayer) fmt.Printf("%+v\n", prayer)
//var stack *node.Node
//var cfg *eth.Config
from := txData.From.Hex() from := txData.From.Hex()
blockHasher := txData.BlockHash blockHasher := txData.BlockHash

View file

@ -38,7 +38,6 @@ import (
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/trie" "github.com/ethereum/go-ethereum/trie"
) )
const ( const (
@ -533,6 +532,197 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*
// TraceTransaction returns the structured logs created during the execution of EVM // TraceTransaction returns the structured logs created during the execution of EVM
// and returns them as a JSON object. // and returns them as a JSON object.
func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) { func (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
fmt.Println("TRACE TRANSACTION ++++++!+!+!+!+!+!+!+!+!+!+!+!++!")
_, file, no, ok := runtime.Caller(1)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(2)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(3)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(4)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(5)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(6)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(7)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(8)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(9)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(10)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(11)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(12)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(13)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(14)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(15)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(16)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(17)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(18)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(19)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(20)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(21)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(22)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(23)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(24)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(25)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(26)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(27)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(28)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(29)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(30)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(31)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(32)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(33)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(34)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(35)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(36)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(37)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(38)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(39)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(40)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
fmt.Println("////////////// ++++++++++++++++ /////////////////// Phantom *(!*!*!*!*!*!**!*!*")
_, file, no, ok = runtime.Caller(41)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(42)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(43)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
_, file, no, ok = runtime.Caller(44)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
fmt.Println("////////////// ++++++++++++++++ /////////////////// TraceTransaction *(!*!*!*!*!*!**!*!*")
_, file, no, ok = runtime.Caller(45)
if ok {
fmt.Printf("called from %s#%d\n", file, no)
}
// NOTE:SHYFT
//fmt.Printf("\n\t[API_TRACER.GO api.config] %+v", api.config)
//fmt.Printf("\n\t[API_TRACER.GO api.eth] %+v\n", api.eth)
// Retrieve the transaction and assemble its EVM context
//fmt.Println("IN TRACE TRANSACTION the chaindb is ")
//fmt.Println(chaindb)
//fmt.Println("IN TRACE TRANSACTION the common hash is ")
//fmt.Println(hash)
tx, blockHash, _, index := core.GetTransaction(api.eth.ChainDb(), hash) tx, blockHash, _, index := core.GetTransaction(api.eth.ChainDb(), hash)
if tx == nil { if tx == nil {

View file

@ -1,5 +1,6 @@
package eth package eth
import ( import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
@ -41,3 +42,271 @@ var Global_config *Config
func setGlobalConfig(c *Config) { func setGlobalConfig(c *Config) {
Global_config = c Global_config = c
} }
//
//import (
// "github.com/ethereum/go-ethereum/common"
// "fmt"
// "github.com/ethereum/go-ethereum/core"
// "runtime"
// "context"
//)
//
////const (
//// // defaultTraceReexec is the number of blocks the tracer is willing to go back
//// // and reexecute to produce missing historical state necessary to run a specific
//// // trace.
//// defaultTraceReexec = uint64(128)
////)
//
////var api *eth.PrivateDebugAPI
//
//var EthereumObject interface{}
//
//type ShyftTracer struct {}
//
//func (st ShyftTracer) MyTraceTransaction(hash string) (interface{}) {
// //fmt.Println("THE stringed hash is in MYTRACETRANSACTION")
// //fmt.Println(hash)
// //fmt.Println(ethObjectInterface.GetEthObject())
// fmt.Println("CTXXXXXXXXXXXXXXX")
// common_hash := common.HexToHash(hash)
//
//
// fmt.Println("the chain db is in MyTraceTransaction")
// //fmt.Println(Chaindb_global)
// if Chaindb_global == nil {
// return nil
// }
//
// tx, blockHash, _, index := core.GetTransaction(Chaindb_global, common_hash)
//
// if tx == nil {
// fmt.Println("TRANSACTION NOT FOUND IN MyTraceTransaction +++++++++")
// }
//
// reexec := defaultTraceReexec
// //if config != nil && config.Reexec != nil {
// // reexec = *config.Reexec
// //}
// msg, vmctx, statedb, err := DebugApi.computeTxEnv(blockHash, int(index), reexec)
//
// fmt.Println("stuff and nonsense")
// fmt.Println(msg)
// fmt.Println(vmctx)
// fmt.Println(statedb)
// fmt.Println(err)
// fmt.Println("THIS CTX")
// //fmt.Println("the tx is ")
// //fmt.Println(tx)
// //fmt.Println(blockHash)
// //fmt.Println(index)
// //DebugApi.traceTxTest(msg, vmctx, statedb, config)
// return 42
//}
//
//func (api *PrivateDebugAPI) TraceTransactionTest(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error) {
// fmt.Println("TRACE TRANSACTION ++++++!+!+!+!+!+!+!+!+!+!+!+!++!")
// _, file, no, ok := runtime.Caller(1)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(2)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(3)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(4)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(5)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(6)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(7)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(8)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(9)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(10)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(11)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(12)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(13)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(14)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(15)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(16)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(17)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(18)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(19)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(20)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(21)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(22)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(23)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(24)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(25)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(26)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(27)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(28)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(29)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(30)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(31)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(32)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(33)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(34)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(35)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(36)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(37)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(38)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(39)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(40)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// fmt.Println("////////////// ++++++++++++++++ /////////////////// Phantom *(!*!*!*!*!*!**!*!*")
// _, file, no, ok = runtime.Caller(41)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(42)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(43)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// _, file, no, ok = runtime.Caller(44)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
// fmt.Println("////////////// ++++++++++++++++ /////////////////// TraceTransaction *(!*!*!*!*!*!**!*!*")
// _, file, no, ok = runtime.Caller(45)
// if ok {
// fmt.Printf("called from %s#%d\n", file, no)
// }
//
// tx, blockHash, _, index := core.GetTransaction(api.eth.ChainDb(), hash)
// if tx == nil {
// return nil, fmt.Errorf("transaction %x not found", hash)
// }
//
// reexec := defaultTraceReexec
// if config != nil && config.Reexec != nil {
// reexec = *config.Reexec
// }
// msg, vmctx, statedb, err := api.computeTxEnv(blockHash, int(index), reexec)
// if err != nil {
// return nil, err
// }
// fmt.Println("CTX +++++++++++++++++++++++", ctx)
// return api.traceTxTest(ctx, msg, vmctx, statedb, config)
//}
//
//func setEthObject(ethobj interface{}){
// EthereumObject = ethobj
//}

View file

@ -7,3 +7,8 @@ import (
type IShyftTracer interface { type IShyftTracer interface {
GetTracerToRun(hash common.Hash) (interface{}, error) GetTracerToRun(hash common.Hash) (interface{}, error)
} }
//type IShyftTracer interface {
// MyTraceTransaction(hash string) (interface{})
//}