mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 02:10:46 +00:00
feat: expose ethapi.NewRPCTransaction and ethapi.NewRPCPendingTransaction (#260)
This commit is contained in:
parent
b4a7f35411
commit
e673c70970
2 changed files with 48 additions and 1 deletions
30
internal/ethapi/api.libevm.go
Normal file
30
internal/ethapi/api.libevm.go
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright 2026 the libevm authors.
|
||||||
|
//
|
||||||
|
// The libevm additions to go-ethereum are free software: you can redistribute
|
||||||
|
// them and/or modify them under the terms of the GNU Lesser General Public License
|
||||||
|
// as published by the Free Software Foundation, either version 3 of the License,
|
||||||
|
// or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// The libevm additions are distributed in the hope that they will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||||
|
// General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with the go-ethereum library. If not, see
|
||||||
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package ethapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"math/big"
|
||||||
|
|
||||||
|
"github.com/ava-labs/libevm/common"
|
||||||
|
"github.com/ava-labs/libevm/core/types"
|
||||||
|
"github.com/ava-labs/libevm/params"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewRPCTransaction exports the [newRPCTransaction] function.
|
||||||
|
func NewRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, blockTime uint64, index uint64, baseFee *big.Int, config *params.ChainConfig) *RPCTransaction {
|
||||||
|
return newRPCTransaction(tx, blockHash, blockNumber, blockTime, index, baseFee, config)
|
||||||
|
}
|
||||||
|
|
@ -17,7 +17,14 @@
|
||||||
// Package ethapi exposes the internal ethapi package.
|
// Package ethapi exposes the internal ethapi package.
|
||||||
package ethapi
|
package ethapi
|
||||||
|
|
||||||
import "github.com/ava-labs/libevm/internal/ethapi"
|
import (
|
||||||
|
"math/big"
|
||||||
|
|
||||||
|
"github.com/ava-labs/libevm/common"
|
||||||
|
"github.com/ava-labs/libevm/core/types"
|
||||||
|
"github.com/ava-labs/libevm/internal/ethapi"
|
||||||
|
"github.com/ava-labs/libevm/params"
|
||||||
|
)
|
||||||
|
|
||||||
// Type aliases required by constructors.
|
// Type aliases required by constructors.
|
||||||
type (
|
type (
|
||||||
|
|
@ -69,3 +76,13 @@ func NewTxPoolAPI(b Backend) *TxPoolAPI {
|
||||||
func NewDebugAPI(b Backend) *DebugAPI {
|
func NewDebugAPI(b Backend) *DebugAPI {
|
||||||
return ethapi.NewDebugAPI(b)
|
return ethapi.NewDebugAPI(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewRPCPendingTransaction is identical to [ethapi.NewRPCPendingTransaction].
|
||||||
|
func NewRPCPendingTransaction(tx *types.Transaction, current *types.Header, config *params.ChainConfig) *RPCTransaction {
|
||||||
|
return ethapi.NewRPCPendingTransaction(tx, current, config)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewRPCTransaction is identical to [ethapi.NewRPCTransaction].
|
||||||
|
func NewRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber uint64, blockTime uint64, index uint64, baseFee *big.Int, config *params.ChainConfig) *RPCTransaction {
|
||||||
|
return ethapi.NewRPCTransaction(tx, blockHash, blockNumber, blockTime, index, baseFee, config)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue