Skip to content

Commit

Permalink
Merge pull request #129 from PotLock/testnet
Browse files Browse the repository at this point in the history
Testnet -> dev
  • Loading branch information
Prometheo authored Dec 27, 2024
2 parents 4ae4d10 + 76b466b commit e7f37e2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion indexer_app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ async def handle_list_update(

logger.info(f"updating list..... {data}")

listObject = await List.objects.filter(on_chain_id=data["id"]).aupdate(
listObject = await List.objects.filter(on_chain_id=data["list_id"]).aupdate(
owner_id=data["owner"],
default_registration_status=data["default_registration_status"],
name=data["name"],
Expand Down
2 changes: 1 addition & 1 deletion nadabot/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from rest_framework.serializers import ModelSerializer, SerializerMethodField
from rest_framework.serializers import ModelSerializer

from .models import NadabotRegistry, Provider, Stamp

Expand Down
32 changes: 30 additions & 2 deletions pots/serializers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer, SerializerMethodField
from rest_framework.serializers import ModelSerializer

from accounts.serializers import SIMPLE_ACCOUNT_EXAMPLE, AccountSerializer
from base.serializers import TwoDecimalPlacesField
from tokens.serializers import SIMPLE_TOKEN_EXAMPLE, TokenSerializer

from .models import Pot, PotApplication, PotFactory, PotPayout
from .models import Pot, PotApplication, PotFactory, PotPayout, PotApplicationReview


class PotSerializer(ModelSerializer):
Expand Down Expand Up @@ -80,7 +80,25 @@ class Meta:
whitelisted_deployers = AccountSerializer(many=True)


class ApplicationReviewSerializer(serializers.ModelSerializer):
reviewer = serializers.SerializerMethodField()

class Meta:
model = PotApplicationReview
fields = [
"reviewer",
"notes",
"status",
"reviewed_at",
"tx_hash"
]

def get_reviewer(self, obj):
return obj.reviewer.id


class PotApplicationSerializer(ModelSerializer):
reviews = ApplicationReviewSerializer(many=True)

class Meta:
model = PotApplication
Expand All @@ -93,6 +111,7 @@ class Meta:
"submitted_at",
"updated_at",
"tx_hash",
"reviews",
]

pot = PotSerializer()
Expand Down Expand Up @@ -211,6 +230,14 @@ class PaginatedPotFactoriesResponseSerializer(serializers.Serializer):
"results": [SIMPLE_POT_FACTORY_EXAMPLE],
}

POT_APPLICATION_REVIEW_EXAMPLE = {
"reviewer": SIMPLE_ACCOUNT_EXAMPLE,
"notes": "Looks good!",
"status": "Approved",
"reviewed_at": "2024-06-05T18:12:39.014Z",
"tx_hash": "EVMQsXorrrxPLHfK9UnbzFUy1SVYWvc8hwSGQZs4RbTk",
}


SIMPLE_POT_APPLICATION_EXAMPLE = {
"id": 2,
Expand All @@ -221,6 +248,7 @@ class PaginatedPotFactoriesResponseSerializer(serializers.Serializer):
"tx_hash": "EVMQsXorrrxPLHfK9UnbzFUy1SVYWvc8hwSGQZs4RbTk",
"pot": SIMPLE_POT_EXAMPLE,
"applicant": SIMPLE_ACCOUNT_EXAMPLE,
"reviews": [POT_APPLICATION_REVIEW_EXAMPLE],
}

PAGINATED_POT_APPLICATION_EXAMPLE = {
Expand Down

0 comments on commit e7f37e2

Please sign in to comment.