Commit 8a98e21f authored by elenadimitrova's avatar elenadimitrova Committed by Kelvin Fichter

Rebasing fixes

parent 11bec4c5
...@@ -255,17 +255,17 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -255,17 +255,17 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
let ENQUEUE_L2_GAS_PREPAID let ENQUEUE_L2_GAS_PREPAID
let data let data
beforeEach(async () => { beforeEach(async () => {
OVM_CanonicalTransactionChain = CanonicalTransactionChain =
OVM_CanonicalTransactionChain.connect(sequencer) CanonicalTransactionChain.connect(sequencer)
ENQUEUE_L2_GAS_PREPAID = ENQUEUE_L2_GAS_PREPAID =
await OVM_CanonicalTransactionChain.ENQUEUE_L2_GAS_PREPAID() await CanonicalTransactionChain.ENQUEUE_L2_GAS_PREPAID()
data = '0x' + '12'.repeat(1234) data = '0x' + '12'.repeat(1234)
}) })
it('cost to enqueue a transaction above the prepaid threshold', async () => { it('cost to enqueue a transaction above the prepaid threshold', async () => {
const l2GasLimit = 2 * ENQUEUE_L2_GAS_PREPAID const l2GasLimit = 2 * ENQUEUE_L2_GAS_PREPAID
const res = await OVM_CanonicalTransactionChain.enqueue( const res = await CanonicalTransactionChain.enqueue(
NON_ZERO_ADDRESS, NON_ZERO_ADDRESS,
l2GasLimit, l2GasLimit,
data data
...@@ -279,7 +279,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -279,7 +279,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
it('cost to enqueue a transaction below the prepaid threshold', async () => { it('cost to enqueue a transaction below the prepaid threshold', async () => {
const l2GasLimit = ENQUEUE_L2_GAS_PREPAID - 1 const l2GasLimit = ENQUEUE_L2_GAS_PREPAID - 1
const res = await OVM_CanonicalTransactionChain.enqueue( const res = await CanonicalTransactionChain.enqueue(
NON_ZERO_ADDRESS, NON_ZERO_ADDRESS,
l2GasLimit, l2GasLimit,
data data
......
...@@ -252,27 +252,27 @@ describe('CanonicalTransactionChain', () => { ...@@ -252,27 +252,27 @@ describe('CanonicalTransactionChain', () => {
describe('with _gaslimit below the ENQUEUE_L2_GAS_PREPAID threshold', async () => { describe('with _gaslimit below the ENQUEUE_L2_GAS_PREPAID threshold', async () => {
it('the cost to enqueue transactions is consistent for different L2 gas amounts below the prepaid threshold', async () => { it('the cost to enqueue transactions is consistent for different L2 gas amounts below the prepaid threshold', async () => {
const ENQUEUE_L2_GAS_PREPAID = const ENQUEUE_L2_GAS_PREPAID =
await OVM_CanonicalTransactionChain.ENQUEUE_L2_GAS_PREPAID() await CanonicalTransactionChain.ENQUEUE_L2_GAS_PREPAID()
const data = '0x' + '12'.repeat(1234) const data = '0x' + '12'.repeat(1234)
const l2GasLimit1 = ENQUEUE_L2_GAS_PREPAID - 1 const l2GasLimit1 = ENQUEUE_L2_GAS_PREPAID - 1
const l2GasLimit2 = ENQUEUE_L2_GAS_PREPAID - 100 const l2GasLimit2 = ENQUEUE_L2_GAS_PREPAID - 100
// The first enqueue is more expensive because it's writing to an empty slot, // The first enqueue is more expensive because it's writing to an empty slot,
// so we need to pre-load the buffer or the test will fail. // so we need to pre-load the buffer or the test will fail.
await OVM_CanonicalTransactionChain.enqueue( await CanonicalTransactionChain.enqueue(
NON_ZERO_ADDRESS, NON_ZERO_ADDRESS,
l2GasLimit1, l2GasLimit1,
data data
) )
const res1 = await OVM_CanonicalTransactionChain.enqueue( const res1 = await CanonicalTransactionChain.enqueue(
NON_ZERO_ADDRESS, NON_ZERO_ADDRESS,
l2GasLimit1, l2GasLimit1,
data data
) )
const receipt1 = await res1.wait() const receipt1 = await res1.wait()
const res2 = await OVM_CanonicalTransactionChain.enqueue( const res2 = await CanonicalTransactionChain.enqueue(
NON_ZERO_ADDRESS, NON_ZERO_ADDRESS,
l2GasLimit2, l2GasLimit2,
data data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment