-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathschemaid.py
34 lines (27 loc) · 1.03 KB
/
schemaid.py
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
import plugin_collection
from indy_vdr.ledger import build_get_schema_request
class main(plugin_collection.Plugin):
def __init__(self):
super().__init__()
self.index = 2
self.name = 'Schemaid'
self.description = ''
self.type = ''
self.schemaid = None
def parse_args(self, parser):
parser.add_argument("-schemaid", "--schemaid", help="Get a specific schema from ledger. (TxnID of SCHEMA)")
def load_parse_args(self, args):
global verbose
verbose = args.verbose
self.enabled = bool(args.schemaid)
self.schemaid = args.schemaid
async def perform_operation(self, pool, result, network_name):
# "QXdMLmAKZmQBhnvXHxKn78:2:SURFNetSchema:1.0"
response = await self.get_schema_by_Id(pool, self.schemaid)
result = result + [response]
return result
async def get_schema_by_Id(self, pool, schemaid):
req = build_get_schema_request(
None, schemaid
)
return await pool.submit_request(req)