mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
core/types: convert status type from uint to uint64 (#16784)
This commit is contained in:
parent
a944232072
commit
aa88078dd1
3 changed files with 9 additions and 9 deletions
|
|
@ -508,7 +508,7 @@ func (x *XDPoS) CacheNoneTIPSigningTxs(header *types.Header, txs []*types.Transa
|
||||||
signTxs := []*types.Transaction{}
|
signTxs := []*types.Transaction{}
|
||||||
for _, tx := range txs {
|
for _, tx := range txs {
|
||||||
if tx.IsSigningTransaction() {
|
if tx.IsSigningTransaction() {
|
||||||
var b uint
|
var b uint64
|
||||||
for _, r := range receipts {
|
for _, r := range receipts {
|
||||||
if r.TxHash == tx.Hash() {
|
if r.TxHash == tx.Hash() {
|
||||||
if len(r.PostState) > 0 {
|
if len(r.PostState) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
|
||||||
type Receipt struct {
|
type Receipt struct {
|
||||||
Type hexutil.Uint64 `json:"type,omitempty"`
|
Type hexutil.Uint64 `json:"type,omitempty"`
|
||||||
PostState hexutil.Bytes `json:"root"`
|
PostState hexutil.Bytes `json:"root"`
|
||||||
Status hexutil.Uint `json:"status"`
|
Status hexutil.Uint64 `json:"status"`
|
||||||
CumulativeGasUsed hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"`
|
CumulativeGasUsed hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"`
|
||||||
Bloom Bloom `json:"logsBloom" gencodec:"required"`
|
Bloom Bloom `json:"logsBloom" gencodec:"required"`
|
||||||
Logs []*Log `json:"logs" gencodec:"required"`
|
Logs []*Log `json:"logs" gencodec:"required"`
|
||||||
|
|
@ -32,7 +32,7 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
|
||||||
var enc Receipt
|
var enc Receipt
|
||||||
enc.Type = hexutil.Uint64(r.Type)
|
enc.Type = hexutil.Uint64(r.Type)
|
||||||
enc.PostState = r.PostState
|
enc.PostState = r.PostState
|
||||||
enc.Status = hexutil.Uint(r.Status)
|
enc.Status = hexutil.Uint64(r.Status)
|
||||||
enc.CumulativeGasUsed = hexutil.Uint64(r.CumulativeGasUsed)
|
enc.CumulativeGasUsed = hexutil.Uint64(r.CumulativeGasUsed)
|
||||||
enc.Bloom = r.Bloom
|
enc.Bloom = r.Bloom
|
||||||
enc.Logs = r.Logs
|
enc.Logs = r.Logs
|
||||||
|
|
@ -50,7 +50,7 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
|
||||||
type Receipt struct {
|
type Receipt struct {
|
||||||
Type *hexutil.Uint64 `json:"type,omitempty"`
|
Type *hexutil.Uint64 `json:"type,omitempty"`
|
||||||
PostState *hexutil.Bytes `json:"root"`
|
PostState *hexutil.Bytes `json:"root"`
|
||||||
Status *hexutil.Uint `json:"status"`
|
Status *hexutil.Uint64 `json:"status"`
|
||||||
CumulativeGasUsed *hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"`
|
CumulativeGasUsed *hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"`
|
||||||
Bloom *Bloom `json:"logsBloom" gencodec:"required"`
|
Bloom *Bloom `json:"logsBloom" gencodec:"required"`
|
||||||
Logs []*Log `json:"logs" gencodec:"required"`
|
Logs []*Log `json:"logs" gencodec:"required"`
|
||||||
|
|
@ -72,7 +72,7 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
|
||||||
r.PostState = *dec.PostState
|
r.PostState = *dec.PostState
|
||||||
}
|
}
|
||||||
if dec.Status != nil {
|
if dec.Status != nil {
|
||||||
r.Status = uint(*dec.Status)
|
r.Status = uint64(*dec.Status)
|
||||||
}
|
}
|
||||||
if dec.CumulativeGasUsed == nil {
|
if dec.CumulativeGasUsed == nil {
|
||||||
return errors.New("missing required field 'cumulativeGasUsed' for Receipt")
|
return errors.New("missing required field 'cumulativeGasUsed' for Receipt")
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,10 @@ var errEmptyTypedReceipt = errors.New("empty typed receipt bytes")
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// ReceiptStatusFailed is the status code of a transaction if execution failed.
|
// ReceiptStatusFailed is the status code of a transaction if execution failed.
|
||||||
ReceiptStatusFailed = uint(0)
|
ReceiptStatusFailed = uint64(0)
|
||||||
|
|
||||||
// ReceiptStatusSuccessful is the status code of a transaction if execution succeeded.
|
// ReceiptStatusSuccessful is the status code of a transaction if execution succeeded.
|
||||||
ReceiptStatusSuccessful = uint(1)
|
ReceiptStatusSuccessful = uint64(1)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Receipt represents the results of a transaction.
|
// Receipt represents the results of a transaction.
|
||||||
|
|
@ -52,7 +52,7 @@ type Receipt struct {
|
||||||
// Consensus fields: These fields are defined by the Yellow Paper
|
// Consensus fields: These fields are defined by the Yellow Paper
|
||||||
Type uint8 `json:"type,omitempty"`
|
Type uint8 `json:"type,omitempty"`
|
||||||
PostState []byte `json:"root"`
|
PostState []byte `json:"root"`
|
||||||
Status uint `json:"status"`
|
Status uint64 `json:"status"`
|
||||||
CumulativeGasUsed uint64 `json:"cumulativeGasUsed" gencodec:"required"`
|
CumulativeGasUsed uint64 `json:"cumulativeGasUsed" gencodec:"required"`
|
||||||
Bloom Bloom `json:"logsBloom" gencodec:"required"`
|
Bloom Bloom `json:"logsBloom" gencodec:"required"`
|
||||||
Logs []*Log `json:"logs" gencodec:"required"`
|
Logs []*Log `json:"logs" gencodec:"required"`
|
||||||
|
|
@ -73,7 +73,7 @@ type Receipt struct {
|
||||||
type receiptMarshaling struct {
|
type receiptMarshaling struct {
|
||||||
Type hexutil.Uint64
|
Type hexutil.Uint64
|
||||||
PostState hexutil.Bytes
|
PostState hexutil.Bytes
|
||||||
Status hexutil.Uint
|
Status hexutil.Uint64
|
||||||
CumulativeGasUsed hexutil.Uint64
|
CumulativeGasUsed hexutil.Uint64
|
||||||
GasUsed hexutil.Uint64
|
GasUsed hexutil.Uint64
|
||||||
BlockNumber *hexutil.Big
|
BlockNumber *hexutil.Big
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue