Commit fb5df373 authored by Maurelian's avatar Maurelian Committed by Kelvin Fichter

refactor(contracts): combine two mappings into one with a struct

parent 5db50b3d
...@@ -229,7 +229,7 @@ contract CanonicalTransactionChain is ICanonicalTransactionChain, Lib_AddressRes ...@@ -229,7 +229,7 @@ contract CanonicalTransactionChain is ICanonicalTransactionChain, Lib_AddressRes
uint40 uint40
) )
{ {
return uint40(transactionHashes.length); return uint40(queueElements.length);
} }
/** /**
......
...@@ -218,7 +218,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -218,7 +218,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
'Non-calldata overhead gas cost per transaction:', 'Non-calldata overhead gas cost per transaction:',
(gasUsed - fixedCalldataCost) / numTxs (gasUsed - fixedCalldataCost) / numTxs
) )
expectApprox(gasUsed, 1_617_381, { expectApprox(gasUsed, 1_619_781, {
absoluteUpperDeviation: 1000, absoluteUpperDeviation: 1000,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your // Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value! // contracts are too efficient, consider updating the target value!
...@@ -309,7 +309,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -309,7 +309,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
console.log('Benchmark complete.') console.log('Benchmark complete.')
printGasSavings(gasUsed, 237_065) printGasSavings(gasUsed, 237_065)
expectApprox(gasUsed, 206_880, { expectApprox(gasUsed, 187_081, {
absoluteUpperDeviation: 500, absoluteUpperDeviation: 500,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your // Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value! // contracts are too efficient, consider updating the target value!
...@@ -331,7 +331,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => { ...@@ -331,7 +331,7 @@ describe('[GAS BENCHMARK] CanonicalTransactionChain', () => {
console.log('Benchmark complete.') console.log('Benchmark complete.')
printGasSavings(gasUsed, 196_457) printGasSavings(gasUsed, 196_457)
expectApprox(gasUsed, 146_499, { expectApprox(gasUsed, 126_700, {
absoluteUpperDeviation: 500, absoluteUpperDeviation: 500,
// Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your // Assert a lower bound of 1% reduction on gas cost. If your tests are breaking because your
// contracts are too efficient, consider updating the target value! // contracts are too efficient, consider updating the target value!
......
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