diff --git a/src/rpcTest/resources/README.md b/src/rpcTest/README.md similarity index 100% rename from src/rpcTest/resources/README.md rename to src/rpcTest/README.md diff --git a/src/rpcTest/resources/privateNetConfig/conf/rpc-test-private-genesis.json b/src/rpcTest/resources/privateNetConfig/conf/rpc-test-private-genesis.json index 77cc30743c..49c1cc450c 100644 --- a/src/rpcTest/resources/privateNetConfig/conf/rpc-test-private-genesis.json +++ b/src/rpcTest/resources/privateNetConfig/conf/rpc-test-private-genesis.json @@ -1,7 +1,7 @@ { "extraData": "0x00", "nonce": "0x0000000000000042", - "gasLimit": "0x2fefd8", + "gasLimit": "0xffffffffff", "difficulty": "0x400", "ommersHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "timestamp": "0x00", diff --git a/src/rpcTest/resources/privateNetConfig/conf/rpc-test-private.conf b/src/rpcTest/resources/privateNetConfig/conf/rpc-test-private.conf index 2614ca612d..da984edd30 100644 --- a/src/rpcTest/resources/privateNetConfig/conf/rpc-test-private.conf +++ b/src/rpcTest/resources/privateNetConfig/conf/rpc-test-private.conf @@ -8,7 +8,7 @@ mantis { network = "rpc-test-private" - rpc-test-private = ${mantis.blockchains.base} + rpc-test-private = ${mantis.blockchains.etc} rpc-test-private { dao = null custom-genesis-file = ./conf/rpc-test-private-genesis.json diff --git a/src/rpcTest/scala/io/iohk/ethereum/rpcTest/RpcApiTests.scala b/src/rpcTest/scala/io/iohk/ethereum/rpcTest/RpcApiTests.scala index e767540f3c..6546ba0eeb 100644 --- a/src/rpcTest/scala/io/iohk/ethereum/rpcTest/RpcApiTests.scala +++ b/src/rpcTest/scala/io/iohk/ethereum/rpcTest/RpcApiTests.scala @@ -176,7 +176,7 @@ class RpcApiTests extends AnyFlatSpec with Matchers with Logger { val pBlock = response1.getBlock pBlock should not equal null - pBlock.getNumber compareTo lBlock.getNumber should be <= 0 + pBlock.getNumber should be >= lBlock.getNumber } it should "eth_getUncleByBlockNumberAndIndex" taggedAs (MainNet) in new ScenarioSetup { @@ -899,7 +899,7 @@ class RpcApiTests extends AnyFlatSpec with Matchers with Logger { nonExistingFilterChanges.getLogs.asScala.size shouldEqual 0 } - it should "eth_newBlockFilter" taggedAs (PrivNet, MainNet) in new ScenarioSetup { + it should "eth_newBlockFilter" taggedAs (PrivNet) in new ScenarioSetup { val blockFilter = service.ethNewBlockFilter().send() val filterid = blockFilter.getFilterId @@ -1054,22 +1054,40 @@ class RpcApiTests extends AnyFlatSpec with Matchers with Logger { getHashRateResponse3.getHashrate.asBigInt shouldEqual 0 } - it should "eth_getTransactionCount without mining" taggedAs (PrivNetNoMining) in new ScenarioSetup { + it should "eth_getTransactionCount (without pending block) without mining" taggedAs (PrivNetNoMining) in new ScenarioSetup { val unlockAccountResponse = service.personalUnlockAccount(firstAccount.address, firstAccount.password, 0).send() unlockAccountResponse.accountUnlocked() shouldEqual true - val curentCountResponse = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() - val currentCount = curentCountResponse.getTransactionCount + val currentCountResponse = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() + val currentCount = currentCountResponse.getTransactionCount val transferAmount = 100 val response1 = service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmount)).send() response1.getError shouldEqual null - val curentCountResponse1 = service.ethGetTransactionCount(firstAccount.address, pendingBlock).send() - val currentCount1 = curentCountResponse1.getTransactionCount + val txCountResponse = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() + val txCount = txCountResponse.getTransactionCount - currentCount.asBigInt shouldEqual currentCount1.asBigInt + txCount.asBigInt shouldEqual currentCount.asBigInt + } + + it should "eth_getTransactionCount (with pending block) without mining" taggedAs (PrivNetNoMining) in new ScenarioSetup { + val unlockAccountResponse = service.personalUnlockAccount(firstAccount.address, firstAccount.password, 0).send() + unlockAccountResponse.accountUnlocked() shouldEqual true + + val currentCountResponse = service.ethGetTransactionCount(firstAccount.address, latestBlock).send() + val currentCount = currentCountResponse.getTransactionCount + + val transferAmount = 100 + val response1 = + service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmount)).send() + response1.getError shouldEqual null + + val txCountResponseWithPendingBlock = service.ethGetTransactionCount(firstAccount.address, pendingBlock).send() + val txCount = txCountResponseWithPendingBlock.getTransactionCount + + txCount.asBigInt shouldEqual currentCount.asBigInt + 1 } it should "personal_ListAccounts and eth_ListAccounts " taggedAs (PrivNet) in new ScenarioSetup {