mirror of
https://github.com/planetmint/planetmint.git
synced 2025-06-24 23:22:29 +00:00
Merge branch 'main' into enes-docs
This commit is contained in:
commit
b986461edc
@ -35,4 +35,4 @@ sphinx:
|
|||||||
# Optionally declare the Python requirements required to build your docs
|
# Optionally declare the Python requirements required to build your docs
|
||||||
python:
|
python:
|
||||||
install:
|
install:
|
||||||
- requirements: docs/root/requirements.txt
|
- requirements: docs/root/requirements.txt
|
||||||
|
@ -4,17 +4,20 @@ RUN apt-get update \
|
|||||||
&& pip install -U pip \
|
&& pip install -U pip \
|
||||||
&& apt-get autoremove \
|
&& apt-get autoremove \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
RUN apt-get install -y vim zsh build-essential cmake
|
RUN apt-get install -y vim zsh build-essential cmake
|
||||||
|
|
||||||
RUN mkdir -p /src
|
RUN mkdir -p /src
|
||||||
|
RUN /usr/local/bin/python -m pip install --upgrade pip
|
||||||
|
RUN pip install --upgrade meson ninja
|
||||||
|
RUN pip install zenroom==2.0.0.dev1644927841
|
||||||
RUN pip install --upgrade \
|
RUN pip install --upgrade \
|
||||||
pycco \
|
pycco \
|
||||||
websocket-client~=0.47.0 \
|
websocket-client~=0.47.0 \
|
||||||
pytest~=3.0 \
|
pytest~=3.0 \
|
||||||
git+https://github.com/planetmint/cryptoconditions.git@gitzenroom \
|
#git+https://github.com/planetmint/cryptoconditions.git@gitzenroom \
|
||||||
git+https://github.com/planetmint/planetmint-driver.git@gitzenroom \
|
#git+https://github.com/planetmint/planetmint-driver.git@gitzenroom \
|
||||||
#planetmint-cryptoconditions>=0.9.0\
|
planetmint-cryptoconditions>=0.9.4\
|
||||||
#planetmint-driver>=0.9.0 \
|
planetmint-driver>=0.9.0 \
|
||||||
blns
|
blns
|
||||||
|
|
||||||
|
|
||||||
@ -58,4 +61,4 @@ RUN pip install --upgrade \
|
|||||||
# pyyaml==5.4.1 \
|
# pyyaml==5.4.1 \
|
||||||
# requests==2.25.1 \
|
# requests==2.25.1 \
|
||||||
# setproctitle==1.2.2
|
# setproctitle==1.2.2
|
||||||
#
|
#
|
||||||
|
@ -4,14 +4,19 @@ RUN apt-get update \
|
|||||||
&& pip install -U pip \
|
&& pip install -U pip \
|
||||||
&& apt-get autoremove \
|
&& apt-get autoremove \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
RUN apt-get install -y vim zsh build-essential cmake openssh-client openssh-server
|
RUN apt-get install -y vim
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install -y build-essential cmake openssh-client openssh-server
|
||||||
|
RUN apt-get install -y zsh
|
||||||
|
|
||||||
RUN mkdir -p /src
|
RUN mkdir -p /src
|
||||||
|
RUN pip install --upgrade meson ninja
|
||||||
RUN pip install --upgrade \
|
RUN pip install --upgrade \
|
||||||
pytest~=6.2.5 \
|
pytest~=6.2.5 \
|
||||||
planetmint-driver~=0.9.0 \
|
planetmint-driver~=0.9.0 \
|
||||||
pycco \
|
pycco \
|
||||||
websocket-client~=0.47.0 \
|
websocket-client~=0.47.0 \
|
||||||
git+https://github.com/planetmint/cryptoconditions.git@gitzenroom \
|
#git+https://github.com/planetmint/cryptoconditions.git@gitzenroom \
|
||||||
git+https://github.com/planetmint/planetmint-driver.git@gitzenroom \
|
#git+https://github.com/planetmint/planetmint-driver.git@gitzenroom \
|
||||||
blns
|
blns
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
__version__ = '0.9.1'
|
__version__ = '0.9.2'
|
||||||
__short_version__ = '0.9'
|
__short_version__ = '0.9'
|
||||||
|
|
||||||
# Supported Tendermint versions
|
# Supported Tendermint versions
|
||||||
|
@ -34,6 +34,7 @@ ROUTES_API_V1 = [
|
|||||||
r('assets/', assets.AssetListApi),
|
r('assets/', assets.AssetListApi),
|
||||||
r('metadata/', metadata.MetadataApi),
|
r('metadata/', metadata.MetadataApi),
|
||||||
r('blocks/<int:block_id>', blocks.BlockApi),
|
r('blocks/<int:block_id>', blocks.BlockApi),
|
||||||
|
r('blocks/latest', blocks.LatestBlock),
|
||||||
r('blocks/', blocks.BlockListApi),
|
r('blocks/', blocks.BlockListApi),
|
||||||
r('transactions/<string:tx_id>', tx.TransactionApi),
|
r('transactions/<string:tx_id>', tx.TransactionApi),
|
||||||
r('transactions', tx.TransactionListApi),
|
r('transactions', tx.TransactionListApi),
|
||||||
|
@ -13,6 +13,25 @@ from flask_restful import Resource, reqparse
|
|||||||
from planetmint.web.views.base import make_error
|
from planetmint.web.views.base import make_error
|
||||||
|
|
||||||
|
|
||||||
|
class LatestBlock(Resource):
|
||||||
|
def get(self):
|
||||||
|
"""API endpoint to get details about a block.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
A JSON string containing the data about the block.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pool = current_app.config['bigchain_pool']
|
||||||
|
|
||||||
|
with pool() as planet:
|
||||||
|
block = planet.get_latest_block()
|
||||||
|
|
||||||
|
if not block:
|
||||||
|
return make_error(404)
|
||||||
|
|
||||||
|
return block
|
||||||
|
|
||||||
|
|
||||||
class BlockApi(Resource):
|
class BlockApi(Resource):
|
||||||
def get(self, block_id):
|
def get(self, block_id):
|
||||||
"""API endpoint to get details about a block.
|
"""API endpoint to get details about a block.
|
||||||
|
3
setup.py
3
setup.py
@ -43,7 +43,8 @@ dev_require = [
|
|||||||
'ipython',
|
'ipython',
|
||||||
'watchdog',
|
'watchdog',
|
||||||
'logging_tree',
|
'logging_tree',
|
||||||
'pre-commit'
|
'pre-commit',
|
||||||
|
'twine'
|
||||||
]
|
]
|
||||||
|
|
||||||
docs_require = [
|
docs_require = [
|
||||||
|
@ -17,6 +17,12 @@ def test_get_block_returns_404_if_not_found(client):
|
|||||||
res = client.get(BLOCKS_ENDPOINT + '123/')
|
res = client.get(BLOCKS_ENDPOINT + '123/')
|
||||||
assert res.status_code == 404
|
assert res.status_code == 404
|
||||||
|
|
||||||
|
res = client.get(BLOCKS_ENDPOINT + 'latest')
|
||||||
|
assert res.status_code == 200
|
||||||
|
|
||||||
|
res = client.get(BLOCKS_ENDPOINT + 'latest/')
|
||||||
|
assert res.status_code == 200
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.bdb
|
@pytest.mark.bdb
|
||||||
def test_get_blocks_by_txid_endpoint_returns_empty_list_not_found(client):
|
def test_get_blocks_by_txid_endpoint_returns_empty_list_not_found(client):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user