mirror of
https://github.com/status-im/status-go.git
synced 2025-01-10 22:56:40 +00:00
e4cbce12c4
* Update `github.com/ethereum/go-ethereum` package to 1.8.1 branch. Part of #638 * Fix code due to some signature changes. Part of #638 * use upstream for whisper backend * Add patch to downgrade usage of Whisper v6 to v5 in some geth 1.8.1 vendor files. Part of #638 * Take into account the DNS rebinding protection introduced in 1.8.0 by adding exception for localhost. Part of #638 * Add patches required for cross-compiled builds starting with geth 1.8.0. Only applied during build. Part of #638 * Update expected JSON result in `TestRegressionGetTransactionReceipt()` and `TestCallRawResultGetTransactionReceipt()`. Part of #665 * Fix some failing e2e tests. Part of #638 * Address comments in PR #702. Part of #638
81 lines
2.1 KiB
Go
81 lines
2.1 KiB
Go
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
package tests
|
|
|
|
import (
|
|
"encoding/json"
|
|
"math/big"
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
"github.com/ethereum/go-ethereum/common/math"
|
|
)
|
|
|
|
var _ = (*stTransactionMarshaling)(nil)
|
|
|
|
func (s stTransaction) MarshalJSON() ([]byte, error) {
|
|
type stTransaction struct {
|
|
GasPrice *math.HexOrDecimal256 `json:"gasPrice"`
|
|
Nonce math.HexOrDecimal64 `json:"nonce"`
|
|
To string `json:"to"`
|
|
Data []string `json:"data"`
|
|
GasLimit []math.HexOrDecimal64 `json:"gasLimit"`
|
|
Value []string `json:"value"`
|
|
PrivateKey hexutil.Bytes `json:"secretKey"`
|
|
}
|
|
var enc stTransaction
|
|
enc.GasPrice = (*math.HexOrDecimal256)(s.GasPrice)
|
|
enc.Nonce = math.HexOrDecimal64(s.Nonce)
|
|
enc.To = s.To
|
|
enc.Data = s.Data
|
|
if s.GasLimit != nil {
|
|
enc.GasLimit = make([]math.HexOrDecimal64, len(s.GasLimit))
|
|
for k, v := range s.GasLimit {
|
|
enc.GasLimit[k] = math.HexOrDecimal64(v)
|
|
}
|
|
}
|
|
enc.Value = s.Value
|
|
enc.PrivateKey = s.PrivateKey
|
|
return json.Marshal(&enc)
|
|
}
|
|
|
|
func (s *stTransaction) UnmarshalJSON(input []byte) error {
|
|
type stTransaction struct {
|
|
GasPrice *math.HexOrDecimal256 `json:"gasPrice"`
|
|
Nonce *math.HexOrDecimal64 `json:"nonce"`
|
|
To *string `json:"to"`
|
|
Data []string `json:"data"`
|
|
GasLimit []math.HexOrDecimal64 `json:"gasLimit"`
|
|
Value []string `json:"value"`
|
|
PrivateKey *hexutil.Bytes `json:"secretKey"`
|
|
}
|
|
var dec stTransaction
|
|
if err := json.Unmarshal(input, &dec); err != nil {
|
|
return err
|
|
}
|
|
if dec.GasPrice != nil {
|
|
s.GasPrice = (*big.Int)(dec.GasPrice)
|
|
}
|
|
if dec.Nonce != nil {
|
|
s.Nonce = uint64(*dec.Nonce)
|
|
}
|
|
if dec.To != nil {
|
|
s.To = *dec.To
|
|
}
|
|
if dec.Data != nil {
|
|
s.Data = dec.Data
|
|
}
|
|
if dec.GasLimit != nil {
|
|
s.GasLimit = make([]uint64, len(dec.GasLimit))
|
|
for k, v := range dec.GasLimit {
|
|
s.GasLimit[k] = uint64(v)
|
|
}
|
|
}
|
|
if dec.Value != nil {
|
|
s.Value = dec.Value
|
|
}
|
|
if dec.PrivateKey != nil {
|
|
s.PrivateKey = *dec.PrivateKey
|
|
}
|
|
return nil
|
|
}
|