Skip to content

Commit 0f8ce90

Browse files
committed
Switch to private testnet with clean up and upgrade
1 parent 36867f8 commit 0f8ce90

7 files changed

Lines changed: 69 additions & 46 deletions

File tree

Monero.IntegrationTests/MoneroDaemonRpcIntegrationTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public async Task TestGetMinerTxSum()
323323
}
324324

325325
// Can get a fee estimate
326-
[Fact]
326+
[Fact(Skip = "Not supported by testnet daemon")]
327327
public async Task TestGetFeeEstimate()
328328
{
329329
GetFeeEstimateResponse feeEstimateResponse = await _daemon.GetFeeEstimate(null);
@@ -862,7 +862,7 @@ private static void TestBlockTemplate(MoneroBlockTemplate template)
862862
Assert.NotNull(template.SeedHeight);
863863
// regtest daemon has seed height equal to zero
864864
Assert.NotNull(template.SeedHash);
865-
Assert.True(template.SeedHash.Length > 0);
865+
Assert.Equal(0, template.SeedHash.Length);
866866
// next seed hash can be null or initialized // TODO: test circumstances for each
867867
}
868868

Monero.IntegrationTests/MoneroWalletRpcIntegrationTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ public async Task TestGetSubaddresses()
571571
}
572572
}
573573

574-
// Can get subaddresses at specified account and subaddress indices
574+
// Can get subaddresses at a specified account and subaddress indices
575575
[Fact]
576576
public async Task TestGetSubaddressesByIndices()
577577
{
@@ -766,12 +766,12 @@ public async Task TestSaveAndClose()
766766
public async Task TestValidateAddress()
767767
{
768768
// mainnet primary and subaddress validation
769-
Assert.True(await _wallet.IsValidAddress("42U9v3qs5CjZEePHBZHwuSckQXebuZu299NSmVEmQ41YJZQhKcPyujyMSzpDH4VMMVSBo3U3b54JaNvQLwAjqDhKS3rvM3L", false, false));
770-
Assert.True(await _wallet.IsValidAddress("891TQPrWshJVpnBR4ZMhHiHpLx1PUnMqa3ccV5TJFBbqcJa3DWhjBh2QByCv3Su7WDPTGMHmCKkiVFN2fyGJKwbM1t6G7Ea", true, false));
769+
Assert.True(await _wallet.IsValidAddress("42U9v3qs5CjZEePHBZHwuSckQXebuZu299NSmVEmQ41YJZQhKcPyujyMSzpDH4VMMVSBo3U3b54JaNvQLwAjqDhKS3rvM3L", false, true));
770+
Assert.True(await _wallet.IsValidAddress("891TQPrWshJVpnBR4ZMhHiHpLx1PUnMqa3ccV5TJFBbqcJa3DWhjBh2QByCv3Su7WDPTGMHmCKkiVFN2fyGJKwbM1t6G7Ea", true, true));
771771

772772
// testnet primary and subaddress validation
773-
Assert.True(await _wallet.IsValidAddress("9tUBnNCkC3UKGygHCwYvAB1FscpjUuq5e9MYJd2rXuiiTjjfVeSVjnbSG5VTnJgBgy9Y7GTLfxpZNMUwNZjGfdFr1z79eV1", false, true));
774-
Assert.True(await _wallet.IsValidAddress("BgnKzHPJQDcg7xiP7bMN9MfPv9Z8ciT71iEMYnCdgBRBFETWgu9nKTr8fnzyGfU9h9gyNA8SFzYYzHfTS9KhqytSU943Nu1", true, true));
773+
Assert.True(await _wallet.IsValidAddress("9tUBnNCkC3UKGygHCwYvAB1FscpjUuq5e9MYJd2rXuiiTjjfVeSVjnbSG5VTnJgBgy9Y7GTLfxpZNMUwNZjGfdFr1z79eV1", false, false));
774+
Assert.True(await _wallet.IsValidAddress("BgnKzHPJQDcg7xiP7bMN9MfPv9Z8ciT71iEMYnCdgBRBFETWgu9nKTr8fnzyGfU9h9gyNA8SFzYYzHfTS9KhqytSU943Nu1", true, false));
775775

776776
// stagenet primary and subaddress validation
777777
Assert.True(await _wallet.IsValidAddress("5B8s3obCY2ETeQB3GNAGPK2zRGen5UeW1WzegSizVsmf6z5NvM2GLoN6zzk1vHyzGAAfA8pGhuYAeCFZjHAp59jRVQkunGS", false, true));

Monero.IntegrationTests/Utils/StartMining.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private static void Start(ulong numThreads)
1212
TestUtils
1313
.GetDaemonRpc()
1414
.StartMining(
15-
"42U9v3qs5CjZEePHBZHwuSckQXebuZu299NSmVEmQ41YJZQhKcPyujyMSzpDH4VMMVSBo3U3b54JaNvQLwAjqDhKS3rvM3L",
15+
"9xSyMy1r9h3BVjMrF3CTqQCQy36yCfkpn7uVfMyTUbez3hhumqBUqGUNNALjcd7f1HJBRdeH82bCC3veFHW7z3xm28gug4d",
1616
numThreads,
1717
false,
1818
false

Monero.IntegrationTests/Utils/TestUtils.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal abstract class TestUtils
1616

1717
public static readonly bool TestsInContainer = GetDefaultEnv("TESTS_INCONTAINER", "false") == "true";
1818

19-
public static readonly Uri DaemonRpcUri = new(GetDefaultEnv("XMR_DAEMON_URI", "http://127.0.0.1:18081"));
19+
public static readonly Uri DaemonRpcUri = new(GetDefaultEnv("XMR_DAEMON_URI", "http://127.0.0.1:28081"));
2020
public const string DaemonRpcUsername = "";
2121
public const string DaemonRpcPassword = "";
2222

@@ -29,12 +29,9 @@ internal abstract class TestUtils
2929
private const string WalletName = "test_wallet_1";
3030
public const string WalletPassword = "supersecretpassword123";
3131

32-
// test wallet constants
33-
public const MoneroNetworkType NetworkType = MoneroNetworkType.Mainnet;
32+
public const string Seed = "origin hickory pavements tudor sizes hornet tether segments sack technical elbow unsafe legion nitrogen adapt yearbook idols fuzzy pitched goes tusks elbow erase fossil erase";
3433

35-
public const string Seed = "arena fossil anchor tapestry iguana tubes javelin gotten cafe damp talent angled onslaught haggled moon roles gills cigar cowl awning vapidly sighting buzzer delayed iguana";
36-
37-
public const string Address = "4B7nn4hBQhaJ2MBWHLpdUHQMoMqgE2BWtZfofNxTDAJoGgckeEGm4f9WaBuFJmCKuwZ7FE3Di7biKbdafqE4JDj19MWPvQ9";
34+
public const string Address = "9xSyMy1r9h3BVjMrF3CTqQCQy36yCfkpn7uVfMyTUbez3hhumqBUqGUNNALjcd7f1HJBRdeH82bCC3veFHW7z3xm28gug4d";
3835

3936
public const uint FirstReceiveHeight = 171; // NOTE: this value must be the height of the wallet's first tx for tests
4037

Monero.IntegrationTests/docker-compose.yml

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
context: ..
66
dockerfile: Monero.IntegrationTests/Dockerfile
77
environment:
8-
XMR_DAEMON_URI: http://node_2:18081
8+
XMR_DAEMON_URI: http://node_2:28081
99
XMR_WALLET_1_URI: http://xmr_wallet_1:18082
1010
XMR_WALLET_2_URI: http://xmr_wallet_2:18083
1111
TESTS_INCONTAINER: "true"
@@ -19,7 +19,7 @@ services:
1919

2020
# The dev container is not used, it is just handy to run `docker-compose up dev` to start all services
2121
dev:
22-
image: alpine:3.22.1
22+
image: alpine:3.23.3
2323
container_name: dev
2424
command: [ "/bin/sh", "-c", "trap : TERM INT; while :; do echo Ready to code and debug like a rockstar!!!; sleep 2073600; done & wait" ]
2525
depends_on:
@@ -28,69 +28,82 @@ services:
2828
- xmr_wallet_2
2929

3030
node_1:
31-
image: btcpayserver/monero:0.18.4.2
31+
image: btcpayserver/monero:0.18.4.3
3232
container_name: node_1
3333
command: [
3434
"monerod",
35-
"--fixed-difficulty=200",
36-
"--log-level=2",
35+
"--fixed-difficulty=150",
3736
"--p2p-bind-ip=0.0.0.0",
38-
"--p2p-bind-port=48080",
39-
"--rpc-bind-port=18089",
37+
"--p2p-bind-port=18080",
38+
"--rpc-bind-port=18081",
4039
"--rpc-bind-ip=0.0.0.0",
4140
"--confirm-external-bind",
4241
"--rpc-access-control-origins=*",
43-
"--add-exclusive-node=node_2:18080",
44-
"--regtest",
42+
"--testnet",
43+
"--add-exclusive-node=node_2:28080",
4544
"--no-igd",
4645
"--hide-my-port",
4746
"--no-zmq",
48-
"--max-connections-per-ip=100",
49-
"--rpc-max-connections-per-private-ip=100",
50-
"--start-mining=42U9v3qs5CjZEePHBZHwuSckQXebuZu299NSmVEmQ41YJZQhKcPyujyMSzpDH4VMMVSBo3U3b54JaNvQLwAjqDhKS3rvM3L",
47+
"--disable-rpc-ban",
48+
"--rpc-max-connections=1000",
49+
"--max-connections-per-ip=10",
50+
"--rpc-max-connections-per-private-ip=1000",
51+
"--start-mining=9xSyMy1r9h3BVjMrF3CTqQCQy36yCfkpn7uVfMyTUbez3hhumqBUqGUNNALjcd7f1HJBRdeH82bCC3veFHW7z3xm28gug4d",
5152
"--mining-threads=1",
5253
"--non-interactive"
5354
]
5455
volumes:
5556
- xmr_node_1_data:/data
5657
ports:
57-
- "48080:48080"
58-
- "18089:18089"
58+
- "18080:18080"
59+
- "18081:18081"
5960

6061
node_2:
61-
image: btcpayserver/monero:0.18.4.2
62+
image: btcpayserver/monero:0.18.4.3
6263
container_name: node_2
6364
command: [
6465
"monerod",
65-
"--fixed-difficulty=200",
66-
"--log-level=2",
66+
"--fixed-difficulty=150",
6767
"--p2p-bind-ip=0.0.0.0",
68-
"--p2p-bind-port=18080",
68+
"--p2p-bind-port=28080",
69+
"--rpc-bind-port=28081",
6970
"--rpc-bind-ip=0.0.0.0",
7071
"--confirm-external-bind",
71-
"--rpc-bind-port=18081",
7272
"--rpc-access-control-origins=*",
73-
"--add-exclusive-node=node_1:48080",
74-
"--regtest",
73+
"--testnet",
74+
"--add-exclusive-node=node_1:18080",
7575
"--no-igd",
7676
"--hide-my-port",
7777
"--no-zmq",
78-
"--max-connections-per-ip=100",
79-
"--rpc-max-connections-per-private-ip=100",
78+
"--disable-rpc-ban",
79+
"--rpc-max-connections=1000",
80+
"--max-connections-per-ip=10",
81+
"--rpc-max-connections-per-private-ip=1000",
8082
"--non-interactive"
8183
]
8284
volumes:
8385
- xmr_node_2_data:/data
8486
ports:
85-
- "18080:18080"
86-
- "18081:18081"
87+
- "28080:28080"
88+
- "28081:28081"
8789
depends_on:
8890
- node_1
8991

9092
xmr_wallet_1:
91-
image: btcpayserver/monero:0.18.4.2
93+
image: btcpayserver/monero:0.18.4.3
9294
container_name: xmr_wallet_1
93-
command: monero-wallet-rpc --log-level 2 --allow-mismatched-daemon-version --rpc-bind-ip=0.0.0.0 --disable-rpc-login --confirm-external-bind --rpc-bind-port=18082 --non-interactive --trusted-daemon --daemon-address=node_2:18081 --wallet-dir=/wallet --rpc-access-control-origins=* --tx-notify="/bin/sh ./scripts/notifier.sh -k -X GET https://host.docker.internal:14142/monerolikedaemoncallback/tx?cryptoCode=xmr&hash=%s"
95+
command: [
96+
"monero-wallet-rpc",
97+
"--log-level=2",
98+
"--rpc-bind-ip=0.0.0.0",
99+
"--testnet",
100+
"--disable-rpc-login",
101+
"--confirm-external-bind",
102+
"--rpc-bind-port=18082",
103+
"--daemon-address=node_2:28081",
104+
"--wallet-dir=/wallet",
105+
"--rpc-access-control-origins=*"
106+
]
94107
ports:
95108
- "18082:18082"
96109
volumes:
@@ -100,9 +113,22 @@ services:
100113
- node_2
101114

102115
xmr_wallet_2:
103-
image: btcpayserver/monero:0.18.4.2
116+
image: btcpayserver/monero:0.18.4.3
104117
container_name: xmr_wallet_2
105-
command: monero-wallet-rpc --log-level 2 --allow-mismatched-daemon-version --rpc-bind-ip=0.0.0.0 --disable-rpc-login --confirm-external-bind --rpc-bind-port=18083 --non-interactive --trusted-daemon --daemon-address=node_2:18081 --wallet-dir=/wallet --rpc-access-control-origins=* --tx-notify="/bin/sh ./scripts/notifier.sh -k -X GET https://host.docker.internal:14142/monerolikedaemoncallback/tx?cryptoCode=xmr&hash=%s"
118+
command: [
119+
"monero-wallet-rpc",
120+
"--log-level=2",
121+
"--rpc-bind-ip=0.0.0.0",
122+
"--testnet",
123+
"--disable-rpc-login",
124+
"--confirm-external-bind",
125+
"--rpc-bind-port=18083",
126+
"--non-interactive",
127+
"--trusted-daemon",
128+
"--daemon-address=node_2:28081",
129+
"--wallet-dir=/wallet",
130+
"--rpc-access-control-origins=*"
131+
]
106132
ports:
107133
- "18083:18083"
108134
volumes:

Monero.UnitTests/MoneroUtilsUnitTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ public void TestGetPaymentUri()
6868
{
6969
MoneroTxConfig config = new MoneroTxConfig()
7070
.SetAddress(
71-
"42U9v3qs5CjZEePHBZHwuSckQXebuZu299NSmVEmQ41YJZQhKcPyujyMSzpDH4VMMVSBo3U3b54JaNvQLwAjqDhKS3rvM3L")
71+
"9xSyMy1r9h3BVjMrF3CTqQCQy36yCfkpn7uVfMyTUbez3hhumqBUqGUNNALjcd7f1HJBRdeH82bCC3veFHW7z3xm28gug4d")
7272
.SetAmount(XmrToAtomicUnits(0.25))
7373
.SetRecipientName("John Doe")
7474
.SetNote("My transfer to wallet");
7575
string paymentUri = "";
7676
True(
77-
"monero:42U9v3qs5CjZEePHBZHwuSckQXebuZu299NSmVEmQ41YJZQhKcPyujyMSzpDH4VMMVSBo3U3b54JaNvQLwAjqDhKS3rvM3L?tx_amount=0.25&recipient_name=John%20Doe&tx_description=My%20transfer%20to%20wallet" ==
77+
"monero:9xSyMy1r9h3BVjMrF3CTqQCQy36yCfkpn7uVfMyTUbez3hhumqBUqGUNNALjcd7f1HJBRdeH82bCC3veFHW7z3xm28gug4d?tx_amount=0.25&recipient_name=John%20Doe&tx_description=My%20transfer%20to%20wallet" ==
7878
paymentUri);
7979
}
8080

Monero/Daemon/Common/GetFeeEstimateResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class GetFeeEstimateResponse : MoneroRpcResponse
88
public uint Fee { get; set; }
99

1010
[JsonPropertyName("fees")]
11-
public required List<uint> Fees { get; set; }
11+
public List<uint>? Fees { get; set; }
1212

1313
[JsonPropertyName("quantization_mask")]
1414
public uint QuantizationMask { get; set; }

0 commit comments

Comments
 (0)