diff --git a/.ci-config/rippled.cfg b/.ci-config/rippled.cfg index 6038e6636..a8551be1f 100644 --- a/.ci-config/rippled.cfg +++ b/.ci-config/rippled.cfg @@ -105,10 +105,6 @@ validators.txt # Note: The version of rippled you use this config with must have an implementation for the amendments you attempt to enable or it will crash. # If you need the version of rippled to be more up to date, you may need to make a comment on this repo: https://github.com/WietseWind/docker-rippled -# network_id is required otherwise it's read as None -[network_id] -63456 - [features] # Devnet amendments as of June 28th, 2023 NegativeUNL diff --git a/tests/integration/sugar/test_network_id.py b/tests/integration/sugar/test_network_id.py new file mode 100644 index 000000000..b91ca8264 --- /dev/null +++ b/tests/integration/sugar/test_network_id.py @@ -0,0 +1,24 @@ +from unittest import TestCase + +from xrpl.asyncio.transaction.main import _RESTRICTED_NETWORKS +from xrpl.clients import WebsocketClient +from xrpl.models.transactions import AccountSet +from xrpl.transaction import autofill + +_FEE = "0.00001" + + +# TODO: move to test_transaction and use the standard integration test setup +class TestNetworkID(TestCase): + # Autofill should override tx networkID for network with ID > 1024 + # and build_version from 1.11.0 or later. + def test_networkid_override(self): + with WebsocketClient("wss://hooks-testnet-v3.xrpl-labs.com") as client: + tx = AccountSet( + account="rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + fee=_FEE, + domain="www.example.com", + ) + tx_autofilled = autofill(tx, client) + self.assertGreaterEqual(client.network_id, _RESTRICTED_NETWORKS) + self.assertEqual(tx_autofilled.network_id, client.network_id) diff --git a/tests/integration/sugar/test_transaction.py b/tests/integration/sugar/test_transaction.py index 7e4b8b6fb..eec64e505 100644 --- a/tests/integration/sugar/test_transaction.py +++ b/tests/integration/sugar/test_transaction.py @@ -216,23 +216,6 @@ async def test_calculate_payment_fee(self, client): expected_fee = await get_fee(client) self.assertEqual(payment_autofilled.fee, expected_fee) - @test_async_and_sync( - globals(), - ["xrpl.transaction.autofill"], - ) - # Autofill should populate the tx networkID and build_version from 1.11.0 or later. - async def test_autofill_populate_networkid(self, client): - tx = AccountSet( - account="rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", - fee=FEE, - domain="www.example.com", - ) - await autofill(tx, client) - self.assertEqual(client.network_id, 63456) - - # the build_version changes with newer releases of rippled - self.assertEqual(client.build_version, "2.2.0-b3") - class TestSubmitAndWait(IntegrationTestCase): @test_async_and_sync(