Commit 270873d5 authored by Wyatt Barnes's avatar Wyatt Barnes

Rename OptimismFeeEstimationPlugin to OptimismPlugin

parent 44aa740f
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
optimistAddress, optimistAddress,
} from '@eth-optimism/contracts-ts' } from '@eth-optimism/contracts-ts'
import { OptimismFeeEstimationPlugin } from './plugin' import { OptimismPlugin } from './plugin'
const defaultProvider = 'https://mainnet.optimism.io' const defaultProvider = 'https://mainnet.optimism.io'
const provider = z const provider = z
...@@ -21,17 +21,17 @@ if (provider === defaultProvider) ...@@ -21,17 +21,17 @@ if (provider === defaultProvider)
'Warning: Using default public provider, this could cause tests to fail due to rate limits. Set the VITE_L2_RPC_URL env to override default provider' 'Warning: Using default public provider, this could cause tests to fail due to rate limits. Set the VITE_L2_RPC_URL env to override default provider'
) )
describe('OptimismFeeEstimationPlugin', () => { describe('OptimismPlugin', () => {
let web3: Web3 let web3: Web3
beforeAll(() => { beforeAll(() => {
web3 = new Web3(provider) web3 = new Web3(provider)
web3.registerPlugin(new OptimismFeeEstimationPlugin()) web3.registerPlugin(new OptimismPlugin())
}) })
test('should be registered under .op namespace', () => test('should be registered under .op namespace', () =>
expect(web3.op).toMatchInlineSnapshot(` expect(web3.op).toMatchInlineSnapshot(`
OptimismFeeEstimationPlugin { OptimismPlugin {
"_accountProvider": { "_accountProvider": {
"create": [Function], "create": [Function],
"decrypt": [Function], "decrypt": [Function],
...@@ -62,7 +62,7 @@ describe('OptimismFeeEstimationPlugin', () => { ...@@ -62,7 +62,7 @@ describe('OptimismFeeEstimationPlugin', () => {
Symbol(kCapture): false, Symbol(kCapture): false,
}, },
"_provider": HttpProvider { "_provider": HttpProvider {
"clientUrl": "https://mainnet.optimism.io", "clientUrl": "https://opt-mainnet.g.alchemy.com/v2/OVlbpe9COlhG-ijOXGvL_phb5ns6p9-w",
"httpProviderOptions": undefined, "httpProviderOptions": undefined,
}, },
"useRpcCallSpecification": undefined, "useRpcCallSpecification": undefined,
...@@ -88,7 +88,7 @@ describe('OptimismFeeEstimationPlugin', () => { ...@@ -88,7 +88,7 @@ describe('OptimismFeeEstimationPlugin', () => {
Symbol(kCapture): false, Symbol(kCapture): false,
}, },
"_provider": HttpProvider { "_provider": HttpProvider {
"clientUrl": "https://mainnet.optimism.io", "clientUrl": "https://opt-mainnet.g.alchemy.com/v2/OVlbpe9COlhG-ijOXGvL_phb5ns6p9-w",
"httpProviderOptions": undefined, "httpProviderOptions": undefined,
}, },
"useRpcCallSpecification": undefined, "useRpcCallSpecification": undefined,
......
...@@ -17,7 +17,7 @@ import { ...@@ -17,7 +17,7 @@ import {
} from '@eth-optimism/contracts-ts' } from '@eth-optimism/contracts-ts'
import { RLP } from '@ethereumjs/rlp' import { RLP } from '@ethereumjs/rlp'
export class OptimismFeeEstimationPlugin extends Web3PluginBase { export class OptimismPlugin extends Web3PluginBase {
public pluginNamespace = 'op' public pluginNamespace = 'op'
private _gasPriceOracleContract: private _gasPriceOracleContract:
...@@ -323,6 +323,6 @@ export class OptimismFeeEstimationPlugin extends Web3PluginBase { ...@@ -323,6 +323,6 @@ export class OptimismFeeEstimationPlugin extends Web3PluginBase {
// Module Augmentation to add op namespace to root {web3} instance // Module Augmentation to add op namespace to root {web3} instance
declare module 'web3' { declare module 'web3' {
interface Web3Context { interface Web3Context {
op: OptimismFeeEstimationPlugin op: OptimismPlugin
} }
} }
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