From baf20010e72e31a34e0e2f7c58ccb8135e388b83 Mon Sep 17 00:00:00 2001 From: bas-vk Date: Wed, 29 Mar 2017 11:59:13 +0200 Subject: core/types: rename txdata.gasLimit -> txdata.gas in JSON (#13848) --- core/types/gen_tx_json.go | 6 +++--- core/types/transaction.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/types/gen_tx_json.go b/core/types/gen_tx_json.go index 0adcc59b5..6101b9637 100644 --- a/core/types/gen_tx_json.go +++ b/core/types/gen_tx_json.go @@ -15,7 +15,7 @@ func (t txdata) MarshalJSON() ([]byte, error) { type txdataJSON struct { AccountNonce hexutil.Uint64 `json:"nonce"` Price *hexutil.Big `json:"gasPrice"` - GasLimit *hexutil.Big `json:"gasLimit"` + GasLimit *hexutil.Big `json:"gas"` Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"` Amount *hexutil.Big `json:"value"` Payload hexutil.Bytes `json:"input"` @@ -42,7 +42,7 @@ func (t *txdata) UnmarshalJSON(input []byte) error { type txdataJSON struct { AccountNonce *hexutil.Uint64 `json:"nonce"` Price *hexutil.Big `json:"gasPrice"` - GasLimit *hexutil.Big `json:"gasLimit"` + GasLimit *hexutil.Big `json:"gas"` Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"` Amount *hexutil.Big `json:"value"` Payload hexutil.Bytes `json:"input"` @@ -65,7 +65,7 @@ func (t *txdata) UnmarshalJSON(input []byte) error { } x.Price = (*big.Int)(dec.Price) if dec.GasLimit == nil { - return errors.New("missing required field 'gasLimit' for txdata") + return errors.New("missing required field 'gas' for txdata") } x.GasLimit = (*big.Int)(dec.GasLimit) if dec.Recipient != nil { diff --git a/core/types/transaction.go b/core/types/transaction.go index ee2f25b52..3945684a1 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -57,7 +57,7 @@ type Transaction struct { type txdata struct { AccountNonce uint64 `json:"nonce"` Price *big.Int `json:"gasPrice"` - GasLimit *big.Int `json:"gasLimit"` + GasLimit *big.Int `json:"gas"` Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"` // nil means contract creation Amount *big.Int `json:"value"` Payload []byte `json:"input"` -- cgit v1.2.3