|
|
@ -33,6 +33,7 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
"github.com/ethereum/go-ethereum/core/types" |
|
|
|
"github.com/ethereum/go-ethereum/eth/filters" |
|
|
|
"github.com/ethereum/go-ethereum/eth/filters" |
|
|
|
"github.com/ethereum/go-ethereum/internal/ethapi" |
|
|
|
"github.com/ethereum/go-ethereum/internal/ethapi" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/rlp" |
|
|
|
"github.com/ethereum/go-ethereum/rpc" |
|
|
|
"github.com/ethereum/go-ethereum/rpc" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -516,10 +517,18 @@ func (t *Transaction) V(ctx context.Context) (hexutil.Big, error) { |
|
|
|
return hexutil.Big(*v), nil |
|
|
|
return hexutil.Big(*v), nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (t *Transaction) Raw(ctx context.Context) (hexutil.Bytes, error) { |
|
|
|
|
|
|
|
tx, err := t.resolve(ctx) |
|
|
|
|
|
|
|
if err != nil || tx == nil { |
|
|
|
|
|
|
|
return hexutil.Bytes{}, err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return tx.MarshalBinary() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (t *Transaction) RawReceipt(ctx context.Context) (hexutil.Bytes, error) { |
|
|
|
func (t *Transaction) RawReceipt(ctx context.Context) (hexutil.Bytes, error) { |
|
|
|
receipt, err := t.getReceipt(ctx) |
|
|
|
receipt, err := t.getReceipt(ctx) |
|
|
|
if err != nil || receipt == nil { |
|
|
|
if err != nil || receipt == nil { |
|
|
|
return nil, err |
|
|
|
return hexutil.Bytes{}, err |
|
|
|
} |
|
|
|
} |
|
|
|
return receipt.MarshalBinary() |
|
|
|
return receipt.MarshalBinary() |
|
|
|
} |
|
|
|
} |
|
|
@ -798,6 +807,22 @@ func (b *Block) TotalDifficulty(ctx context.Context) (hexutil.Big, error) { |
|
|
|
return hexutil.Big(*td), nil |
|
|
|
return hexutil.Big(*td), nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (b *Block) RawHeader(ctx context.Context) (hexutil.Bytes, error) { |
|
|
|
|
|
|
|
header, err := b.resolveHeader(ctx) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return hexutil.Bytes{}, err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return rlp.EncodeToBytes(header) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (b *Block) Raw(ctx context.Context) (hexutil.Bytes, error) { |
|
|
|
|
|
|
|
block, err := b.resolve(ctx) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
return hexutil.Bytes{}, err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return rlp.EncodeToBytes(block) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// BlockNumberArgs encapsulates arguments to accessors that specify a block number.
|
|
|
|
// BlockNumberArgs encapsulates arguments to accessors that specify a block number.
|
|
|
|
type BlockNumberArgs struct { |
|
|
|
type BlockNumberArgs struct { |
|
|
|
// TODO: Ideally we could use input unions to allow the query to specify the
|
|
|
|
// TODO: Ideally we could use input unions to allow the query to specify the
|
|
|
|