Example #1
0
    def test_get_height(self):
        with set_qrl_dir("wallet_ver1"):
            walletd = WalletD()
            walletd._public_stub.GetHeight = Mock(
                return_value=qrl_pb2.GetHeightResp(height=1001))

            height = walletd.get_height()
            self.assertEqual(height, 1001)
Example #2
0
    def test_getHeight(self):
        with set_qrl_dir("wallet_ver1"):
            walletd = WalletD()
            service = WalletAPIService(walletd)

            walletd._public_stub.GetHeight = Mock(
                return_value=qrl_pb2.GetHeightResp(height=1001))

            resp = service.GetHeight(qrlwallet_pb2.HeightReq(), context=None)

            self.assertEqual(resp.code, 0)
            self.assertEqual(resp.height, 1001)
Example #3
0
 def GetHeight(self, request: qrl_pb2.GetHeightReq, context) -> qrl_pb2.GetHeightResp:
     logger.debug("[PublicAPI] GetHeight")
     return qrl_pb2.GetHeightResp(height=self.qrlnode.block_height)