mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
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.
This commit is contained in:
@@ -1080,7 +1080,7 @@ func (s *Synchronizer) auctionSync(ethBlock *common.Block) (*common.AuctionData,
|
|||||||
}
|
}
|
||||||
s.vars.Auction.DefaultSlotSetBid[evt.SlotSet] = evt.NewInitialMinBid
|
s.vars.Auction.DefaultSlotSetBid[evt.SlotSet] = evt.NewInitialMinBid
|
||||||
s.vars.Auction.DefaultSlotSetBidSlotNum = s.consts.Auction.SlotNum(blockNum) +
|
s.vars.Auction.DefaultSlotSetBidSlotNum = s.consts.Auction.SlotNum(blockNum) +
|
||||||
int64(s.vars.Auction.ClosedAuctionSlots) + 1
|
int64(s.vars.Auction.ClosedAuctionSlots)
|
||||||
varsUpdate = true
|
varsUpdate = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1429,11 +1429,11 @@ func (c *Client) AuctionBid(amount *big.Int, slot int64, bidAmount *big.Int,
|
|||||||
nextBlock := c.nextBlock()
|
nextBlock := c.nextBlock()
|
||||||
a := nextBlock.Auction
|
a := nextBlock.Auction
|
||||||
|
|
||||||
if slot < a.getCurrentSlotNumber()+int64(a.Vars.ClosedAuctionSlots) {
|
if slot <= a.getCurrentSlotNumber()+int64(a.Vars.ClosedAuctionSlots) {
|
||||||
return nil, tracerr.Wrap(errBidClosed)
|
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)
|
return nil, tracerr.Wrap(errBidNotOpen)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user