Skip to content

Commit

Permalink
core/types: gencodec JSON marshalling for ReturnData struct
Browse files Browse the repository at this point in the history
  • Loading branch information
reductionista committed Apr 25, 2018
1 parent 0cc11a6 commit 3743b1f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
52 changes: 52 additions & 0 deletions core/types/gen_return_data.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
)

//go:generate gencodec -type txdata -field-override txdataMarshaling -out gen_tx_json.go
//go:generate gencodec -type ReturnData -field-override returnDataMarshaling -out gen_return_data.go

var (
ErrInvalidSig = errors.New("invalid transaction v, r, s values")
Expand Down Expand Up @@ -92,6 +93,10 @@ type ReturnData struct {
Removed bool `json:"removed"`
}

type returnDataMarshaling struct {
Data hexutil.Bytes
}

func NewTransaction(nonce uint64, to common.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transaction {
return newTransaction(nonce, &to, amount, gasLimit, gasPrice, data)
}
Expand Down

0 comments on commit 3743b1f

Please sign in to comment.