Commit 44f59f18 authored by Vincent Texier's avatar Vincent Texier

Fix type of post responses

parent 3d3adda6
Pipeline #2775 passed with stages
in 1 minute and 33 seconds
......@@ -18,7 +18,7 @@
import logging
from typing import Union
from aiohttp import ClientSession
from aiohttp import ClientResponse
from duniterpy.api.client import Client, RESPONSE_AIOHTTP
......@@ -325,7 +325,7 @@ async def memberships(client: Client, search: str) -> dict:
return await client.get(MODULE + '/memberships/%s' % search, schema=MEMBERSHIPS_SCHEMA)
async def membership(client: Client, membership_signed_raw: str):
async def membership(client: Client, membership_signed_raw: str) -> ClientResponse:
"""
POST a Membership document
......@@ -347,7 +347,7 @@ async def current(client: Client) -> dict:
async def block(client: Client, number: int = 0, block_raw: str = None, signature: str = None) -> Union[dict,
ClientSession]:
ClientResponse]:
"""
GET/POST a block from/to the blockchain
......
......@@ -17,7 +17,7 @@
# vit
import logging
from aiohttp import ClientSession
from aiohttp import ClientResponse
from duniterpy.api.client import Client, RESPONSE_AIOHTTP
......@@ -129,12 +129,12 @@ async def peers(client: Client, leaves: bool = False, leaf: str = ""):
return await client.get(MODULE + '/peering/peers', {"leaf": leaf}, schema=PEERS_SCHEMA)
async def peer(client: Client, peer_signed_raw: str) -> ClientSession:
async def peer(client: Client, peer_signed_raw: str) -> ClientResponse:
"""
POST a Peer signed raw document
:param client: Client to connect to the api
:param peer_signed_raw: Peer signed raw document
:rtype: ClientSession
:rtype: ClientResponse
"""
return await client.post(MODULE + '/peering/peers', {'peer': peer_signed_raw}, rtype=RESPONSE_AIOHTTP)
......@@ -17,7 +17,7 @@
# vit
import logging
from aiohttp import ClientSession
from aiohttp import ClientResponse
from duniterpy.api.client import Client, RESPONSE_AIOHTTP
......@@ -211,7 +211,7 @@ async def history(client: Client, pubkey: str) -> dict:
return await client.get(MODULE + '/history/%s' % pubkey, schema=HISTORY_SCHEMA)
async def process(client: Client, transaction_signed_raw: str) -> ClientSession:
async def process(client: Client, transaction_signed_raw: str) -> ClientResponse:
"""
POST a transaction raw document
......
......@@ -17,7 +17,7 @@
# vit
import logging
from aiohttp import ClientSession
from aiohttp import ClientResponse
from duniterpy.api.client import Client, RESPONSE_AIOHTTP
......@@ -299,7 +299,7 @@ LOOKUP_SCHEMA = {
}
async def add(client: Client, identity_signed_raw: str) -> ClientSession:
async def add(client: Client, identity_signed_raw: str) -> ClientResponse:
"""
POST identity raw document
......@@ -310,7 +310,7 @@ async def add(client: Client, identity_signed_raw: str) -> ClientSession:
return await client.post(MODULE + '/add', {'identity': identity_signed_raw}, rtype=RESPONSE_AIOHTTP)
async def certify(client: Client, certification_signed_raw: str) -> ClientSession:
async def certify(client: Client, certification_signed_raw: str) -> ClientResponse:
"""
POST certification raw document
......@@ -321,7 +321,7 @@ async def certify(client: Client, certification_signed_raw: str) -> ClientSessio
return await client.post(MODULE + '/certify', {'cert': certification_signed_raw}, rtype=RESPONSE_AIOHTTP)
async def revoke(client: Client, revocation_signed_raw: str) -> ClientSession:
async def revoke(client: Client, revocation_signed_raw: str) -> ClientResponse:
"""
POST revocation document
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment