use eth.OpenRPC
This commit is contained in:
parent
f0dd0e80b0
commit
d814abae0e
@ -4,8 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/golang/glog"
|
||||
"github.com/juju/errors"
|
||||
"github.com/trezor/blockbook/bchain"
|
||||
@ -38,15 +36,7 @@ func NewOptimismRPC(config json.RawMessage, pushHandler func(bchain.Notification
|
||||
|
||||
// Initialize bnb smart chain rpc interface
|
||||
func (b *OptimismRPC) Initialize() error {
|
||||
b.OpenRPC = func(url string) (bchain.EVMRPCClient, bchain.EVMClient, error) {
|
||||
r, err := rpc.Dial(url)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
rc := &OptimismRPCClient{Client: r}
|
||||
ec := ð.EthereumClient{Client: ethclient.NewClient(r)}
|
||||
return rc, ec, nil
|
||||
}
|
||||
b.OpenRPC = eth.OpenRPC
|
||||
|
||||
rc, ec, err := b.OpenRPC(b.ChainConfig.RPCURL)
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user