Commit dc034be4 authored by Corey Rice's avatar Corey Rice Committed by Kelvin Fichter

style: Turn on eslint no unused vars

parent a98a1884
...@@ -81,6 +81,7 @@ module.exports = { ...@@ -81,6 +81,7 @@ module.exports = {
], ],
'@typescript-eslint/type-annotation-spacing': 'off', '@typescript-eslint/type-annotation-spacing': 'off',
'@typescript-eslint/unified-signatures': 'error', '@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/no-unused-vars': 'error',
}, },
}, },
], ],
......
...@@ -3,14 +3,9 @@ import chaiAsPromised from 'chai-as-promised' ...@@ -3,14 +3,9 @@ import chaiAsPromised from 'chai-as-promised'
chai.use(chaiAsPromised) chai.use(chaiAsPromised)
/* Imports: External */ /* Imports: External */
import { ethers, BigNumber, Contract, utils } from 'ethers' import { BigNumber, utils } from 'ethers'
import { sleep } from '@eth-optimism/core-utils'
import { serialize } from '@ethersproject/transactions' import { serialize } from '@ethersproject/transactions'
import { import { predeploys, getContractFactory } from '@eth-optimism/contracts'
predeploys,
getContractInterface,
getContractFactory,
} from '@eth-optimism/contracts'
/* Imports: Internal */ /* Imports: Internal */
import { isLiveNetwork } from './shared/utils' import { isLiveNetwork } from './shared/utils'
...@@ -166,8 +161,6 @@ describe('Fee Payment Integration Tests', async () => { ...@@ -166,8 +161,6 @@ describe('Fee Payment Integration Tests', async () => {
const balanceBefore = await env.l1Wallet.provider.getBalance(l1FeeWallet) const balanceBefore = await env.l1Wallet.provider.getBalance(l1FeeWallet)
const withdrawalAmount = await env.sequencerFeeVault.MIN_WITHDRAWAL_AMOUNT() const withdrawalAmount = await env.sequencerFeeVault.MIN_WITHDRAWAL_AMOUNT()
const l2WalletBalance = await env.l2Wallet.getBalance()
// Transfer the minimum required to withdraw. // Transfer the minimum required to withdraw.
const tx = await env.l2Wallet.sendTransaction({ const tx = await env.l2Wallet.sendTransaction({
to: env.sequencerFeeVault.address, to: env.sequencerFeeVault.address,
......
import { import { BigNumber, Contract, ContractFactory, Wallet } from 'ethers'
BigNumber,
BigNumberish,
Contract,
ContractFactory,
Wallet,
} from 'ethers'
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import chai, { expect } from 'chai' import chai, { expect } from 'chai'
import { import {
......
...@@ -9,8 +9,8 @@ import { expectApprox } from '@eth-optimism/core-utils' ...@@ -9,8 +9,8 @@ import { expectApprox } from '@eth-optimism/core-utils'
/* Imports: Internal */ /* Imports: Internal */
import { Direction } from './shared/watcher-utils' import { Direction } from './shared/watcher-utils'
import { fundUser, PROXY_SEQUENCER_ENTRYPOINT_ADDRESS } from './shared/utils' import { PROXY_SEQUENCER_ENTRYPOINT_ADDRESS } from './shared/utils'
import { OptimismEnv, useDynamicTimeoutForWithdrawals } from './shared/env' import { OptimismEnv } from './shared/env'
const DEFAULT_TEST_GAS_L1 = 330_000 const DEFAULT_TEST_GAS_L1 = 330_000
const DEFAULT_TEST_GAS_L2 = 1_300_000 const DEFAULT_TEST_GAS_L2 = 1_300_000
......
/* Imports: External */ /* Imports: External */
import { Contract, ContractFactory, Wallet } from 'ethers' import { ContractFactory } from 'ethers'
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import chai, { expect } from 'chai' import chai, { expect } from 'chai'
import { solidity } from 'ethereum-waffle' import { solidity } from 'ethereum-waffle'
......
/* Imports: External */ /* Imports: External */
import { DeployFunction } from 'hardhat-deploy/dist/types' import { DeployFunction } from 'hardhat-deploy/dist/types'
import { hexStringEquals } from '@eth-optimism/core-utils'
/* Imports: Internal */ /* Imports: Internal */
import { import {
......
/* Imports: External */ /* Imports: External */
import { hexStringEquals, awaitCondition } from '@eth-optimism/core-utils' import { hexStringEquals, awaitCondition } from '@eth-optimism/core-utils'
import { ethers } from 'hardhat'
import { DeployFunction } from 'hardhat-deploy/dist/types' import { DeployFunction } from 'hardhat-deploy/dist/types'
/* Imports: Internal */ /* Imports: Internal */
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
import { ethers, Contract } from 'ethers' import { ethers, Contract } from 'ethers'
import { Provider } from '@ethersproject/abstract-provider' import { Provider } from '@ethersproject/abstract-provider'
import { Signer } from '@ethersproject/abstract-signer' import { Signer } from '@ethersproject/abstract-signer'
import { import { sleep, awaitCondition } from '@eth-optimism/core-utils'
sleep,
hexStringEquals,
awaitCondition,
} from '@eth-optimism/core-utils'
import { HttpNetworkConfig } from 'hardhat/types' import { HttpNetworkConfig } from 'hardhat/types'
export const deployAndPostDeploy = async ({ export const deployAndPostDeploy = async ({
......
...@@ -21,7 +21,7 @@ task('set-l2-gasprice') ...@@ -21,7 +21,7 @@ task('set-l2-gasprice')
process.env.CONTRACTS_DEPLOYER_KEY, process.env.CONTRACTS_DEPLOYER_KEY,
types.string types.string
) )
.setAction(async (args, hre: any, runSuper) => { .setAction(async (args) => {
const provider = new ethers.providers.JsonRpcProvider(args.contractsRpcUrl) const provider = new ethers.providers.JsonRpcProvider(args.contractsRpcUrl)
const signer = new ethers.Wallet(args.contractsDeployerKey).connect( const signer = new ethers.Wallet(args.contractsDeployerKey).connect(
provider provider
......
...@@ -40,7 +40,7 @@ task('set-owner') ...@@ -40,7 +40,7 @@ task('set-owner')
predeploys.OVM_GasPriceOracle, predeploys.OVM_GasPriceOracle,
types.string types.string
) )
.setAction(async (args, hre: any, runSuper) => { .setAction(async (args) => {
const provider = new ethers.providers.JsonRpcProvider(args.contractsRpcUrl) const provider = new ethers.providers.JsonRpcProvider(args.contractsRpcUrl)
let signer: ethers.Signer let signer: ethers.Signer
if (!args.useLedger) { if (!args.useLedger) {
......
...@@ -42,7 +42,7 @@ task('whitelist') ...@@ -42,7 +42,7 @@ task('whitelist')
predeploys.OVM_DeployerWhitelist, predeploys.OVM_DeployerWhitelist,
types.string types.string
) )
.setAction(async (args, hre: any) => { .setAction(async (args) => {
const provider = new ethers.providers.JsonRpcProvider(args.contractsRpcUrl) const provider = new ethers.providers.JsonRpcProvider(args.contractsRpcUrl)
let signer: ethers.Signer let signer: ethers.Signer
if (!args.useLedger) { if (!args.useLedger) {
......
...@@ -35,7 +35,7 @@ task('withdraw-fees') ...@@ -35,7 +35,7 @@ task('withdraw-fees')
process.env.CONTRACTS_DEPLOYER_KEY, process.env.CONTRACTS_DEPLOYER_KEY,
types.string types.string
) )
.setAction(async (args, hre: any) => { .setAction(async (args) => {
const provider = new ethers.providers.JsonRpcProvider(args.contractsRpcUrl) const provider = new ethers.providers.JsonRpcProvider(args.contractsRpcUrl)
let signer: ethers.Signer let signer: ethers.Signer
if (!args.useLedger) { if (!args.useLedger) {
......
...@@ -27,7 +27,6 @@ import { ...@@ -27,7 +27,6 @@ import {
setEthTime, setEthTime,
} from '../../../helpers' } from '../../../helpers'
import { predeploys } from '../../../../src' import { predeploys } from '../../../../src'
import { keccak256 } from 'ethers/lib/utils'
const MAX_GAS_LIMIT = 8_000_000 const MAX_GAS_LIMIT = 8_000_000
...@@ -113,7 +112,7 @@ describe('L1CrossDomainMessenger', () => { ...@@ -113,7 +112,7 @@ describe('L1CrossDomainMessenger', () => {
AddressManager.address, AddressManager.address,
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
const queue = await Factory__ChainStorageContainer.deploy( await Factory__ChainStorageContainer.deploy(
AddressManager.address, AddressManager.address,
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
......
...@@ -31,13 +31,12 @@ describe('L1StandardBridge', () => { ...@@ -31,13 +31,12 @@ describe('L1StandardBridge', () => {
let aliceAddress let aliceAddress
// we can just make up this string since it's on the "other" Layer // we can just make up this string since it's on the "other" Layer
let Mock__OVM_ETH: MockContract
let Factory__L1ERC20: ContractFactory let Factory__L1ERC20: ContractFactory
let IL2ERC20Bridge: Interface let IL2ERC20Bridge: Interface
before(async () => { before(async () => {
;[l1MessengerImpersonator, alice, bob] = await ethers.getSigners() ;[l1MessengerImpersonator, alice, bob] = await ethers.getSigners()
Mock__OVM_ETH = await smockit(await ethers.getContractFactory('OVM_ETH')) await smockit(await ethers.getContractFactory('OVM_ETH'))
// deploy an ERC20 contract on L1 // deploy an ERC20 contract on L1
Factory__L1ERC20 = await smoddit( Factory__L1ERC20 = await smoddit(
......
/* External Imports */ /* External Imports */
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import { Signer, ContractFactory, Contract, constants } from 'ethers' import { Signer, ContractFactory, Contract } from 'ethers'
import { smoddit } from '@eth-optimism/smock' import { smoddit } from '@eth-optimism/smock'
import { expectApprox } from '@eth-optimism/core-utils' import { expectApprox } from '@eth-optimism/core-utils'
...@@ -56,7 +56,7 @@ describe('[GAS BENCHMARK] Depositing via the standard bridge [ @skip-on-coverage ...@@ -56,7 +56,7 @@ describe('[GAS BENCHMARK] Depositing via the standard bridge [ @skip-on-coverage
AddressManager.address, AddressManager.address,
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
const queue = await Factory__ChainStorageContainer.deploy( await Factory__ChainStorageContainer.deploy(
AddressManager.address, AddressManager.address,
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
......
/* External Imports */ /* External Imports */
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import { Signer, ContractFactory, Contract, constants } from 'ethers' import { Signer, ContractFactory, Contract } from 'ethers'
import { smockit, MockContract } from '@eth-optimism/smock' import { smockit, MockContract } from '@eth-optimism/smock'
import { import {
AppendSequencerBatchParams, AppendSequencerBatchParams,
...@@ -10,13 +10,11 @@ import { ...@@ -10,13 +10,11 @@ import {
} from '@eth-optimism/core-utils' } from '@eth-optimism/core-utils'
import { TransactionResponse } from '@ethersproject/abstract-provider' import { TransactionResponse } from '@ethersproject/abstract-provider'
import { keccak256 } from 'ethers/lib/utils' import { keccak256 } from 'ethers/lib/utils'
import _ from 'lodash'
/* Internal Imports */ /* Internal Imports */
import { import {
makeAddressManager, makeAddressManager,
setProxyTarget, setProxyTarget,
FORCE_INCLUSION_PERIOD_SECONDS,
L2_GAS_DISCOUNT_DIVISOR, L2_GAS_DISCOUNT_DIVISOR,
ENQUEUE_GAS_COST, ENQUEUE_GAS_COST,
getEthTime, getEthTime,
...@@ -92,7 +90,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain [ @skip-on-coverage ]', () = ...@@ -92,7 +90,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain [ @skip-on-coverage ]', () =
AddressManager.address, AddressManager.address,
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
const queue = await Factory__ChainStorageContainer.deploy( await Factory__ChainStorageContainer.deploy(
AddressManager.address, AddressManager.address,
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
......
...@@ -2,12 +2,11 @@ import { expect } from '../../../setup' ...@@ -2,12 +2,11 @@ import { expect } from '../../../setup'
/* External Imports */ /* External Imports */
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import { Signer, ContractFactory, Contract, BigNumber, constants } from 'ethers' import { Signer, ContractFactory, Contract } from 'ethers'
import { smockit, MockContract } from '@eth-optimism/smock' import { smockit, MockContract } from '@eth-optimism/smock'
import { import {
AppendSequencerBatchParams, AppendSequencerBatchParams,
encodeAppendSequencerBatch, encodeAppendSequencerBatch,
remove0x,
} from '@eth-optimism/core-utils' } from '@eth-optimism/core-utils'
import { TransactionResponse } from '@ethersproject/abstract-provider' import { TransactionResponse } from '@ethersproject/abstract-provider'
import { keccak256 } from 'ethers/lib/utils' import { keccak256 } from 'ethers/lib/utils'
...@@ -24,7 +23,6 @@ import { ...@@ -24,7 +23,6 @@ import {
getEthTime, getEthTime,
getNextBlockNumber, getNextBlockNumber,
} from '../../../helpers' } from '../../../helpers'
import { predeploys } from '../../../../src'
const ELEMENT_TEST_SIZES = [1, 2, 4, 8, 16] const ELEMENT_TEST_SIZES = [1, 2, 4, 8, 16]
const MAX_GAS_LIMIT = 8_000_000 const MAX_GAS_LIMIT = 8_000_000
...@@ -115,7 +113,7 @@ describe('CanonicalTransactionChain', () => { ...@@ -115,7 +113,7 @@ describe('CanonicalTransactionChain', () => {
AddressManager.address, AddressManager.address,
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
const queue = await Factory__ChainStorageContainer.deploy( await Factory__ChainStorageContainer.deploy(
AddressManager.address, AddressManager.address,
'CanonicalTransactionChain' 'CanonicalTransactionChain'
) )
...@@ -146,8 +144,7 @@ describe('CanonicalTransactionChain', () => { ...@@ -146,8 +144,7 @@ describe('CanonicalTransactionChain', () => {
addressManagerOwner addressManagerOwner
).setGasParams(newGasDivisor, newEnqueueGasCost) ).setGasParams(newGasDivisor, newEnqueueGasCost)
const l2GasDiscountDivisor = await CanonicalTransactionChain.l2GasDiscountDivisor()
await CanonicalTransactionChain.l2GasDiscountDivisor()
const enqueueL2GasPrepaid = const enqueueL2GasPrepaid =
await CanonicalTransactionChain.enqueueL2GasPrepaid() await CanonicalTransactionChain.enqueueL2GasPrepaid()
expect(enqueueL2GasPrepaid).to.equal(newGasDivisor * newEnqueueGasCost) expect(enqueueL2GasPrepaid).to.equal(newGasDivisor * newEnqueueGasCost)
......
...@@ -3,7 +3,6 @@ import { expect } from '../../../setup' ...@@ -3,7 +3,6 @@ import { expect } from '../../../setup'
/* External Imports */ /* External Imports */
import { ethers } from 'hardhat' import { ethers } from 'hardhat'
import { Signer, ContractFactory, Contract } from 'ethers' import { Signer, ContractFactory, Contract } from 'ethers'
import { Interface } from 'ethers/lib/utils'
import { import {
smockit, smockit,
MockContract, MockContract,
...@@ -31,7 +30,6 @@ describe('L2StandardBridge', () => { ...@@ -31,7 +30,6 @@ describe('L2StandardBridge', () => {
let bobsAddress: string let bobsAddress: string
let l2MessengerImpersonator: Signer let l2MessengerImpersonator: Signer
let Factory__L1StandardBridge: ContractFactory let Factory__L1StandardBridge: ContractFactory
let IL2ERC20Bridge: Interface
const INITIAL_TOTAL_SUPPLY = 100_000 const INITIAL_TOTAL_SUPPLY = 100_000
const ALICE_INITIAL_BALANCE = 50_000 const ALICE_INITIAL_BALANCE = 50_000
before(async () => { before(async () => {
...@@ -44,7 +42,7 @@ describe('L2StandardBridge', () => { ...@@ -44,7 +42,7 @@ describe('L2StandardBridge', () => {
) )
// get an L2ER20Bridge Interface // get an L2ER20Bridge Interface
IL2ERC20Bridge = getContractInterface('IL2ERC20Bridge') getContractInterface('IL2ERC20Bridge')
}) })
let L2StandardBridge: Contract let L2StandardBridge: Contract
......
...@@ -276,7 +276,6 @@ describe('OVM_GasPriceOracle', () => { ...@@ -276,7 +276,6 @@ describe('OVM_GasPriceOracle', () => {
describe('decimals', () => { describe('decimals', () => {
it('is the 5th storage slot', async () => { it('is the 5th storage slot', async () => {
const decimals = 6
const slot = 5 const slot = 5
// get the storage slot value // get the storage slot value
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @param ms Number of milliseconds to sleep. * @param ms Number of milliseconds to sleep.
*/ */
export const sleep = async (ms: number): Promise<void> => { export const sleep = async (ms: number): Promise<void> => {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve) => {
setTimeout(() => { setTimeout(() => {
resolve(null) resolve(null)
}, ms) }, ms)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import { ethers } from 'ethers' import { ethers } from 'ethers'
import { Provider, TransactionReceipt } from '@ethersproject/abstract-provider' import { Provider, TransactionReceipt } from '@ethersproject/abstract-provider'
const SENT_MESSAGE = ethers.utils.id('SentMessage(bytes)')
const RELAYED_MESSAGE = ethers.utils.id(`RelayedMessage(bytes32)`) const RELAYED_MESSAGE = ethers.utils.id(`RelayedMessage(bytes32)`)
const FAILED_RELAYED_MESSAGE = ethers.utils.id(`FailedRelayedMessage(bytes32)`) const FAILED_RELAYED_MESSAGE = ethers.utils.id(`FailedRelayedMessage(bytes32)`)
......
import { expect } from './setup'
import * as fees from '../src/fees' import * as fees from '../src/fees'
import { BigNumber, utils } from 'ethers'
const hundredBillion = 10 ** 11
const tenThousand = 10 ** 4
describe('Fees', () => { describe('Fees', () => {
it('should count zeros and ones', () => { it('should count zeros and ones', () => {
......
...@@ -173,15 +173,6 @@ export const solcInput = (contract: EtherscanContract) => { ...@@ -173,15 +173,6 @@ export const solcInput = (contract: EtherscanContract) => {
return input return input
} }
const compilerCache: {
[target: string]: {
[hash: string]: any
}
} = {
['OVM']: {},
['EVM']: {},
}
const readCompilerCache = ( const readCompilerCache = (
target: 'evm' | 'ovm', target: 'evm' | 'ovm',
hash: string hash: string
......
/* eslint-disable @typescript-eslint/no-empty-function */ /* eslint-disable @typescript-eslint/no-empty-function */
import { expect, env, NUM_ACCOUNTS_DIVISOR } from '../setup' import { expect, env, NUM_ACCOUNTS_DIVISOR } from '../setup'
import { AccountType, Account } from '../../scripts/types' import { AccountType } from '../../scripts/types'
describe('verified', () => { describe('verified', () => {
before(async () => { before(async () => {
......
...@@ -75,10 +75,7 @@ export class GenesisJsonProvider implements AbstractProvider { ...@@ -75,10 +75,7 @@ export class GenesisJsonProvider implements AbstractProvider {
} }
} }
async getBalance( async getBalance(addressOrName: string): Promise<BigNumber> {
addressOrName: string,
blockTag?: BlockTag
): Promise<BigNumber> {
const address = remove0x(addressOrName) const address = remove0x(addressOrName)
const account = this.state[address] const account = this.state[address]
if (!account) { if (!account) {
...@@ -87,10 +84,7 @@ export class GenesisJsonProvider implements AbstractProvider { ...@@ -87,10 +84,7 @@ export class GenesisJsonProvider implements AbstractProvider {
return BigNumber.from(account.balance) return BigNumber.from(account.balance)
} }
async getTransactionCount( async getTransactionCount(addressOrName: string): Promise<number> {
addressOrName: string,
blockTag?: BlockTag
): Promise<number> {
const address = remove0x(addressOrName) const address = remove0x(addressOrName)
const account = this.state[address] const account = this.state[address]
if (!account) { if (!account) {
...@@ -99,7 +93,7 @@ export class GenesisJsonProvider implements AbstractProvider { ...@@ -99,7 +93,7 @@ export class GenesisJsonProvider implements AbstractProvider {
return account.nonce return account.nonce
} }
async getCode(addressOrName: string, blockTag?: BlockTag): Promise<string> { async getCode(addressOrName: string): Promise<string> {
const address = remove0x(addressOrName) const address = remove0x(addressOrName)
const account = this.state[address] const account = this.state[address]
if (!account) { if (!account) {
...@@ -110,8 +104,7 @@ export class GenesisJsonProvider implements AbstractProvider { ...@@ -110,8 +104,7 @@ export class GenesisJsonProvider implements AbstractProvider {
async getStorageAt( async getStorageAt(
addressOrName: string, addressOrName: string,
position: BigNumber | number, position: BigNumber | number
blockTag?: BlockTag
): Promise<string> { ): Promise<string> {
const address = remove0x(addressOrName) const address = remove0x(addressOrName)
const account = this.state[address] const account = this.state[address]
...@@ -130,7 +123,9 @@ export class GenesisJsonProvider implements AbstractProvider { ...@@ -130,7 +123,9 @@ export class GenesisJsonProvider implements AbstractProvider {
transaction: Deferrable<TransactionRequest>, transaction: Deferrable<TransactionRequest>,
blockTag?: BlockTag | Promise<BlockTag> blockTag?: BlockTag | Promise<BlockTag>
): Promise<string> { ): Promise<string> {
throw new Error('Unsupported Method: call') throw new Error(
`Unsupported Method: call with args: transaction - ${transaction}, blockTag - ${blockTag}`
)
} }
async send(method: string, args: Array<any>): Promise<any> { async send(method: string, args: Array<any>): Promise<any> {
...@@ -177,73 +172,101 @@ export class GenesisJsonProvider implements AbstractProvider { ...@@ -177,73 +172,101 @@ export class GenesisJsonProvider implements AbstractProvider {
async sendTransaction( async sendTransaction(
signedTransaction: string | Promise<string> signedTransaction: string | Promise<string>
): Promise<TransactionResponse> { ): Promise<TransactionResponse> {
throw new Error('Unsupported Method: sendTransaction') throw new Error(
`Unsupported Method: sendTransaction with args: transaction - ${signedTransaction}`
)
} }
async estimateGas( async estimateGas(): Promise<BigNumber> {
transaction: Deferrable<TransactionRequest>
): Promise<BigNumber> {
return BigNumber.from(0) return BigNumber.from(0)
} }
async getBlock( async getBlock(
blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string> blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>
): Promise<Block> { ): Promise<Block> {
throw new Error('Unsupported Method: getBlock') throw new Error(
`Unsupported Method: getBlock with args blockHashOrBlockTag - ${blockHashOrBlockTag}`
)
} }
async getBlockWithTransactions( async getBlockWithTransactions(
blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string> blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>
): Promise<BlockWithTransactions> { ): Promise<BlockWithTransactions> {
throw new Error('Unsupported Method: getBlockWithTransactions') throw new Error(
`Unsupported Method: getBlockWithTransactions with args blockHashOrBlockTag - ${blockHashOrBlockTag}`
)
} }
async getTransaction(transactionHash: string): Promise<TransactionResponse> { async getTransaction(transactionHash: string): Promise<TransactionResponse> {
throw new Error('Unsupported Method: getTransaction') throw new Error(
`Unsupported Method: getTransaction with args transactionHash - ${transactionHash}`
)
} }
async getTransactionReceipt( async getTransactionReceipt(
transactionHash: string transactionHash: string
): Promise<TransactionReceipt> { ): Promise<TransactionReceipt> {
throw new Error('Unsupported Method: getTransactionReceipt') throw new Error(
`Unsupported Method: getTransactionReceipt with args transactionHash - ${transactionHash}`
)
} }
async getLogs(filter: Filter): Promise<Array<Log>> { async getLogs(filter: Filter): Promise<Array<Log>> {
throw new Error('Unsupported Method: getLogs') throw new Error(`Unsupported Method: getLogs with args filter - ${filter}`)
} }
async resolveName(name: string | Promise<string>): Promise<null | string> { async resolveName(name: string | Promise<string>): Promise<null | string> {
throw new Error('Unsupported Method: resolveName') throw new Error(`Unsupported Method: resolveName with args name - ${name}`)
} }
async lookupAddress( async lookupAddress(
address: string | Promise<string> address: string | Promise<string>
): Promise<null | string> { ): Promise<null | string> {
throw new Error('Unsupported Method: lookupAddress') throw new Error(
`Unsupported Method: lookupAddress with args address - ${address}`
)
} }
on(eventName: EventType, listener: Listener): Provider { on(eventName: EventType, listener: Listener): Provider {
throw new Error('Unsupported Method: on') throw new Error(
`Unsupported Method: on with args eventName - ${eventName}, listener - ${listener}`
)
} }
once(eventName: EventType, listener: Listener): Provider { once(eventName: EventType, listener: Listener): Provider {
throw new Error('Unsupported Method: once') throw new Error(
`Unsupported Method: once with args eventName - ${eventName}, listener - ${listener}`
)
} }
emit(eventName: EventType, ...args: Array<any>): boolean { emit(eventName: EventType, ...args: Array<any>): boolean {
throw new Error('Unsupported Method: emit') throw new Error(
`Unsupported Method: emit with args eventName - ${eventName}, args - ${args}`
)
} }
listenerCount(eventName?: EventType): number { listenerCount(eventName?: EventType): number {
throw new Error('Unsupported Method: listenerCount') throw new Error(
`Unsupported Method: listenerCount with args eventName - ${eventName}`
)
} }
listeners(eventName?: EventType): Array<Listener> { listeners(eventName?: EventType): Array<Listener> {
throw new Error('Unsupported Method: listeners') throw new Error(
`Unsupported Method: listeners with args eventName - ${eventName}`
)
} }
off(eventName: EventType, listener?: Listener): Provider { off(eventName: EventType, listener?: Listener): Provider {
throw new Error('Unsupported Method: off') throw new Error(
`Unsupported Method: off with args eventName - ${eventName}, listener - ${listener}`
)
} }
removeAllListeners(eventName?: EventType): Provider { removeAllListeners(eventName?: EventType): Provider {
throw new Error('Unsupported Method: removeAllListeners') throw new Error(
`Unsupported Method: removeAllListeners with args eventName - ${eventName}`
)
} }
addListener(eventName: EventType, listener: Listener): Provider { addListener(eventName: EventType, listener: Listener): Provider {
throw new Error('Unsupported Method: addListener') throw new Error(
`Unsupported Method: addListener with args eventName - ${eventName}, listener - ${listener}`
)
} }
removeListener(eventName: EventType, listener: Listener): Provider { removeListener(eventName: EventType, listener: Listener): Provider {
throw new Error('Unsupported Method: removeListener') throw new Error(
`Unsupported Method: removeListener with args eventName - ${eventName}, listener - ${listener}`
)
} }
async waitForTransaction( async waitForTransaction(
...@@ -251,7 +274,9 @@ export class GenesisJsonProvider implements AbstractProvider { ...@@ -251,7 +274,9 @@ export class GenesisJsonProvider implements AbstractProvider {
confirmations?: number, confirmations?: number,
timeout?: number timeout?: number
): Promise<TransactionReceipt> { ): Promise<TransactionReceipt> {
throw new Error('Unsupported Method: waitForTransaction') throw new Error(
`Unsupported Method: waitForTransaction with args transactionHash - ${transactionHash}, confirmations - ${confirmations}, timeout - ${timeout}`
)
} }
readonly _isProvider: boolean readonly _isProvider: boolean
......
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