Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tests and test EXTCODECOPY Failure Behavior #25

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/core-utils/src/app/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ export const hexStrToBuf = (hexString: string): Buffer => {
return Buffer.from(remove0x(hexString), 'hex')
}

/**
* Converts a hex string to a JavaScript Number
* @param hexString the hex string to be converted
* @returns the hexString as a JavaScript Number.
*/
export const hexStrToNumber = (hexString: string): number => {
return parseInt(remove0x(hexString), 16)
}

/**
* Converts the provided buffer into a hex string.
* @param buff The buffer.
Expand Down
1 change: 1 addition & 0 deletions packages/ovm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"chai": "^4.2.0",
"chai-bignumber": "^3.0.0",
"ethereumjs-abi": "^0.6.8",
"lodash": "^4.17.15",
"memdown": "^5.0.0",
"mocha": "^6.0.2",
"rimraf": "^2.6.3",
Expand Down
1 change: 0 additions & 1 deletion packages/ovm/src/app/ovm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
StorageElement,
StorageSlot,
StorageValue,
Transaction,
TransactionLog,
TransactionReceipt,
TransactionResult,
Expand Down
2 changes: 1 addition & 1 deletion packages/ovm/src/app/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* External Imports */
import { getLogger, ZERO_ADDRESS } from '@eth-optimism/core-utils'
import { Contract, ethers } from 'ethers'
import { ethers } from 'ethers'
import { Log, TransactionReceipt } from 'ethers/providers'
/* Contract Imports */

Expand Down
1 change: 0 additions & 1 deletion packages/ovm/src/types/ovm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Address,
StorageSlot,
StorageValue,
Transaction,
TransactionResult,
} from '@eth-optimism/rollup-core'

Expand Down
6 changes: 2 additions & 4 deletions packages/ovm/test/app/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Contract, ethers } from 'ethers'
import { add0x, ZERO_ADDRESS, TestUtils } from '@eth-optimism/core-utils'
import { add0x, ZERO_ADDRESS } from '@eth-optimism/core-utils'
/* Contract Imports */
import { getWallets } from 'ethereum-waffle'
import { TransactionReceipt, JsonRpcProvider, Log } from 'ethers/providers'
import { TransactionReceipt } from 'ethers/providers'
import {
convertInternalLogsToOvmLogs,
getOvmTransactionMetadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import '../setup'
/* External Imports */
import { createMockProvider, deployContract, getWallets } from 'ethereum-waffle'
import { getLogger } from '@eth-optimism/core-utils'
import { Address } from '@eth-optimism/rollup-core'
import { utils } from 'ethers'

/* Contract Imports */
Expand Down
Loading