mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 04:21:20 +00:00
c00f85ab6c
* Simplification of eth_estimageGas * Set GasCap by default * Add a test * Fix crash Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
26 lines
630 B
Go
26 lines
630 B
Go
package commands
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
|
"github.com/ledgerwatch/turbo-geth/internal/ethapi"
|
|
)
|
|
|
|
func TestEstimateGas(t *testing.T) {
|
|
db, err := createTestDb()
|
|
if err != nil {
|
|
t.Fatalf("create test db: %v", err)
|
|
}
|
|
api := NewEthAPI(db, nil, 5000000, nil)
|
|
var from = common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
|
|
var to = common.HexToAddress("0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e")
|
|
if _, err := api.EstimateGas(context.Background(), ethapi.CallArgs{
|
|
From: &from,
|
|
To: &to,
|
|
}); err != nil {
|
|
t.Errorf("calling EstimateGas: %v", err)
|
|
}
|
|
}
|