mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +00:00
feat(ethclient): export GetTxBlockTraceOnTopOfBlock & GetNumSkippedTransactions & GetSkippedTransactionHashes & GetSkippedTransaction (#644)
This commit is contained in:
parent
a807a41fd1
commit
dab4354b62
2 changed files with 27 additions and 1 deletions
|
|
@ -28,6 +28,8 @@ import (
|
|||
"github.com/scroll-tech/go-ethereum/common"
|
||||
"github.com/scroll-tech/go-ethereum/common/hexutil"
|
||||
"github.com/scroll-tech/go-ethereum/core/types"
|
||||
"github.com/scroll-tech/go-ethereum/eth"
|
||||
"github.com/scroll-tech/go-ethereum/eth/tracers"
|
||||
"github.com/scroll-tech/go-ethereum/rpc"
|
||||
)
|
||||
|
||||
|
|
@ -342,6 +344,30 @@ func (ec *Client) GetBlockTraceByNumber(ctx context.Context, number *big.Int) (*
|
|||
return blockTrace, ec.c.CallContext(ctx, &blockTrace, "scroll_getBlockTraceByNumberOrHash", toBlockNumArg(number))
|
||||
}
|
||||
|
||||
// GetTxBlockTraceOnTopOfBlock returns the BlockTrace given the tx and block.
|
||||
func (ec *Client) GetTxBlockTraceOnTopOfBlock(ctx context.Context, tx *types.Transaction, blockNumberOrHash rpc.BlockNumberOrHash, config *tracers.TraceConfig) (*types.BlockTrace, error) {
|
||||
blockTrace := &types.BlockTrace{}
|
||||
return blockTrace, ec.c.CallContext(ctx, &blockTrace, "scroll_getTxBlockTraceOnTopOfBlock", tx, blockNumberOrHash, config)
|
||||
}
|
||||
|
||||
// GetNumSkippedTransactions returns the ...
|
||||
func (ec *Client) GetNumSkippedTransactions(ctx context.Context) (uint64, error) {
|
||||
var num uint64
|
||||
return num, ec.c.CallContext(ctx, &num, "scroll_getNumSkippedTransactions")
|
||||
}
|
||||
|
||||
// GetSkippedTransactionHashes returns the BlockTrace given the tx and block.
|
||||
func (ec *Client) GetSkippedTransactionHashes(ctx context.Context, from uint64, to uint64) ([]common.Hash, error) {
|
||||
hashes := []common.Hash{}
|
||||
return hashes, ec.c.CallContext(ctx, &hashes, "scroll_getSkippedTransactionHashes", from, to)
|
||||
}
|
||||
|
||||
// GetSkippedTransaction returns the BlockTrace given the tx and block.
|
||||
func (ec *Client) GetSkippedTransaction(ctx context.Context, txHash common.Hash) (*eth.RPCTransaction, error) {
|
||||
tx := ð.RPCTransaction{}
|
||||
return tx, ec.c.CallContext(ctx, &tx, "scroll_getSkippedTransaction", txHash)
|
||||
}
|
||||
|
||||
type rpcRowConsumption struct {
|
||||
RowConsumption types.RowConsumption `json:"rowConsumption"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
const (
|
||||
VersionMajor = 5 // Major version component of the current release
|
||||
VersionMinor = 1 // Minor version component of the current release
|
||||
VersionPatch = 20 // Patch version component of the current release
|
||||
VersionPatch = 21 // Patch version component of the current release
|
||||
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue