def dent(flopper: Flopper, id: int, address: Address, lot: Wad, bid: Rad): assert (isinstance(flopper, Flopper)) assert (isinstance(id, int)) assert (isinstance(lot, Wad)) assert (isinstance(bid, Rad)) assert flopper.live() == 1 current_bid = flopper.bids(id) assert current_bid.guy != Address( "0x0000000000000000000000000000000000000000") assert current_bid.tic > datetime.now().timestamp( ) or current_bid.tic == 0 assert current_bid.end > datetime.now().timestamp() assert bid == current_bid.bid assert Wad(0) < lot < current_bid.lot assert flopper.beg() * lot <= current_bid.lot assert flopper.dent(id, lot, bid).transact(from_address=address) log = flopper.past_logs(1)[0] assert isinstance(log, Flopper.DentLog) assert log.guy == address assert log.id == id assert log.lot == lot assert log.bid == bid
def last_log(flopper: Flopper): current_block = flopper.web3.eth.blockNumber return flopper.past_logs(current_block - 1, current_block)[0]