@@ -176,7 +176,7 @@ class RpcApiTests extends AnyFlatSpec with Matchers with Logger {
176
176
val pBlock = response1.getBlock
177
177
pBlock should not equal null
178
178
179
- pBlock.getNumber compareTo lBlock.getNumber should be <= 0
179
+ pBlock.getNumber should be >= lBlock.getNumber
180
180
}
181
181
182
182
it should " eth_getUncleByBlockNumberAndIndex" taggedAs (MainNet ) in new ScenarioSetup {
@@ -899,7 +899,7 @@ class RpcApiTests extends AnyFlatSpec with Matchers with Logger {
899
899
nonExistingFilterChanges.getLogs.asScala.size shouldEqual 0
900
900
}
901
901
902
- it should " eth_newBlockFilter" taggedAs (PrivNet , MainNet ) in new ScenarioSetup {
902
+ it should " eth_newBlockFilter" taggedAs (PrivNet ) in new ScenarioSetup {
903
903
val blockFilter = service.ethNewBlockFilter().send()
904
904
val filterid = blockFilter.getFilterId
905
905
@@ -1054,22 +1054,40 @@ class RpcApiTests extends AnyFlatSpec with Matchers with Logger {
1054
1054
getHashRateResponse3.getHashrate.asBigInt shouldEqual 0
1055
1055
}
1056
1056
1057
- it should " eth_getTransactionCount without mining" taggedAs (PrivNetNoMining ) in new ScenarioSetup {
1057
+ it should " eth_getTransactionCount (without pending block) without mining" taggedAs (PrivNetNoMining ) in new ScenarioSetup {
1058
1058
val unlockAccountResponse = service.personalUnlockAccount(firstAccount.address, firstAccount.password, 0 ).send()
1059
1059
unlockAccountResponse.accountUnlocked() shouldEqual true
1060
1060
1061
- val curentCountResponse = service.ethGetTransactionCount(firstAccount.address, latestBlock).send()
1062
- val currentCount = curentCountResponse .getTransactionCount
1061
+ val currentCountResponse = service.ethGetTransactionCount(firstAccount.address, latestBlock).send()
1062
+ val currentCount = currentCountResponse .getTransactionCount
1063
1063
1064
1064
val transferAmount = 100
1065
1065
val response1 =
1066
1066
service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmount)).send()
1067
1067
response1.getError shouldEqual null
1068
1068
1069
- val curentCountResponse1 = service.ethGetTransactionCount(firstAccount.address, pendingBlock ).send()
1070
- val currentCount1 = curentCountResponse1 .getTransactionCount
1069
+ val txCountResponse = service.ethGetTransactionCount(firstAccount.address, latestBlock ).send()
1070
+ val txCount = txCountResponse .getTransactionCount
1071
1071
1072
- currentCount.asBigInt shouldEqual currentCount1.asBigInt
1072
+ txCount.asBigInt shouldEqual currentCount.asBigInt
1073
+ }
1074
+
1075
+ it should " eth_getTransactionCount (with pending block) without mining" taggedAs (PrivNetNoMining ) in new ScenarioSetup {
1076
+ val unlockAccountResponse = service.personalUnlockAccount(firstAccount.address, firstAccount.password, 0 ).send()
1077
+ unlockAccountResponse.accountUnlocked() shouldEqual true
1078
+
1079
+ val currentCountResponse = service.ethGetTransactionCount(firstAccount.address, latestBlock).send()
1080
+ val currentCount = currentCountResponse.getTransactionCount
1081
+
1082
+ val transferAmount = 100
1083
+ val response1 =
1084
+ service.ethSendTransaction(valueTransfer(firstAccount.address, secondAccount.address, transferAmount)).send()
1085
+ response1.getError shouldEqual null
1086
+
1087
+ val txCountResponseWithPendingBlock = service.ethGetTransactionCount(firstAccount.address, pendingBlock).send()
1088
+ val txCount = txCountResponseWithPendingBlock.getTransactionCount
1089
+
1090
+ txCount.asBigInt shouldEqual currentCount.asBigInt + 1
1073
1091
}
1074
1092
1075
1093
it should " personal_ListAccounts and eth_ListAccounts " taggedAs (PrivNet ) in new ScenarioSetup {
0 commit comments