problem: fails to respond when requested block doesn't exist

This commit is contained in:
Igor Artamonov
2021-06-07 12:28:01 -04:00
parent 8424288de2
commit 91ffb0212e
3 changed files with 90 additions and 3 deletions

View File

@@ -31,6 +31,33 @@ class StandardCallsSpec extends Specification {
act.error == null
}
def "get non-existing block"() {
when:
def act = client.execute("eth_getBlockByNumber", ["0x200001", false])
then:
act.result == null
act.error == null
}
def "get tx"() {
when:
def act = client.execute("eth_getTransactionByHash", ["0x01c5a8461d06c2c195035c148af0f871c7679841d86ae5bb98676bb2d8e68dfa"])
then:
act.result != null
with(act.result) {
blockHash == "0x9a834c53bbee9c2665a5a84789a1d1ad73750b2d77b50de44f457f411d02e52e"
}
act.error == null
}
def "get non-existing tx"() {
when:
def act = client.execute("eth_getTransactionByHash", ["0x000000461d06c2c195035c148af0f871c7679841d86ae5bb98676bb2d8e68dfa"])
then:
act.result == null
act.error == null
}
def "get block with txes"() {
when:
def act = client.execute("eth_getBlockByNumber", ["0x100001", true])