Skip to content

Commit

Permalink
Merge pull request #255 from UnitapApp/fix/bugzz
Browse files Browse the repository at this point in the history
add fields to faucet balance serializer
  • Loading branch information
Bastin authored Jan 9, 2024
2 parents 3d3d6ac + 33edd8e commit 5a7e5ea
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions faucet/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class FaucetBalanceSerializer(serializers.ModelSerializer):
contract_balance = serializers.SerializerMethodField()
wallet_balance = serializers.SerializerMethodField()
chain = ChainSerializer()
get_has_enough_fees = serializers.SerializerMethodField()
get_wallet_address = serializers.SerializerMethodField()

class Meta:
model = Faucet
Expand All @@ -27,8 +29,11 @@ class Meta:
"chain",
"needs_funding",
"has_enough_funds",
"get_has_enough_fees",
"contract_balance",
"wallet_balance",
"fund_manager_address",
"get_wallet_address",
"block_scan_address",
]

Expand All @@ -38,6 +43,12 @@ def get_contract_balance(self, faucet):
def get_wallet_balance(self, faucet):
return faucet.chain.wallet_balance

def get_has_enough_fees(self, faucet):
return faucet.chain.has_enough_fees

def get_wallet_address(self, faucet):
return faucet.chain.wallet.address


class SmallFaucetSerializer(serializers.ModelSerializer):
chain = ChainSerializer()
Expand Down

0 comments on commit 5a7e5ea

Please sign in to comment.