Ejemplo n.º 1
0
class TubPriceFeed(PriceFeed):
    def __init__(self, tub: Tub):
        assert (isinstance(tub, Tub))

        self.ds_value = DSValue(web3=tub.web3, address=tub.pip())

    def get_price(self) -> Optional[Wad]:
        return Wad(self.ds_value.read_as_int())
Ejemplo n.º 2
0
class TubPriceFeed(PriceFeed):
    def __init__(self, tub: Tub):
        assert(isinstance(tub, Tub))

        self.ds_value = DSValue(web3=tub.web3, address=tub.pip())

    def get_price(self) -> Price:
        tub_price = Wad(self.ds_value.read_as_int())

        return Price(buy_price=tub_price, sell_price=tub_price)
class TubPriceFeed(PriceFeed):
    def __init__(self, tub: Tub):
        assert(isinstance(tub, Tub))

        self.ds_value = DSValue(web3=tub.web3, address=tub.pip())

    def get_price(self) -> Price:
        tub_price = Wad(self.ds_value.read_as_int())

        return Price(buy_price=tub_price, sell_price=tub_price)