-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcredid.py
38 lines (29 loc) · 1.03 KB
/
credid.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
35
36
37
38
import plugin_collection
from indy_vdr.ledger import (
build_get_cred_def_request,
)
class main(plugin_collection.Plugin):
def __init__(self):
super().__init__()
self.index = 3
self.name = 'credid'
self.description = ''
self.type = ''
self.maintx = None
def parse_args(self, parser):
parser.add_argument("-credid", "--credid", help="Get a specific credential definition from ledger. (TxnID of CLAIM_DEF)")
def load_parse_args(self, args):
global verbose
verbose = args.verbose
if args.credid:
self.enabled = True
self.credid = args.credid
async def perform_operation(self, pool, result, network_name):
credid_response = await self.get_cred_by_Id(pool, self.credid)
result = result + [credid_response]
return result
async def get_cred_by_Id(self, pool, credId):
req = build_get_cred_def_request(
None, credId
)
return await pool.submit_request(req)