Commit be436515 authored by cby3149's avatar cby3149

Remove L2RpcClient

parent 6242cf30
...@@ -41,7 +41,6 @@ type OpGeth struct { ...@@ -41,7 +41,6 @@ type OpGeth struct {
node EthInstance node EthInstance
l2Engine *sources.EngineClient l2Engine *sources.EngineClient
L2Client *ethclient.Client L2Client *ethclient.Client
L2RpcClient *rpc.Client
SystemConfig eth.SystemConfig SystemConfig eth.SystemConfig
L1ChainConfig *params.ChainConfig L1ChainConfig *params.ChainConfig
L2ChainConfig *params.ChainConfig L2ChainConfig *params.ChainConfig
...@@ -82,7 +81,7 @@ func NewOpGeth(t *testing.T, ctx context.Context, cfg *SystemConfig) (*OpGeth, e ...@@ -82,7 +81,7 @@ func NewOpGeth(t *testing.T, ctx context.Context, cfg *SystemConfig) (*OpGeth, e
node = gethNode node = gethNode
} else { } else {
externalNode := (&ExternalRunner{ externalNode := (&ExternalRunner{
Name: "Sequencer", Name: "l2",
BinPath: cfg.ExternalL2Shim, BinPath: cfg.ExternalL2Shim,
Genesis: l2Genesis, Genesis: l2Genesis,
JWTPath: cfg.JWTFilePath, JWTPath: cfg.JWTFilePath,
...@@ -106,16 +105,12 @@ func NewOpGeth(t *testing.T, ctx context.Context, cfg *SystemConfig) (*OpGeth, e ...@@ -106,16 +105,12 @@ func NewOpGeth(t *testing.T, ctx context.Context, cfg *SystemConfig) (*OpGeth, e
l2Client, err := ethclient.Dial(node.HTTPEndpoint()) l2Client, err := ethclient.Dial(node.HTTPEndpoint())
require.Nil(t, err) require.Nil(t, err)
l2RpcClient, err := rpc.Dial(node.HTTPEndpoint())
require.Nil(t, err)
genesisPayload, err := eth.BlockAsPayload(l2GenesisBlock) genesisPayload, err := eth.BlockAsPayload(l2GenesisBlock)
require.Nil(t, err) require.Nil(t, err)
return &OpGeth{ return &OpGeth{
node: node, node: node,
L2Client: l2Client, L2Client: l2Client,
L2RpcClient: l2RpcClient,
l2Engine: l2Engine, l2Engine: l2Engine,
SystemConfig: rollupGenesis.SystemConfig, SystemConfig: rollupGenesis.SystemConfig,
L1ChainConfig: l1Genesis.Config, L1ChainConfig: l1Genesis.Config,
...@@ -129,7 +124,6 @@ func (d *OpGeth) Close() { ...@@ -129,7 +124,6 @@ func (d *OpGeth) Close() {
_ = d.node.Close() _ = d.node.Close()
d.l2Engine.Close() d.l2Engine.Close()
d.L2Client.Close() d.L2Client.Close()
d.L2RpcClient.Close()
} }
// AddL2Block Appends a new L2 block to the current chain including the specified transactions // AddL2Block Appends a new L2 block to the current chain including the specified transactions
......
...@@ -163,7 +163,7 @@ func TestGethOnlyPendingBlockIsLatest(t *testing.T) { ...@@ -163,7 +163,7 @@ func TestGethOnlyPendingBlockIsLatest(t *testing.T) {
Pending hexutil.Uint64 `json:"pending"` Pending hexutil.Uint64 `json:"pending"`
} }
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
require.NoError(t, opGeth.L2RpcClient.CallContext(ctx, &txPoolStatus, "txpool_status")) require.NoError(t, opGeth.L2Client.Client().Call(&txPoolStatus, "txpool_status"))
if txPoolStatus.Pending == 0 { if txPoolStatus.Pending == 0 {
time.Sleep(time.Second) time.Sleep(time.Second)
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment