Commit ec851f88 authored by Karl Floersch's avatar Karl Floersch Committed by GitHub

Add event for totalElements (#17)

parent d37dc769
...@@ -220,7 +220,8 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, OVM_Ba ...@@ -220,7 +220,8 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, OVM_Ba
emit QueueBatchAppended( emit QueueBatchAppended(
nextQueueIndex - _numQueuedTransactions, nextQueueIndex - _numQueuedTransactions,
_numQueuedTransactions _numQueuedTransactions,
getTotalElements()
); );
} }
...@@ -340,7 +341,8 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, OVM_Ba ...@@ -340,7 +341,8 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, OVM_Ba
emit SequencerBatchAppended( emit SequencerBatchAppended(
nextQueueIndex - numQueuedTransactions, nextQueueIndex - numQueuedTransactions,
numQueuedTransactions numQueuedTransactions,
getTotalElements()
); );
} }
......
...@@ -28,12 +28,14 @@ interface iOVM_CanonicalTransactionChain is iOVM_BaseChain { ...@@ -28,12 +28,14 @@ interface iOVM_CanonicalTransactionChain is iOVM_BaseChain {
event QueueBatchAppended( event QueueBatchAppended(
uint256 _startingQueueIndex, uint256 _startingQueueIndex,
uint256 _numQueueElements uint256 _numQueueElements,
uint256 _totalElements
); );
event SequencerBatchAppended( event SequencerBatchAppended(
uint256 _startingQueueIndex, uint256 _startingQueueIndex,
uint256 _numQueueElements uint256 _numQueueElements,
uint256 _totalElements
); );
......
...@@ -405,7 +405,7 @@ describe('OVM_CanonicalTransactionChain', () => { ...@@ -405,7 +405,7 @@ describe('OVM_CanonicalTransactionChain', () => {
).appendQueueBatch(1) ).appendQueueBatch(1)
) )
.to.emit(OVM_CanonicalTransactionChain, 'QueueBatchAppended') .to.emit(OVM_CanonicalTransactionChain, 'QueueBatchAppended')
.withArgs(0, 1) .withArgs(0, 1, 1)
}) })
}) })
...@@ -420,13 +420,13 @@ describe('OVM_CanonicalTransactionChain', () => { ...@@ -420,13 +420,13 @@ describe('OVM_CanonicalTransactionChain', () => {
it('should be able to append a single element', async () => { it('should be able to append a single element', async () => {
await expect(OVM_CanonicalTransactionChain.appendQueueBatch(1)) await expect(OVM_CanonicalTransactionChain.appendQueueBatch(1))
.to.emit(OVM_CanonicalTransactionChain, 'QueueBatchAppended') .to.emit(OVM_CanonicalTransactionChain, 'QueueBatchAppended')
.withArgs(0, 1) .withArgs(0, 1, 1)
}) })
it(`should be able to append ${size} elements`, async () => { it(`should be able to append ${size} elements`, async () => {
await expect(OVM_CanonicalTransactionChain.appendQueueBatch(size)) await expect(OVM_CanonicalTransactionChain.appendQueueBatch(size))
.to.emit(OVM_CanonicalTransactionChain, 'QueueBatchAppended') .to.emit(OVM_CanonicalTransactionChain, 'QueueBatchAppended')
.withArgs(0, size) .withArgs(0, size, size)
}) })
it(`should revert if appending ${size} + 1 elements`, async () => { it(`should revert if appending ${size} + 1 elements`, async () => {
...@@ -698,7 +698,7 @@ describe('OVM_CanonicalTransactionChain', () => { ...@@ -698,7 +698,7 @@ describe('OVM_CanonicalTransactionChain', () => {
}) })
) )
.to.emit(OVM_CanonicalTransactionChain, 'SequencerBatchAppended') .to.emit(OVM_CanonicalTransactionChain, 'SequencerBatchAppended')
.withArgs(0, 0) .withArgs(0, 0, size)
}) })
}) })
}) })
...@@ -747,7 +747,7 @@ describe('OVM_CanonicalTransactionChain', () => { ...@@ -747,7 +747,7 @@ describe('OVM_CanonicalTransactionChain', () => {
) )
) )
.to.emit(OVM_CanonicalTransactionChain, 'SequencerBatchAppended') .to.emit(OVM_CanonicalTransactionChain, 'SequencerBatchAppended')
.withArgs(0, size) .withArgs(0, size, size * 2)
}) })
}) })
...@@ -787,7 +787,7 @@ describe('OVM_CanonicalTransactionChain', () => { ...@@ -787,7 +787,7 @@ describe('OVM_CanonicalTransactionChain', () => {
}) })
) )
.to.emit(OVM_CanonicalTransactionChain, 'SequencerBatchAppended') .to.emit(OVM_CanonicalTransactionChain, 'SequencerBatchAppended')
.withArgs(0, spacing) .withArgs(0, spacing, size + spacing)
}) })
}) })
}) })
......
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