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

remove: Hooks faucet #705

Merged
merged 10 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Rectify the incorrect usage of a transaction flag name: Update `TF_NO_DIRECT_RIPPLE` to `TF_NO_RIPPLE_DIRECT`
- Add the missing `AMMDeposit` Flag `TF_TWO_ASSET_IF_EMPTY`

### Removed:
- Remove Hooks faucet since it's now on the Xahau testnet.

## [2.5.0] - 2023-11-30

### Added
Expand Down
26 changes: 0 additions & 26 deletions tests/integration/sugar/test_network_id.py

This file was deleted.

66 changes: 0 additions & 66 deletions tests/integration/sugar/test_wallet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import time
from threading import Thread

from tests.integration.integration_test_case import IntegrationTestCase
Expand All @@ -13,8 +12,6 @@
from xrpl.wallet import generate_faucet_wallet as sync_generate_faucet_wallet
from xrpl.wallet.main import Wallet

time_of_last_hooks_faucet_call = 0


def sync_generate_faucet_wallet_and_fund_again(
self, client, faucet_host=None, usage_context="integration_test"
Expand Down Expand Up @@ -160,69 +157,6 @@ async def _parallel_test_generate_faucet_wallet_devnet_async_websockets(self):
) as client:
await generate_faucet_wallet_and_fund_again(self, client)

async def _parallel_test_generate_faucet_wallet_hooks_v3_testnet_async_websockets(
self,
):
async with AsyncWebsocketClient(
"wss://hooks-testnet-v3.xrpl-labs.com"
) as client:
global time_of_last_hooks_faucet_call
# Wait at least 10 seconds since last call to hooks v3 testnet faucet
time_since_last_hooks_call = time.time() - time_of_last_hooks_faucet_call
if time_since_last_hooks_call < 10:
time.sleep(11 - time_since_last_hooks_call)

wallet = await generate_faucet_wallet(
client, usage_context="integration_test"
)
time_of_last_hooks_faucet_call = time.time()

result = await client.request(
AccountInfo(
account=wallet.address,
),
)
balance = int(result.result["account_data"]["Balance"])
self.assertTrue(balance > 0)

# Named different from test_generate_faucet_wallet_hooks_v3_testnet_async_websockets
# so the test runs far from each other since hooks v3 testnet faucet
# requires 10 seconds between calls
async def test_fund_given_wallet_hooks_v3_testnet_async_websockets(self):
async with AsyncWebsocketClient(
"wss://hooks-testnet-v3.xrpl-labs.com"
) as client:
global time_of_last_hooks_faucet_call
wallet = Wallet.create()
time_since_last_hooks_call = time.time() - time_of_last_hooks_faucet_call
if time_since_last_hooks_call < 10:
time.sleep(11 - time_since_last_hooks_call)
time_of_last_hooks_faucet_call = time.time()
await generate_faucet_wallet(client, wallet)
result = await client.request(
AccountInfo(
account=wallet.address,
),
)
balance = int(result.result["account_data"]["Balance"])

# Wait at least 10 seconds since last call to hooks v3 testnet faucet
time_since_last_hooks_call = time.time() - time_of_last_hooks_faucet_call
if time_since_last_hooks_call < 10:
time.sleep(11 - time_since_last_hooks_call)
time_of_last_hooks_faucet_call = time.time()

new_wallet = await generate_faucet_wallet(
client, wallet, usage_context="integration_test"
)
new_result = await client.request(
AccountInfo(
account=new_wallet.address,
),
)
new_balance = int(new_result.result["account_data"]["Balance"])
self.assertTrue(new_balance > balance)

def test_wallet_get_xaddress(self):
wallet = Wallet.create()
expected = classic_address_to_xaddress(wallet.address, None, False)
Expand Down
9 changes: 0 additions & 9 deletions tests/unit/asyn/wallet/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from xrpl.asyncio.wallet.wallet_generation import (
_DEV_FAUCET_URL,
_HOOKS_V3_TEST_FAUCET_URL,
_TEST_FAUCET_URL,
get_faucet_url,
process_faucet_host_url,
Expand Down Expand Up @@ -42,14 +41,6 @@ def test_get_faucet_wallet_test(self):
self.assertEqual(get_faucet_url(json_client_url), expected_faucet)
self.assertEqual(get_faucet_url(ws_client_url), expected_faucet)

def test_get_faucet_wallet_hooks_v3_test(self):
json_client_url = "https://hooks-testnet-v3.xrpl-labs.com"
ws_client_url = "wss://hooks-testnet-v3.xrpl-labs.com"
expected_faucet = _HOOKS_V3_TEST_FAUCET_URL

self.assertEqual(get_faucet_url(json_client_url), expected_faucet)
self.assertEqual(get_faucet_url(ws_client_url), expected_faucet)


class TestProcessFaucetHostURL(TestCase):
"""Test process_faucet_host_url."""
Expand Down
5 changes: 0 additions & 5 deletions xrpl/asyncio/wallet/wallet_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

_TEST_FAUCET_URL: Final[str] = "https://faucet.altnet.rippletest.net/accounts"
_DEV_FAUCET_URL: Final[str] = "https://faucet.devnet.rippletest.net/accounts"
_HOOKS_V3_TEST_FAUCET_URL: Final[
str
] = "https://hooks-testnet-v3.xrpl-labs.com/accounts"

_TIMEOUT_SECONDS: Final[int] = 40

Expand Down Expand Up @@ -170,8 +167,6 @@ def get_faucet_url(url: str, faucet_host: Optional[str] = None) -> str:
"""
if faucet_host is not None:
return process_faucet_host_url(faucet_host)
if "hooks-testnet-v3" in url: # hooks v3 testnet
return _HOOKS_V3_TEST_FAUCET_URL
if "altnet" in url or "testnet" in url: # testnet
return _TEST_FAUCET_URL
if "sidechain-net2" in url: # sidechain issuing chain devnet
Expand Down
Loading