forked from bitshares/python-bitshares
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworker.py
More file actions
34 lines (25 loc) · 980 Bytes
/
worker.py
File metadata and controls
34 lines (25 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
from .account import Account
from .blockchainobject import BlockchainObject
from .instance import BlockchainInstance
from graphenecommon.worker import Worker as GrapheneWorker, Workers as GrapheneWorkers
@BlockchainInstance.inject
class Worker(GrapheneWorker):
""" Read data about a worker in the chain
:param str id: id of the worker
:param bitshares blockchain_instance: BitShares() instance to use when
accesing a RPC
"""
def define_classes(self):
self.account_class = Account
self.type_id = 14
@BlockchainInstance.inject
class Workers(GrapheneWorkers):
""" Obtain a list of workers for an account
:param str account_name/id: Name/id of the account (optional)
:param bitshares blockchain_instance: BitShares() instance to use when
accesing a RPC
"""
def define_classes(self):
self.account_class = Account
self.worker_class = Worker