Backend: add GetContractCode

This commit is contained in:
Roy Crihfield 2023-06-22 15:29:18 +08:00
parent 7f816cbd3f
commit 79429d25df

View File

@ -11,8 +11,9 @@ import (
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
gcore "github.com/ethereum/go-ethereum/core" gcore "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
gparams "github.com/ethereum/go-ethereum/params" gparams "github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/internal/ethapi"
@ -510,7 +511,6 @@ func (b *Backend) GetAccountTrie(stateRoot core.Hash, account core.Address) (cor
return NewWrappedTrie(acTr), nil return NewWrappedTrie(acTr), nil
} }
func (b *Backend) GetContractCode(h core.Hash) ([]byte, error) {
return state.NewDatabase(b.b.ChainDb()).ContractCode(common.Hash{}, common.Hash(h))
}