arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
Remove +1 in DefaultSlotSetBidSlotNum

The smart contracts were updated at some point and there have been some changes
in slot calculation.  Update these values in the synchronizer and test auction
smart contract implementaiton.
Eduard S eduard@iden3.io
Fri, 15 Jan 2021 10:38:51 +0100
commit

168432c5596e7c415bde8b26401cb0f2d7070b16

parent

ca6a4a6013f5667e78cd57c3935a525fb8438bbf

2 files changed, 3 insertions(+), 3 deletions(-)

jump to
M synchronizer/synchronizer.go → synchronizer/synchronizer.go

@@ -1080,7 +1080,7 @@ "auctionEvents.NewDefaultSlotSetBid: %v", evt.SlotSet))

} s.vars.Auction.DefaultSlotSetBid[evt.SlotSet] = evt.NewInitialMinBid s.vars.Auction.DefaultSlotSetBidSlotNum = s.consts.Auction.SlotNum(blockNum) + - int64(s.vars.Auction.ClosedAuctionSlots) + 1 + int64(s.vars.Auction.ClosedAuctionSlots) varsUpdate = true }
M test/ethclient.go → test/ethclient.go

@@ -1429,11 +1429,11 @@

nextBlock := c.nextBlock() a := nextBlock.Auction - if slot < a.getCurrentSlotNumber()+int64(a.Vars.ClosedAuctionSlots) { + if slot <= a.getCurrentSlotNumber()+int64(a.Vars.ClosedAuctionSlots) { return nil, tracerr.Wrap(errBidClosed) } - if slot >= a.getCurrentSlotNumber()+int64(a.Vars.ClosedAuctionSlots)+int64(a.Vars.OpenAuctionSlots) { + if slot > a.getCurrentSlotNumber()+int64(a.Vars.ClosedAuctionSlots)+int64(a.Vars.OpenAuctionSlots) { return nil, tracerr.Wrap(errBidNotOpen) }