Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.18.2 #352

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ jobs:
parse-json-secrets: true
# This step recovers the artifact that is generated in the `deploy.yml` workflow
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v3.0.2
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
# https://github.com/actions/download-artifact/releases/tag/v4.1.8
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: node_modules
- name: Unpack node modules
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:
run: |
tar -cvf node_modules.tar ./node_modules
- name: Upload node modules
uses: actions/upload-artifact@v2
# https://github.com/actions/upload-artifact/releases/tag/v4.3.4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
with:
name: node_modules
path: node_modules.tar
Expand All @@ -83,7 +84,7 @@ jobs:
hathor_nodes: https://node1.testnet.hathor.network,https://node.explorer.testnet.hathor.network
redis_key_prefix: hathor-explorer-service-dev
redis_port: 6379
redis_db: 0
redis_db: 1
metadata_bucket: hathor-explorer-metadata-dev
cors_allowed_regex: .*
elastic_index: dev-token
Expand Down Expand Up @@ -136,7 +137,7 @@ jobs:
serverless_stage: nano
# XXX: Some env vars come from the secret https://eu-central-1.console.aws.amazon.com/secretsmanager/secret?name=ExplorerService%2Fnano-testnet&region=eu-central-1
api_port: 3001
hathor_core_url: https://node1.nano-testnet.hathor.network
hathor_core_url: https://hathorplay.nano-testnet.hathor.network
hathor_nodes: https://node1.nano-testnet.hathor.network
redis_key_prefix: hathor-explorer-service-nano-testnet
redis_port: 6379
Expand Down
3 changes: 3 additions & 0 deletions common/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,6 @@ def default(cls) -> "LogRenderer":
HEALTHCHECK_REDIS_ENABLED = config(
"HEALTHCHECK_REDIS_ENABLED", default=False, cast=bool
)

# API configuration
MAX_TX_CHILDREN = config("MAX_TX_CHILDREN", default=100)
7 changes: 7 additions & 0 deletions handlers/node_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from aws_lambda_context import LambdaContext

from common.configuration import MAX_TX_CHILDREN
from common.errors import ApiError
from usecases.node_api import NodeApi
from utils.wrappers.aws.api_gateway import ApiGateway, ApiGatewayEvent
Expand Down Expand Up @@ -176,6 +177,12 @@ def get_transaction(
if id is None:
raise ApiError("invalid_parameters")
response = node_api.get_transaction(id)
# It does not make sense to show in the explorer thousands of children.
# The full node will continue returning the correct data but in the explorer
# service we will truncate it and return only the latest MAX_TX_CHILDREN to show in the UI
# (it might even be more than we should, maybe we should paginate in the future)
if response is not None and "meta" in response and "children" in response["meta"]:
response["meta"]["children"] = response["meta"]["children"][-MAX_TX_CHILDREN:]

return {
"statusCode": 200,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hathor-explorer-service",
"version": "0.18.1",
"version": "0.18.2",
"description": "Hathor Explorer Service Serverless deps",
"dependencies": {
"@apidevtools/swagger-cli": "^4.0.4",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hathor-explorer-service"
version = "0.18.1"
version = "0.18.2"
description = ""
authors = ["Hathor Labs <[email protected]>"]
license = "MIT"
Expand Down
Loading