Skip to content

Commit

Permalink
Revert "Simple Contract Integrations (#16)"
Browse files Browse the repository at this point in the history
This reverts commit 00581e3.
  • Loading branch information
masonforest committed Mar 4, 2020
1 parent 6c7e57d commit b9dce16
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const defaultWhitelist: EVMOpcode[] = [
Opcode.EXP,
Opcode.EXTCODECOPY,
Opcode.EXTCODESIZE,
Opcode.EXTCODEHASH,
Opcode.GAS,
Opcode.GT,
Opcode.INVALID,
Expand All @@ -94,7 +93,6 @@ const defaultWhitelist: EVMOpcode[] = [
Opcode.MULMOD,
Opcode.NOT,
Opcode.OR,
Opcode.ORIGIN,
Opcode.PC,
Opcode.POP,
Opcode.PUSH1,
Expand Down
14 changes: 2 additions & 12 deletions packages/rollup-dev-tools/src/tools/transpiler/transpiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,16 @@ export class TranspilerImpl implements Transpiler {
const deployedBytecodeTranspilationResult: TaggedTranspilationResult = this.transpileBytecodePreservingTags(
taggedDeployedEVMBytecode
)

// todo error handle however above
if (!deployedBytecodeTranspilationResult.succeeded) {
errors.push(
...(deployedBytecodeTranspilationResult as ErroredTranspilation).errors
)
return {
succeeded: false,
errors,
}
}
const transpiledDeployedBytecode: EVMBytecode =
deployedBytecodeTranspilationResult.bytecodeWithTags

log.debug(`Fixing the constant indices for transpiled deployed bytecode...`)
log.debug(`errors are: ${JSON.stringify(errors)}`)
log.debug(`Fixing constant indices for transpiled deployed bytecode...`)
// Note that fixTaggedConstantOffsets() scrubs all fixed tags, so we do not re-fix when we use finalTranspiledDeployedBytecode to reconstruct the returned initcode
const finalTranspiledDeployedBytecode: EVMBytecode = this.fixTaggedConstantOffsets(
transpiledDeployedBytecode as EVMBytecode,
Expand Down Expand Up @@ -191,10 +186,6 @@ export class TranspilerImpl implements Transpiler {
...(constructorInitLogicTranspilationResult as ErroredTranspilation)
.errors
)
return {
succeeded: false,
errors,
}
}
const transpiledConstructorInitLogic: EVMBytecode =
constructorInitLogicTranspilationResult.bytecodeWithTags
Expand Down Expand Up @@ -260,7 +251,6 @@ export class TranspilerImpl implements Transpiler {
taggedBytecode: EVMBytecode,
errors
): EVMBytecode {
log.debug(`tagged input: ${formatBytecode(taggedBytecode)}`)
const inputAsBuf: Buffer = bytecodeToBuffer(taggedBytecode)
const bytecodeToReturn: EVMBytecode = []
for (const [index, op] of taggedBytecode.entries()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('Solitity contracts should have constants correctly accessible when usi
const bytesMemoryConstB: Buffer = Buffer.from(
`this should pass but the error message is much longer`
)
it('should work for the second bytes memory constant', async () => {
it('should work for the first bytes memory constant', async () => {
const retrievedBytesMemoryBVal: Buffer = await getGetterReturnedVal(
deployedGetterAddress,
'getBytesMemoryConstantB',
Expand Down
9 changes: 3 additions & 6 deletions packages/rollup-full-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
],
"scripts": {
"all": "yarn clean && yarn build && yarn test && yarn fix && yarn lint",
"build": "waffle waffle-config-untranspiled.json && waffle waffle-config-transpiled.json && tsc -p .",
"clean": "rimraf build/ && yarn clean-contracts",
"build": "waffle waffle-config.json && tsc -p .",
"clean": "rimraf build/ && rimraf test/contracts/build",
"fix": "prettier --config ../../prettier-config.json --write 'index.ts' '{src,test}/**/*.ts'",
"lint": "tslint --format stylish --project .",
"test": "yarn build-contracts && mocha --require source-map-support/register --require ts-node/register 'test/**/*.spec.ts' --timeout 8000 --exit",
"clean-contracts": "rimraf ./test/contracts/build && mkdir ./test/contracts/build && mkdir ./test/contracts/build/transpiled && mkdir ./test/contracts/build/untranspiled",
"build-contracts": "yarn clean-contracts && waffle waffle-config-untranspiled.json && waffle waffle-config-transpiled.json",
"test": "waffle waffle-config.json && mocha --require source-map-support/register --require ts-node/register 'test/**/*.spec.ts' --timeout 8000 --exit",
"server:aggregator": "env DEBUG=\"info:*,error:*\" node ./exec/aggregator.js",
"server:fullnode": "env DEBUG=\"info:*,error:*\" node ./exec/fullnode.js",
"server:fullnode:debug": "env DEBUG=\"info:*,error:*,debug:*\" node ./exec/fullnode.js"
Expand Down Expand Up @@ -47,7 +45,6 @@
"fastpriorityqueue": "^0.6.3"
},
"devDependencies": {
"@eth-optimism/solc-transpiler": "^0.0.1-alpha.12",
"@types/abstract-leveldown": "^5.0.1",
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.7",
Expand Down
8 changes: 2 additions & 6 deletions packages/rollup-full-node/test/app/handler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ import '../setup'
import { getLogger } from '@eth-optimism/core-utils'

/* Internal Imports */
import {
FullnodeRpcServer,
deployOvmContract,
DefaultWeb3Handler,
} from '../../src/app'
import * as SimpleStorage from '../contracts/build/untranspiled/SimpleStorage.json'
import { FullnodeRpcServer, DefaultWeb3Handler } from '../../src/app'
import * as SimpleStorage from '../contracts/build/SimpleStorage.json'
import { ethers, ContractFactory } from 'ethers'
import { FullnodeHandler } from '../../src/types'

Expand Down

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions packages/rollup-full-node/test/contracts/transpiled/ExtCode.sol

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions packages/rollup-full-node/waffle-config-transpiled.json

This file was deleted.

12 changes: 0 additions & 12 deletions packages/rollup-full-node/waffle-config-untranspiled.json

This file was deleted.

5 changes: 5 additions & 0 deletions packages/rollup-full-node/waffle-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sourcesPath": "./test/contracts",
"targetPath": "./test/contracts/build",
"npmPath": "../../node_modules"
}

0 comments on commit b9dce16

Please sign in to comment.