Skip to content

Commit

Permalink
Faucet: more constraint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayanShiravani committed Oct 9, 2023
1 parent c1076e9 commit d9f6797
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions faucet/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ def setUp(self) -> None:
name="Test Wallet", private_key=test_wallet_key
)

self.test_chain = create_test_chain(self.wallet)

self.optimism = Chain.objects.create(
chain_name="Optimism",
native_currency_name="ETH",
Expand All @@ -679,6 +681,22 @@ def setUp(self) -> None:
)
self.client.force_authenticate(user=self.user_profile.user)

def test_optimism_donation_contraint(self):
constraint = OptimismDonationConstraint(self.user_profile)
self.assertFalse(constraint.is_observed())
DonationReceipt.objects.create(
user_profile=self.user_profile,
tx_hash = "0x0",
chain = self.test_chain
)
self.assertFalse(constraint.is_observed())
DonationReceipt.objects.create(
user_profile=self.user_profile,
tx_hash = "0x0",
chain = self.optimism
)
self.assertTrue(constraint.is_observed())

def test_optimism_claiming_gas_contraint(self):
constraint = OptimismClaimingGasConstraint(self.user_profile)
self.assertTrue(constraint.is_observed())
Expand Down

0 comments on commit d9f6797

Please sign in to comment.