Skip to content

Commit

Permalink
op-service/client: rm unnecessary type arguments (#12651)
Browse files Browse the repository at this point in the history
Signed-off-by: jsvisa <delweng@gmail.com>
  • Loading branch information
jsvisa authored Oct 26, 2024
1 parent 44f814c commit f5591ca
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions op-service/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,43 +79,43 @@ func (ic *InstrumentedClient) RPC() RPC {
}

func (ic *InstrumentedClient) ChainID(ctx context.Context) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_chainId", func() (*big.Int, error) {
return instrument2(ic.m, "eth_chainId", func() (*big.Int, error) {
return ic.c.ChainID(ctx)
})
}

func (ic *InstrumentedClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
return instrument2[*types.Block](ic.m, "eth_getBlockByHash", func() (*types.Block, error) {
return instrument2(ic.m, "eth_getBlockByHash", func() (*types.Block, error) {
return ic.c.BlockByHash(ctx, hash)
})
}

func (ic *InstrumentedClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) {
return instrument2[*types.Block](ic.m, "eth_getBlockByNumber", func() (*types.Block, error) {
return instrument2(ic.m, "eth_getBlockByNumber", func() (*types.Block, error) {
return ic.c.BlockByNumber(ctx, number)
})
}

func (ic *InstrumentedClient) BlockNumber(ctx context.Context) (uint64, error) {
return instrument2[uint64](ic.m, "eth_blockNumber", func() (uint64, error) {
return instrument2(ic.m, "eth_blockNumber", func() (uint64, error) {
return ic.c.BlockNumber(ctx)
})
}

func (ic *InstrumentedClient) PeerCount(ctx context.Context) (uint64, error) {
return instrument2[uint64](ic.m, "net_peerCount", func() (uint64, error) {
return instrument2(ic.m, "net_peerCount", func() (uint64, error) {
return ic.c.PeerCount(ctx)
})
}

func (ic *InstrumentedClient) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
return instrument2[*types.Header](ic.m, "eth_getHeaderByHash", func() (*types.Header, error) {
return instrument2(ic.m, "eth_getHeaderByHash", func() (*types.Header, error) {
return ic.c.HeaderByHash(ctx, hash)
})
}

func (ic *InstrumentedClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) {
return instrument2[*types.Header](ic.m, "eth_getHeaderByNumber", func() (*types.Header, error) {
return instrument2(ic.m, "eth_getHeaderByNumber", func() (*types.Header, error) {
return ic.c.HeaderByNumber(ctx, number)
})
}
Expand All @@ -132,25 +132,25 @@ func (ic *InstrumentedClient) TransactionSender(ctx context.Context, tx *types.T
}

func (ic *InstrumentedClient) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error) {
return instrument2[uint](ic.m, "eth_getTransactionCount", func() (uint, error) {
return instrument2(ic.m, "eth_getTransactionCount", func() (uint, error) {
return ic.c.TransactionCount(ctx, blockHash)
})
}

func (ic *InstrumentedClient) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) {
return instrument2[*types.Transaction](ic.m, "eth_getTransactionByBlockHashAndIndex", func() (*types.Transaction, error) {
return instrument2(ic.m, "eth_getTransactionByBlockHashAndIndex", func() (*types.Transaction, error) {
return ic.c.TransactionInBlock(ctx, blockHash, index)
})
}

func (ic *InstrumentedClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
return instrument2[*types.Receipt](ic.m, "eth_getTransactionReceipt", func() (*types.Receipt, error) {
return instrument2(ic.m, "eth_getTransactionReceipt", func() (*types.Receipt, error) {
return ic.c.TransactionReceipt(ctx, txHash)
})
}

func (ic *InstrumentedClient) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) {
return instrument2[*ethereum.SyncProgress](ic.m, "eth_syncing", func() (*ethereum.SyncProgress, error) {
return instrument2(ic.m, "eth_syncing", func() (*ethereum.SyncProgress, error) {
return ic.c.SyncProgress(ctx)
})
}
Expand All @@ -160,37 +160,37 @@ func (ic *InstrumentedClient) SubscribeNewHead(ctx context.Context, ch chan<- *t
}

func (ic *InstrumentedClient) NetworkID(ctx context.Context) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "net_version", func() (*big.Int, error) {
return instrument2(ic.m, "net_version", func() (*big.Int, error) {
return ic.c.NetworkID(ctx)
})
}

func (ic *InstrumentedClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_getBalance", func() (*big.Int, error) {
return instrument2(ic.m, "eth_getBalance", func() (*big.Int, error) {
return ic.c.BalanceAt(ctx, account, blockNumber)
})
}

func (ic *InstrumentedClient) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_getStorageAt", func() ([]byte, error) {
return instrument2(ic.m, "eth_getStorageAt", func() ([]byte, error) {
return ic.c.StorageAt(ctx, account, key, blockNumber)
})
}

func (ic *InstrumentedClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_getCode", func() ([]byte, error) {
return instrument2(ic.m, "eth_getCode", func() ([]byte, error) {
return ic.c.CodeAt(ctx, account, blockNumber)
})
}

func (ic *InstrumentedClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) {
return instrument2[uint64](ic.m, "eth_getTransactionCount", func() (uint64, error) {
return instrument2(ic.m, "eth_getTransactionCount", func() (uint64, error) {
return ic.c.NonceAt(ctx, account, blockNumber)
})
}

func (ic *InstrumentedClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) {
return instrument2[[]types.Log](ic.m, "eth_getLogs", func() ([]types.Log, error) {
return instrument2(ic.m, "eth_getLogs", func() ([]types.Log, error) {
return ic.c.FilterLogs(ctx, q)
})
}
Expand All @@ -200,67 +200,67 @@ func (ic *InstrumentedClient) SubscribeFilterLogs(ctx context.Context, q ethereu
}

func (ic *InstrumentedClient) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_getBalance", func() (*big.Int, error) {
return instrument2(ic.m, "eth_getBalance", func() (*big.Int, error) {
return ic.c.PendingBalanceAt(ctx, account)
})
}

func (ic *InstrumentedClient) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_getStorageAt", func() ([]byte, error) {
return instrument2(ic.m, "eth_getStorageAt", func() ([]byte, error) {
return ic.c.PendingStorageAt(ctx, account, key)
})
}

func (ic *InstrumentedClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_getCode", func() ([]byte, error) {
return instrument2(ic.m, "eth_getCode", func() ([]byte, error) {
return ic.c.PendingCodeAt(ctx, account)
})
}

func (ic *InstrumentedClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) {
return instrument2[uint64](ic.m, "eth_getTransactionCount", func() (uint64, error) {
return instrument2(ic.m, "eth_getTransactionCount", func() (uint64, error) {
return ic.c.PendingNonceAt(ctx, account)
})
}

func (ic *InstrumentedClient) PendingTransactionCount(ctx context.Context) (uint, error) {
return instrument2[uint](ic.m, "eth_getBlockTransactionCountByNumber", func() (uint, error) {
return instrument2(ic.m, "eth_getBlockTransactionCountByNumber", func() (uint, error) {
return ic.c.PendingTransactionCount(ctx)
})
}

func (ic *InstrumentedClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_call", func() ([]byte, error) {
return instrument2(ic.m, "eth_call", func() ([]byte, error) {
return ic.c.CallContract(ctx, msg, blockNumber)
})
}

func (ic *InstrumentedClient) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_call", func() ([]byte, error) {
return instrument2(ic.m, "eth_call", func() ([]byte, error) {
return ic.c.CallContractAtHash(ctx, msg, blockHash)
})
}

func (ic *InstrumentedClient) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) {
return instrument2[[]byte](ic.m, "eth_call", func() ([]byte, error) {
return instrument2(ic.m, "eth_call", func() ([]byte, error) {
return ic.c.PendingCallContract(ctx, msg)
})
}

func (ic *InstrumentedClient) SuggestGasPrice(ctx context.Context) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_gasPrice", func() (*big.Int, error) {
return instrument2(ic.m, "eth_gasPrice", func() (*big.Int, error) {
return ic.c.SuggestGasPrice(ctx)
})
}

func (ic *InstrumentedClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error) {
return instrument2[*big.Int](ic.m, "eth_maxPriorityFeePerGas", func() (*big.Int, error) {
return instrument2(ic.m, "eth_maxPriorityFeePerGas", func() (*big.Int, error) {
return ic.c.SuggestGasPrice(ctx)
})
}

func (ic *InstrumentedClient) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) {
return instrument2[uint64](ic.m, "eth_estimateGas", func() (uint64, error) {
return instrument2(ic.m, "eth_estimateGas", func() (uint64, error) {
return ic.c.EstimateGas(ctx, msg)
})
}
Expand Down

0 comments on commit f5591ca

Please sign in to comment.