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:
Eduard S
2021-01-15 10:38:51 +01:00
parent ca6a4a6013
commit 168432c559
2 changed files with 3 additions and 3 deletions

View File

@@ -1429,11 +1429,11 @@ func (c *Client) AuctionBid(amount *big.Int, slot int64, bidAmount *big.Int,
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)
}