Commit baf20010 authored by bas-vk's avatar bas-vk Committed by Felix Lange

core/types: rename txdata.gasLimit -> txdata.gas in JSON (#13848)

parent 16afb5c4
...@@ -15,7 +15,7 @@ func (t txdata) MarshalJSON() ([]byte, error) { ...@@ -15,7 +15,7 @@ func (t txdata) MarshalJSON() ([]byte, error) {
type txdataJSON struct { type txdataJSON struct {
AccountNonce hexutil.Uint64 `json:"nonce"` AccountNonce hexutil.Uint64 `json:"nonce"`
Price *hexutil.Big `json:"gasPrice"` Price *hexutil.Big `json:"gasPrice"`
GasLimit *hexutil.Big `json:"gasLimit"` GasLimit *hexutil.Big `json:"gas"`
Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"` Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"`
Amount *hexutil.Big `json:"value"` Amount *hexutil.Big `json:"value"`
Payload hexutil.Bytes `json:"input"` Payload hexutil.Bytes `json:"input"`
...@@ -42,7 +42,7 @@ func (t *txdata) UnmarshalJSON(input []byte) error { ...@@ -42,7 +42,7 @@ func (t *txdata) UnmarshalJSON(input []byte) error {
type txdataJSON struct { type txdataJSON struct {
AccountNonce *hexutil.Uint64 `json:"nonce"` AccountNonce *hexutil.Uint64 `json:"nonce"`
Price *hexutil.Big `json:"gasPrice"` Price *hexutil.Big `json:"gasPrice"`
GasLimit *hexutil.Big `json:"gasLimit"` GasLimit *hexutil.Big `json:"gas"`
Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"` Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"`
Amount *hexutil.Big `json:"value"` Amount *hexutil.Big `json:"value"`
Payload hexutil.Bytes `json:"input"` Payload hexutil.Bytes `json:"input"`
...@@ -65,7 +65,7 @@ func (t *txdata) UnmarshalJSON(input []byte) error { ...@@ -65,7 +65,7 @@ func (t *txdata) UnmarshalJSON(input []byte) error {
} }
x.Price = (*big.Int)(dec.Price) x.Price = (*big.Int)(dec.Price)
if dec.GasLimit == nil { 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) x.GasLimit = (*big.Int)(dec.GasLimit)
if dec.Recipient != nil { if dec.Recipient != nil {
......
...@@ -57,7 +57,7 @@ type Transaction struct { ...@@ -57,7 +57,7 @@ type Transaction struct {
type txdata struct { type txdata struct {
AccountNonce uint64 `json:"nonce"` AccountNonce uint64 `json:"nonce"`
Price *big.Int `json:"gasPrice"` 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 Recipient *common.Address `json:"to" optional:"yes" rlp:"nil"` // nil means contract creation
Amount *big.Int `json:"value"` Amount *big.Int `json:"value"`
Payload []byte `json:"input"` Payload []byte `json:"input"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment