Skip to content

Commit

Permalink
Clean up block logs functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hkalodner committed Dec 9, 2020
1 parent efbce16 commit d75d1e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/arb-evm/evm/blockresult.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ func (b *BlockInfo) LastAVMLog() *big.Int {
}

func (b *BlockInfo) FirstAVMLog() *big.Int {
return new(big.Int).Sub(b.LastAVMLog(), b.BlockStats.AVMLogCount)
val := new(big.Int).Sub(b.ChainStats.AVMLogCount, b.BlockStats.AVMLogCount)
// Move back one further to account for the block log itself
return val.Sub(val, big.NewInt(1))
}

func (b *BlockInfo) LastAVMSend() *big.Int {
return new(big.Int).Sub(b.ChainStats.AVMSendCount, big.NewInt(1))
}

func (b *BlockInfo) FirstAVMSend() *big.Int {
val := new(big.Int).Sub(b.LastAVMSend(), b.BlockStats.AVMSendCount)
return val.Add(val, big.NewInt(1))
return new(big.Int).Sub(b.ChainStats.AVMSendCount, b.BlockStats.AVMSendCount)
}

func (b *BlockInfo) AsValue() value.Value {
Expand Down

0 comments on commit d75d1e4

Please sign in to comment.