Ejemplo n.º 1
0
    def __init__(self):
        self.communication = MockBitmessageCommunication()
        self.db = MockOracleDb()
        self.btc = BitcoinClient(account=TEST_ACCOUNT)
        self.evaluator = Evaluator()

        self.task_queue = TaskQueue(self.db)

        self.handlers = defaultdict(lambda: None, handlers)
Ejemplo n.º 2
0
    def __init__(self):
        self.communication = OracleCommunication()
        self.db = OracleDb()
        self.btc = BitcoinClient()
        self.kv = KeyValue(self.db)

        self.task_queue = TaskQueue(self.db)

        self.handlers = op_handlers
        self.signer = TransactionSigner(self)
Ejemplo n.º 3
0
    def __init__(self):

        self.db = OracleDb()
        self.btc = BitcoinClient()
        self.kv = KeyValue(self.db)

        self.task_queue = TaskQueue(self.db)

        self.handlers = op_handlers
        self.signer = TransactionSigner(self)

        last_received = self.kv.get_by_section_key('fastcast', 'last_epoch')
        if not last_received:
            self.kv.store('fastcast', 'last_epoch', {'last': 0})

        self.set_fastcast_address()
Ejemplo n.º 4
0
    def __init__(self):

        self.db = OracleDb()
        self.btc = BitcoinClient()
        self.kv = KeyValue(self.db)

        self.task_queue = TaskQueue(self.db)

        self.handlers = op_handlers
        self.signer = TransactionSigner(self)

        last_received = self.kv.get_by_section_key('fastcast', 'last_epoch')
        if not last_received:
            self.kv.store('fastcast', 'last_epoch', {'last': 0})

        if not self.kv.exists('fastcast', 'address'):
            pub, priv = generateKey()
            self.kv.store('fastcast', 'address', {"pub": pub, "priv": priv})

        logging.info('fastcast pubkey: %r' %
                     self.kv.get_by_section_key('fastcast', 'address')['pub'])