diff --git a/packages/rollup-full-node/package.json b/packages/rollup-full-node/package.json index 3466fde835b9..5c26393bbbbb 100644 --- a/packages/rollup-full-node/package.json +++ b/packages/rollup-full-node/package.json @@ -8,7 +8,7 @@ ], "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 .", + "build": "yarn build-contracts && tsc -p .", "clean": "rimraf build/ && yarn clean-contracts", "fix": "prettier --config ../../prettier-config.json --write 'index.ts' '{src,test}/**/*.ts'", "lint": "tslint --format stylish --project .", diff --git a/packages/rollup-full-node/test/integration/transpiler-integration.spec.ts b/packages/rollup-full-node/test/integration/transpiler-integration.spec.ts index 95eebd3503a9..602b2df51d49 100644 --- a/packages/rollup-full-node/test/integration/transpiler-integration.spec.ts +++ b/packages/rollup-full-node/test/integration/transpiler-integration.spec.ts @@ -12,22 +12,26 @@ import * as OriginGetter from '../contracts/build/transpiled/OriginGetter.json' import * as CallerReturner from '../contracts/build/transpiled/CallerReturner.json' import * as TimeGetter from '../contracts/build/transpiled/TimeGetter.json' -import { createMockProvider, getWallets, deployContract } from '../../' +import { + createMockProvider, + createProviderForHandler, + getWallets, + deployContract, + TestWeb3Handler, +} from '../../' describe(`Various opcodes should be usable in combination with transpiler and full node`, () => { + let handler: TestWeb3Handler let provider let wallet beforeEach(async () => { - provider = await createMockProvider() + handler = await TestWeb3Handler.create() + provider = createProviderForHandler(handler) const wallets = getWallets(provider) wallet = wallets[0] }) - afterEach(() => { - provider.closeOVM() - }) - // TEST BASIC FUNCTIONALITIES it('should process cross-ovm-contract calls', async () => { @@ -51,11 +55,11 @@ describe(`Various opcodes should be usable in combination with transpiler and fu const returnedAddress: Address = await selfAware.getMyAddress() deployedAddress.should.equal(returnedAddress) }) - it.skip('should work for block.timestamp', async () => { - // todo, once we handle timestamps, unskip this test + it('should work for block.timestamp', async () => { const timeGetter = await deployContract(wallet, TimeGetter, [], []) - const time = await timeGetter.getTimestamp() - time._hex.should.equal('???') + const handlerTime = await handler.handleRequest(`evm_getTime`, []) + const contractTime = await timeGetter.getTimestamp() + contractTime._hex.should.equal(handlerTime) }) it('should work for msg.sender', async () => { const callerReturner = await deployContract(wallet, CallerReturner, [], [])