Skip to content

Commit

Permalink
Enable E2E tests for Cadence Arch
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Sep 30, 2024
1 parent ee70be0 commit 0ff788b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/e2e_web3js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestWeb3_E2E(t *testing.T) {
})

// todo a new emulator version should be released with this PR merged and included
// to fix this test https://github.com/onflow/flow-go/pull/6464
// to fix this test https://github.com/onflow/flow-go/pull/6488
t.Run("test cadence arch and environment calls", func(t *testing.T) {
runWeb3Test(t, "cadence_arch_env_test")
})
Expand Down
20 changes: 10 additions & 10 deletions tests/web3js/cadence_arch_env_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('calls cadence arch functions and block environment functions', functio
var methods
var contractAddress

before(async function() {
before(async function () {
let deployed = await helpers.deployContract('storage')
contractAddress = deployed.receipt.contractAddress
methods = deployed.contract.methods
Expand All @@ -64,7 +64,7 @@ describe('calls cadence arch functions and block environment functions', functio
)
})

it('calls blockTime', async function() {
it('calls blockTime', async function () {
await testEmitTx(methods.emitBlockTime())

let res = await testCall(methods.blockTime())
Expand All @@ -75,7 +75,7 @@ describe('calls cadence arch functions and block environment functions', functio
)
})

it('calls blockHash', async function() {
it('calls blockHash', async function () {
let b = await web3.eth.getBlock('latest')

await testEmitTx(methods.emitBlockHash(b.number))
Expand All @@ -87,14 +87,14 @@ describe('calls cadence arch functions and block environment functions', functio
)
})

it('calls random', async function() {
it('calls random', async function () {
await testEmitTx(methods.emitRandom())

let res = await testCall(methods.random())
assert.isNotEmpty(web3.eth.abi.decodeParameter('uint256', res.value).toString())
})

it('calls chainID', async function() {
it('calls chainID', async function () {
await testEmitTx(methods.emitChainID())
await testCall(methods.chainID())
})
Expand All @@ -103,7 +103,7 @@ describe('calls cadence arch functions and block environment functions', functio
// we should detect that and recover, in the block executor call method we should
// detect cadence arch call and recover with remote call

it.skip('calls verifyArchCallToFlowBlockHeight', async function() {
it('calls verifyArchCallToFlowBlockHeight', async function () {
await testEmitTx(methods.emitVerifyArchCallToFlowBlockHeight())

let res = await testCall(methods.verifyArchCallToFlowBlockHeight())
Expand All @@ -113,7 +113,7 @@ describe('calls cadence arch functions and block environment functions', functio
)
})

it.skip('calls verifyArchCallToRandomSource', async function() {
it('calls verifyArchCallToRandomSource', async function () {
await testEmitTx(methods.emitVerifyArchCallToRandomSource(1))

let res = await testCall(methods.verifyArchCallToRandomSource(1))
Expand All @@ -125,7 +125,7 @@ describe('calls cadence arch functions and block environment functions', functio
})


it.skip('calls verifyArchCallToRevertibleRandom', async function() {
it('calls verifyArchCallToRevertibleRandom', async function () {
await testEmitTx(methods.emitVerifyArchCallToRevertibleRandom())

let res = await testCall(methods.verifyArchCallToRevertibleRandom())
Expand All @@ -136,7 +136,7 @@ describe('calls cadence arch functions and block environment functions', functio
assert.lengthOf(res.value, 66)
})

it.skip('calls verifyArchCallToVerifyCOAOwnershipProof', async function() {
it('calls verifyArchCallToVerifyCOAOwnershipProof', async function () {
let tx = await web3.eth.getTransactionFromBlock(conf.startBlockHeight, 1)
let bytes = web3.utils.hexToBytes('f853c18088f8d6e0586b0a20c78365766df842b840b90448f4591df2639873be2914c5560149318b7e2fcf160f7bb8ed13cfd97be2f54e6889606f18e50b2c37308386f840e03a9fff915f57b2164cba27f0206a95')
let addr = '0x1bacdb569847f31ade07e83d6bb7cefba2b9290b35d5c2964663215e73519cff'
Expand All @@ -149,4 +149,4 @@ describe('calls cadence arch functions and block environment functions', functio
false,
)
})
})
})

0 comments on commit 0ff788b

Please sign in to comment.