Skip to content

Instantly share code, notes, and snippets.

@HenryQW
Created November 4, 2024 09:42
Show Gist options
  • Save HenryQW/cd2bee1111719a6c767473d75e91ac5d to your computer and use it in GitHub Desktop.
Save HenryQW/cd2bee1111719a6c767473d75e91ac5d to your computer and use it in GitHub Desktop.
package example_test
import (
"context"
"math/big"
"testing"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/rpc"
"github.com/stretchr/testify/require"
)
func TestRPC(t *testing.T) {
rpcClient, err := rpc.DialOptions(context.Background(), "https://mevm.devnet.imola.movementlabs.xyz", rpc.WithHeader("User-Agent", "curl/8.6.0"))
require.NoError(t, err)
ethereumClient := ethclient.NewClient(rpcClient)
t.Log(ethereumClient.BlockByNumber(context.Background(), big.NewInt(0)))
}
@HenryQW
Copy link
Author

HenryQW commented Nov 4, 2024

=== RUN   TestRPC
    example_test.go:19: <nil> server returned empty uncle list but block header indicates uncles
--- PASS: TestRPC (0.49s)
PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment