-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmaintx.py
37 lines (28 loc) · 1.01 KB
/
maintx.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
import plugin_collection
from indy_vdr.ledger import (
build_get_txn_request,
LedgerType,
)
class main(plugin_collection.Plugin):
def __init__(self):
super().__init__()
self.index = 3
self.name = 'maintx'
self.description = ''
self.type = ''
self.maintx = None
def parse_args(self, parser):
parser.add_argument("-maintx", "--maintx", help="Get a specific transaction number from main ledger.")
def load_parse_args(self, args):
global verbose
verbose = args.verbose
if args.maintx:
self.enabled = True
self.maintx = args.maintx
async def perform_operation(self, pool, result, network_name):
maintx_response = await self.get_txn(pool, int(self.maintx))
result = result + [maintx_response]
return result
async def get_txn(self, pool, seq_no: int):
req = build_get_txn_request(None, LedgerType.DOMAIN, seq_no)
return await pool.submit_request(req)