示例#1
0
 def get_info(self) -> Info:
     info = self.lrpc.getinfo()
     pubkey = info['id']
     binding = info.get('binding')
     uris = []
     if binding:
         for b in binding:
             address = b['address']
             if ':' not in address:  # TODO: Change type of uri to LightningAddress.
                 port = b['port']
                 uri = f"{pubkey}@{address}:{port}"
                 uris.append(uri)
     return Info(uris=uris, )
示例#2
0
def info(uris):
    yield Info(uris=uris, )
示例#3
0
def info_with_no_uris():
    yield Info(uris=[], )
示例#4
0
 def get_info(self) -> Info:
     get_info_request = lnd_pb2.GetInfoRequest()
     get_info_response = self.stub.GetInfo(get_info_request, )
     return Info(uris=get_info_response.uris, )