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

YAS 212 Enable ovmTIMESTAMP test #40

Merged
merged 3 commits into from
Mar 16, 2020
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
2 changes: 1 addition & 1 deletion packages/rollup-full-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 .",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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, [], [])
Expand Down