|
12 | 12 | use RefRing\MoneroRpcPhp\Exception\InvalidDestinationException; |
13 | 13 | use RefRing\MoneroRpcPhp\Model\Address; |
14 | 14 | use RefRing\MoneroRpcPhp\Model\Amount; |
| 15 | +use RefRing\MoneroRpcPhp\Tests\Attribute\RequiresMoneroVersion; |
15 | 16 | use RefRing\MoneroRpcPhp\Tests\TestHelper; |
16 | | -use RefRing\MoneroRpcPhp\Tests\Util\StdOutLogger; |
| 17 | +use RefRing\MoneroRpcPhp\Tests\Trait\RequiresMoneroVersionTrait; |
17 | 18 | use RefRing\MoneroRpcPhp\WalletRpc\Model\Destination; |
18 | 19 | use RefRing\MoneroRpcPhp\WalletRpc\Model\TransferType; |
19 | 20 | use RefRing\MoneroRpcPhp\WalletRpc\TransferResponse; |
20 | 21 | use RefRing\MoneroRpcPhp\WalletRpcClient; |
21 | 22 |
|
22 | 23 | final class TransferTest extends TestCase |
23 | 24 | { |
| 25 | + use RequiresMoneroVersionTrait; |
| 26 | + |
24 | 27 | public static array $seeds = [TestHelper::WALLET_1_MNEMONIC, TestHelper::WALLET_2_MNEMONIC]; |
25 | 28 |
|
26 | 29 | public static array $wallets = []; |
@@ -51,6 +54,16 @@ public static function setUpBeforeClass(): void |
51 | 54 | self::$daemonRpcClient->generateBlocks(100, TestHelper::MAINNET_ADDRESS_1); |
52 | 55 | } |
53 | 56 |
|
| 57 | + protected function setUp(): void |
| 58 | + { |
| 59 | + $this->checkMoneroVersionRequirements(); |
| 60 | + } |
| 61 | + |
| 62 | + protected static function getDaemonRpcClient(): DaemonRpcClient |
| 63 | + { |
| 64 | + return self::$daemonRpcClient; |
| 65 | + } |
| 66 | + |
54 | 67 | public function testWallet(): void |
55 | 68 | { |
56 | 69 | self::$walletRpcClient->refresh(); |
@@ -201,6 +214,7 @@ public function testScanTx(TransferResponse $transferResponse): void |
201 | 214 | $result = self::$walletRpcClient->scanTx([$transferResponse->txHash]); |
202 | 215 | } |
203 | 216 |
|
| 217 | + #[RequiresMoneroVersion('0.18.4.1')] |
204 | 218 | public function testSubaddressLookahead(): void |
205 | 219 | { |
206 | 220 | // Restore wallet 1 for this test |
@@ -242,15 +256,15 @@ public function testSubaddressLookahead(): void |
242 | 256 | self::$walletRpcClient->transfer($destination); |
243 | 257 |
|
244 | 258 | // Mine a block to confirm the transaction |
245 | | - self::$daemonRpcClient->generateBlocks(1, TestHelper::MAINNET_ADDRESS_1); |
| 259 | + self::$daemonRpcClient->generateBlocks(10, TestHelper::MAINNET_ADDRESS_1); |
246 | 260 |
|
247 | 261 | // Switch back to wallet 1 and verify the balance |
248 | 262 | self::$walletRpcClient->restoreDeterministicWallet('', '', self::$seeds[0]); |
249 | 263 | // Re-apply lookahead since wallet was restored |
250 | 264 | self::$walletRpcClient->setSubaddressLookahead(50, 1000); |
251 | 265 | self::$walletRpcClient->refresh(); |
252 | 266 |
|
253 | | - $balanceResult = self::$walletRpcClient->getBalance(0, [999]); |
| 267 | + $balanceResult = self::$walletRpcClient->getBalance(0); |
254 | 268 | $this->assertNotEmpty($balanceResult->perSubaddress, 'Balance info for subaddress should exist'); |
255 | 269 |
|
256 | 270 | $balanceInfo0_999 = null; |
|
0 commit comments