kopia lustrzana https://github.com/bugout-dev/moonstream
Add blockchain name to s3 path for contract abi.
rodzic
ea4a2685b5
commit
ea0a81476f
|
@ -38,6 +38,12 @@ from web3 import Web3
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
blockchain_by_subscription_id = {
|
||||||
|
"ethereum_blockchain": "ethereum",
|
||||||
|
"polygon_blockchain": "polygon",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class StatusAPIException(Exception):
|
class StatusAPIException(Exception):
|
||||||
"""
|
"""
|
||||||
Raised during checking Moonstream API statuses.
|
Raised during checking Moonstream API statuses.
|
||||||
|
@ -409,7 +415,7 @@ def upload_abi_to_s3(
|
||||||
bucket = MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET
|
bucket = MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET
|
||||||
|
|
||||||
result_bytes = abi.encode("utf-8")
|
result_bytes = abi.encode("utf-8")
|
||||||
result_key = f"{MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX}/abi/{resource.resource_data['address']}/{resource.id}/abi.json"
|
result_key = f"{MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX}/{blockchain_by_subscription_id[resource.resource_data['subscription_type_id']]}/abi/{resource.resource_data['address']}/{resource.id}/abi.json"
|
||||||
|
|
||||||
s3_client.put_object(
|
s3_client.put_object(
|
||||||
Body=result_bytes,
|
Body=result_bytes,
|
||||||
|
|
|
@ -8,7 +8,7 @@ import logging
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Callable, Dict, List
|
from typing import Any, Dict, List
|
||||||
|
|
||||||
import boto3 # type: ignore
|
import boto3 # type: ignore
|
||||||
from bugout.data import BugoutResources
|
from bugout.data import BugoutResources
|
||||||
|
@ -465,8 +465,6 @@ def stats_generate_handler(args: argparse.Namespace):
|
||||||
)
|
)
|
||||||
already_processed.append(f"{address}/{hash}")
|
already_processed.append(f"{address}/{hash}")
|
||||||
|
|
||||||
time.sleep(10)
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
parser = argparse.ArgumentParser(description="Command Line Interface")
|
parser = argparse.ArgumentParser(description="Command Line Interface")
|
||||||
|
|
Ładowanie…
Reference in New Issue