aboutsummaryrefslogtreecommitdiff
path: root/core/vm/gen_structlog.go
diff options
context:
space:
mode:
authorTed Yin <[email protected]>2020-09-18 13:14:29 -0400
committerGitHub <[email protected]>2020-09-18 13:14:29 -0400
commitd048937c48753d9eaef771bf71820cf95d79df26 (patch)
tree1a7f65fcd72e77092525ab01625b8b9d365e3e40 /core/vm/gen_structlog.go
parent7d1388c743b4ec8f4a86bea95bfada785dee83f7 (diff)
parent7d8c85cf8895b0f998d8eafb02f99d5b689fcd59 (diff)
Merge pull request #34 from ava-labs/devv0.3.0-rc.5
Dev
Diffstat (limited to 'core/vm/gen_structlog.go')
-rw-r--r--core/vm/gen_structlog.go26
1 files changed, 23 insertions, 3 deletions
diff --git a/core/vm/gen_structlog.go b/core/vm/gen_structlog.go
index 038841c..ac1a907 100644
--- a/core/vm/gen_structlog.go
+++ b/core/vm/gen_structlog.go
@@ -6,9 +6,9 @@ import (
"encoding/json"
"math/big"
- "github.com/ava-labs/go-ethereum/common"
- "github.com/ava-labs/go-ethereum/common/hexutil"
- "github.com/ava-labs/go-ethereum/common/math"
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/hexutil"
+ "github.com/ethereum/go-ethereum/common/math"
)
var _ = (*structLogMarshaling)(nil)
@@ -23,6 +23,8 @@ func (s StructLog) MarshalJSON() ([]byte, error) {
Memory hexutil.Bytes `json:"memory"`
MemorySize int `json:"memSize"`
Stack []*math.HexOrDecimal256 `json:"stack"`
+ ReturnStack []math.HexOrDecimal64 `json:"returnStack"`
+ ReturnData []byte `json:"returnData"`
Storage map[common.Hash]common.Hash `json:"-"`
Depth int `json:"depth"`
RefundCounter uint64 `json:"refund"`
@@ -43,6 +45,13 @@ func (s StructLog) MarshalJSON() ([]byte, error) {
enc.Stack[k] = (*math.HexOrDecimal256)(v)
}
}
+ if s.ReturnStack != nil {
+ enc.ReturnStack = make([]math.HexOrDecimal64, len(s.ReturnStack))
+ for k, v := range s.ReturnStack {
+ enc.ReturnStack[k] = math.HexOrDecimal64(v)
+ }
+ }
+ enc.ReturnData = s.ReturnData
enc.Storage = s.Storage
enc.Depth = s.Depth
enc.RefundCounter = s.RefundCounter
@@ -62,6 +71,8 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
Memory *hexutil.Bytes `json:"memory"`
MemorySize *int `json:"memSize"`
Stack []*math.HexOrDecimal256 `json:"stack"`
+ ReturnStack []math.HexOrDecimal64 `json:"returnStack"`
+ ReturnData []byte `json:"returnData"`
Storage map[common.Hash]common.Hash `json:"-"`
Depth *int `json:"depth"`
RefundCounter *uint64 `json:"refund"`
@@ -95,6 +106,15 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
s.Stack[k] = (*big.Int)(v)
}
}
+ if dec.ReturnStack != nil {
+ s.ReturnStack = make([]uint32, len(dec.ReturnStack))
+ for k, v := range dec.ReturnStack {
+ s.ReturnStack[k] = uint32(v)
+ }
+ }
+ if dec.ReturnData != nil {
+ s.ReturnData = dec.ReturnData
+ }
if dec.Storage != nil {
s.Storage = dec.Storage
}