rm unused geth_fork api method

This commit is contained in:
Sina Mahmoodi 2024-09-17 19:36:33 +02:00 committed by Martin Holst Swende
parent 7708267e05
commit 71544dfba8
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
2 changed files with 0 additions and 33 deletions

View file

@ -1958,25 +1958,6 @@ func (api *NetAPI) Version() string {
return fmt.Sprintf("%d", api.networkVersion) return fmt.Sprintf("%d", api.networkVersion)
} }
// GethAPI offers geth-specific API methods.
type GethAPI struct {
b Backend
}
// NewGethAPI creates a new net API instance.
func NewGethAPI(b Backend) *GethAPI {
return &GethAPI{b: b}
}
// Fork returns the latest enabled fork as of the given block.
func (api *GethAPI) Fork(ctx context.Context, num rpc.BlockNumber) (string, error) {
b, err := api.b.BlockByNumber(ctx, num)
if err != nil {
return "", fmt.Errorf("block #%d not found", num)
}
return api.b.ChainConfig().LatestFork(b.Number(), b.Time()).String(), nil
}
// checkTxFee is an internal function used to check whether the fee of // checkTxFee is an internal function used to check whether the fee of
// the given transaction is _reasonable_(under the cap). // the given transaction is _reasonable_(under the cap).
func checkTxFee(gasPrice *big.Int, gas uint64, cap float64) error { func checkTxFee(gasPrice *big.Int, gas uint64, cap float64) error {

View file

@ -720,17 +720,3 @@ web3._extend({
], ],
}); });
` `
const GethJs = `
web3._extend({
property: 'geth',
methods:
[
new web3._extend.Method({
name: 'fork',
call: 'geth_fork',
params: 1
}),
],
});
`