Skip to content

Commit

Permalink
feature Xahau
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Oct 8, 2024
1 parent 508b385 commit c5f62b6
Show file tree
Hide file tree
Showing 57 changed files with 2,123 additions and 856 deletions.
4 changes: 2 additions & 2 deletions .ci-config/xahaud.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ pool.ntp.org
[ips]
r.xahau.com 51235

# # # # # # # [validators_file]
# # # # # # # validators.txt
# [validators_file]
# validators.txt

[rpc_startup]
{ "command": "log_level", "severity": "info" }
Expand Down
66 changes: 61 additions & 5 deletions tests/integration/reusable_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
fund_wallet_async,
sign_and_reliable_submission_async,
)
from xahau.models import IssuedCurrencyAmount, OfferCreate, PaymentChannelCreate
from xahau.models import (
IssuedCurrencyAmount,
OfferCreate,
Payment,
PaymentChannelCreate,
TrustSet,
)
from xahau.wallet import Wallet


Expand All @@ -16,10 +22,58 @@ async def _set_up_reusable_values():
await fund_wallet_async(wallet)
destination = Wallet.create()
await fund_wallet_async(destination)
door_wallet = Wallet.create()
await fund_wallet_async(door_wallet)
witness_wallet = Wallet.create()
await fund_wallet_async(witness_wallet)
gateway = Wallet.create()
await fund_wallet_async(gateway)

await sign_and_reliable_submission_async(
TrustSet(
account=wallet.classic_address,
limit_amount=IssuedCurrencyAmount(
currency="USD",
issuer=gateway.classic_address,
value="10000",
),
),
wallet,
)

await sign_and_reliable_submission_async(
TrustSet(
account=destination.classic_address,
limit_amount=IssuedCurrencyAmount(
currency="USD",
issuer=gateway.classic_address,
value="10000",
),
),
destination,
)

await sign_and_reliable_submission_async(
Payment(
account=gateway.classic_address,
destination=wallet.classic_address,
amount=IssuedCurrencyAmount(
currency="USD",
issuer=gateway.classic_address,
value="10000",
),
),
gateway,
)

await sign_and_reliable_submission_async(
Payment(
account=gateway.classic_address,
destination=destination.classic_address,
amount=IssuedCurrencyAmount(
currency="USD",
issuer=gateway.classic_address,
value="10000",
),
),
gateway,
)

offer = await sign_and_reliable_submission_async(
OfferCreate(
Expand Down Expand Up @@ -48,6 +102,7 @@ async def _set_up_reusable_values():
return (
wallet,
destination,
gateway,
offer,
payment_channel,
)
Expand All @@ -56,6 +111,7 @@ async def _set_up_reusable_values():
(
WALLET,
DESTINATION,
GATEWAY,
OFFER,
PAYMENT_CHANNEL,
) = asyncio.run(_set_up_reusable_values())
2 changes: 1 addition & 1 deletion tests/integration/sugar/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def test_does_account_exist_false(self, client):
self.assertFalse(await does_account_exist(address, client))

@test_async_and_sync(globals(), ["xahau.account.does_account_exist"])
async def _test_does_account_exist_throws_for_invalid_account(self, client):
async def __test_does_account_exist_throws_for_invalid_account(self, client):
address = "a"
with self.assertRaises(XAHLRequestFailureException):
await does_account_exist(address, client)
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/sugar/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def generate_faucet_wallet_and_fund_again(


class TestWallet(IntegrationTestCase):
async def _test_run_faucet_tests(self):
async def __test_run_faucet_tests(self):
# run all the tests that start with `_test_` in parallel
def run_test(test_name):
with self.subTest(method=test_name):
Expand Down Expand Up @@ -112,7 +112,7 @@ async def _parallel_test_generate_faucet_wallet_rel_sub(self):
# Custom host tests

async def _parallel_test_generate_faucet_wallet_custom_host_async_websockets(self):
async with AsyncWebsocketClient("wss://xahau-test.net:51233") as client:
async with AsyncWebsocketClient("wss://xahau-test.net") as client:
await generate_faucet_wallet_and_fund_again(
self,
client,
Expand All @@ -130,7 +130,7 @@ async def _parallel_test_generate_faucet_wallet_custom_host_async_json_rpc(self)
)

def _parallel_test_generate_faucet_wallet_custom_host_sync_websockets(self):
with WebsocketClient("wss://xahau-test.net:51233") as client:
with WebsocketClient("wss://xahau-test.net") as client:
sync_generate_faucet_wallet_and_fund_again(self, client, "xahau-test.net")

def _parallel_test_generate_faucet_wallet_custom_host_sync_json_rpc(self):
Expand All @@ -144,7 +144,7 @@ async def _parallel_test_generate_faucet_wallet_testnet_async_websockets(self):
await generate_faucet_wallet_and_fund_again(self, client)

async def _parallel_test_generate_faucet_wallet_devnet_async_websockets(self):
async with AsyncWebsocketClient("wss://xahau-test.net:51233") as client:
async with AsyncWebsocketClient("wss://xahau-test.net") as client:
await generate_faucet_wallet_and_fund_again(self, client)

def test_wallet_get_xaddress(self):
Expand Down
Loading

0 comments on commit c5f62b6

Please sign in to comment.