mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
writing internals correctly
This commit is contained in:
parent
185c35523d
commit
b9dda84e30
2 changed files with 21 additions and 2 deletions
|
|
@ -32,6 +32,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/log"
|
||||
"gopkg.in/olebedev/go-duktape.v3"
|
||||
"database/sql"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js.
|
||||
|
|
@ -595,6 +596,12 @@ func (i *Internals) SWriteInteralTxs(hash common.Hash) {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("[VALUE]", reflect.TypeOf(i.Value))
|
||||
test := "0x3782dace9d900000"
|
||||
if test == i.Value {
|
||||
fmt.Println("[EQUAL]: ", test, i.Value)
|
||||
}
|
||||
|
||||
gas, _ := hexutil.DecodeUint64(i.Gas)
|
||||
gasUsed, _ := hexutil.DecodeUint64(i.GasUsed)
|
||||
|
||||
|
|
@ -609,6 +616,11 @@ func (i *Internals) SWriteInteralTxs(hash common.Hash) {
|
|||
}
|
||||
|
||||
func (i *Internals) InternalRecursive(hash common.Hash) {
|
||||
amount, _ := hexutil.DecodeUint64(i.Value)
|
||||
if i.Type != "CREATE" {
|
||||
fmt.Println("[INSIDE RECURSIVE VALUE]", amount)
|
||||
fmt.Printf("%+v", i)
|
||||
}
|
||||
i.SWriteInteralTxs(hash)
|
||||
lengthOfCalls := len(i.Calls)
|
||||
if lengthOfCalls == 0 {
|
||||
|
|
@ -713,7 +725,8 @@ func (jst *Tracer) SGetResult(hash common.Hash) (json.RawMessage, error) {
|
|||
if err := json.Unmarshal(result, &dat); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println("[THIS IS HASH]", hash.Hex())
|
||||
//fmt.Println("[THIS IS HASH]", hash.Hex())
|
||||
//fmt.Println("DAT DATA STRUCTURE" , dat)
|
||||
dat.InternalRecursive(hash)
|
||||
|
||||
return result, jst.err
|
||||
|
|
|
|||
|
|
@ -4,12 +4,18 @@ var Transfers2 = artifacts.require("Transfers2");
|
|||
contract('Transfers', function(accounts) {
|
||||
var addressA = web3.eth.accounts[0];
|
||||
var addressB = web3.eth.accounts[1];
|
||||
console.log("Addr A:", addressA)
|
||||
console.log("Addr B:", addressB)
|
||||
|
||||
var transfers;
|
||||
web3.eth.defaultAccount = web3.eth.accounts[0];
|
||||
|
||||
it("should initialize", async() => {
|
||||
transfers = await Transfers.new();
|
||||
transfers2 = await Transfers2.new();
|
||||
console.log("Transfer addr1", transfers.address)
|
||||
console.log("Transfer addr2", transfers2.address)
|
||||
|
||||
assert(transfers !== undefined, "");
|
||||
assert(transfers2 !== undefined, "");
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue