Exemplo n.º 1
0
    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 = TestFlopper.last_log(flopper)
        assert isinstance(log, Flopper.DentLog)
        assert log.guy == address
        assert log.id == id
        assert log.lot == lot
        assert log.bid == bid
Exemplo n.º 2
0
    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 lot < current_bid.lot
        assert (Wad(flopper.beg()) * lot) <= current_bid.lot

        assert flopper.dent(id, lot, bid).transact(from_address=address)
Exemplo n.º 3
0
    def __init__(self, flopper: Flopper):
        assert isinstance(flopper, Flopper)
        super().__init__(flopper)

        self.flopper = flopper
        self.beg = flopper.beg()